diff --git a/clients/client-appconfig/.gitignore b/clients/client-appconfig/.gitignore new file mode 100644 index 000000000000..b41c05b597c4 --- /dev/null +++ b/clients/client-appconfig/.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-appconfig/.npmignore b/clients/client-appconfig/.npmignore new file mode 100644 index 000000000000..b7ff81137c4a --- /dev/null +++ b/clients/client-appconfig/.npmignore @@ -0,0 +1,4 @@ +/coverage/ +/docs/ +tsconfig.test.json +*.tsbuildinfo diff --git a/clients/client-appconfig/AppConfig.ts b/clients/client-appconfig/AppConfig.ts new file mode 100644 index 000000000000..5639e55cc94c --- /dev/null +++ b/clients/client-appconfig/AppConfig.ts @@ -0,0 +1,1315 @@ +import { AppConfigClient } from "./AppConfigClient"; +import { + CreateApplicationCommand, + CreateApplicationCommandInput, + CreateApplicationCommandOutput +} from "./commands/CreateApplicationCommand"; +import { + CreateConfigurationProfileCommand, + CreateConfigurationProfileCommandInput, + CreateConfigurationProfileCommandOutput +} from "./commands/CreateConfigurationProfileCommand"; +import { + CreateDeploymentStrategyCommand, + CreateDeploymentStrategyCommandInput, + CreateDeploymentStrategyCommandOutput +} from "./commands/CreateDeploymentStrategyCommand"; +import { + CreateEnvironmentCommand, + CreateEnvironmentCommandInput, + CreateEnvironmentCommandOutput +} from "./commands/CreateEnvironmentCommand"; +import { + DeleteApplicationCommand, + DeleteApplicationCommandInput, + DeleteApplicationCommandOutput +} from "./commands/DeleteApplicationCommand"; +import { + DeleteConfigurationProfileCommand, + DeleteConfigurationProfileCommandInput, + DeleteConfigurationProfileCommandOutput +} from "./commands/DeleteConfigurationProfileCommand"; +import { + DeleteDeploymentStrategyCommand, + DeleteDeploymentStrategyCommandInput, + DeleteDeploymentStrategyCommandOutput +} from "./commands/DeleteDeploymentStrategyCommand"; +import { + DeleteEnvironmentCommand, + DeleteEnvironmentCommandInput, + DeleteEnvironmentCommandOutput +} from "./commands/DeleteEnvironmentCommand"; +import { + GetApplicationCommand, + GetApplicationCommandInput, + GetApplicationCommandOutput +} from "./commands/GetApplicationCommand"; +import { + GetConfigurationCommand, + GetConfigurationCommandInput, + GetConfigurationCommandOutput +} from "./commands/GetConfigurationCommand"; +import { + GetConfigurationProfileCommand, + GetConfigurationProfileCommandInput, + GetConfigurationProfileCommandOutput +} from "./commands/GetConfigurationProfileCommand"; +import { + GetDeploymentCommand, + GetDeploymentCommandInput, + GetDeploymentCommandOutput +} from "./commands/GetDeploymentCommand"; +import { + GetDeploymentStrategyCommand, + GetDeploymentStrategyCommandInput, + GetDeploymentStrategyCommandOutput +} from "./commands/GetDeploymentStrategyCommand"; +import { + GetEnvironmentCommand, + GetEnvironmentCommandInput, + GetEnvironmentCommandOutput +} from "./commands/GetEnvironmentCommand"; +import { + ListApplicationsCommand, + ListApplicationsCommandInput, + ListApplicationsCommandOutput +} from "./commands/ListApplicationsCommand"; +import { + ListConfigurationProfilesCommand, + ListConfigurationProfilesCommandInput, + ListConfigurationProfilesCommandOutput +} from "./commands/ListConfigurationProfilesCommand"; +import { + ListDeploymentStrategiesCommand, + ListDeploymentStrategiesCommandInput, + ListDeploymentStrategiesCommandOutput +} from "./commands/ListDeploymentStrategiesCommand"; +import { + ListDeploymentsCommand, + ListDeploymentsCommandInput, + ListDeploymentsCommandOutput +} from "./commands/ListDeploymentsCommand"; +import { + ListEnvironmentsCommand, + ListEnvironmentsCommandInput, + ListEnvironmentsCommandOutput +} from "./commands/ListEnvironmentsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput +} from "./commands/ListTagsForResourceCommand"; +import { + StartDeploymentCommand, + StartDeploymentCommandInput, + StartDeploymentCommandOutput +} from "./commands/StartDeploymentCommand"; +import { + StopDeploymentCommand, + StopDeploymentCommandInput, + StopDeploymentCommandOutput +} from "./commands/StopDeploymentCommand"; +import { + TagResourceCommand, + TagResourceCommandInput, + TagResourceCommandOutput +} from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput +} from "./commands/UntagResourceCommand"; +import { + UpdateApplicationCommand, + UpdateApplicationCommandInput, + UpdateApplicationCommandOutput +} from "./commands/UpdateApplicationCommand"; +import { + UpdateConfigurationProfileCommand, + UpdateConfigurationProfileCommandInput, + UpdateConfigurationProfileCommandOutput +} from "./commands/UpdateConfigurationProfileCommand"; +import { + UpdateDeploymentStrategyCommand, + UpdateDeploymentStrategyCommandInput, + UpdateDeploymentStrategyCommandOutput +} from "./commands/UpdateDeploymentStrategyCommand"; +import { + UpdateEnvironmentCommand, + UpdateEnvironmentCommandInput, + UpdateEnvironmentCommandOutput +} from "./commands/UpdateEnvironmentCommand"; +import { + ValidateConfigurationCommand, + ValidateConfigurationCommandInput, + ValidateConfigurationCommandOutput +} from "./commands/ValidateConfigurationCommand"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +/** + * + * AWS AppConfig + *

Use AWS AppConfig, a capability of AWS Systems Manager, to create, manage, and quickly deploy + * application configurations. AppConfig supports controlled deployments to applications of any size + * and includes built-in validation checks and monitoring. You can use AppConfig with applications + * hosted on Amazon EC2 instances, AWS Lambda, containers, mobile applications, or IoT + * devices.

+ * + *

To prevent errors when deploying application configurations, especially for production + * systems where a simple typo could cause an unexpected outage, AppConfig includes validators. A + * validator provides a syntactic or semantic check to ensure that the configuration you want + * to deploy works as intended. To validate your application configuration data, you provide a + * schema or a Lambda function that runs against the configuration. The configuration + * deployment or update can only proceed when the configuration data is valid.

+ * + *

During a configuration deployment, AppConfig monitors the application to ensure that the + * deployment is successful. If the system encounters an error, AppConfig rolls back the change to + * minimize impact for your application users. You can configure a deployment strategy for + * each application or environment that includes deployment criteria, including velocity, bake + * time, and alarms to monitor. Similar to error monitoring, if a deployment triggers an alarm, + * AppConfig automatically rolls back to the previous version.

+ * + *

AppConfig supports multiple use cases. Here are some examples.

+ * + *

This reference is intended to be used with the AWS AppConfig User Guide.

+ * + */ +export class AppConfig extends AppConfigClient { + /** + * + *

For each application, you define one or more environments. An environment is a logical + * deployment group of AppConfig targets, such as applications in a Beta or + * Production environment. You can also define environments for application + * subcomponents such as the Web, Mobile and Back-end + * components for your application. You can configure Amazon CloudWatch alarms for each environment. + * The system monitors alarms during a configuration deployment. If an alarm is triggered, the + * system rolls back the configuration.

+ * + */ + public createEnvironment( + args: CreateEnvironmentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createEnvironment( + args: CreateEnvironmentCommandInput, + cb: (err: any, data?: CreateEnvironmentCommandOutput) => void + ): void; + public createEnvironment( + args: CreateEnvironmentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateEnvironmentCommandOutput) => void + ): void; + public createEnvironment( + args: CreateEnvironmentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateEnvironmentCommandOutput) => void), + cb?: (err: any, data?: CreateEnvironmentCommandOutput) => void + ): Promise | void { + const command = new CreateEnvironmentCommand(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); + } + } + + /** + * + *

Delete an environment. Deleting an environment does not delete a configuration from a + * host.

+ * + */ + public deleteEnvironment( + args: DeleteEnvironmentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteEnvironment( + args: DeleteEnvironmentCommandInput, + cb: (err: any, data?: DeleteEnvironmentCommandOutput) => void + ): void; + public deleteEnvironment( + args: DeleteEnvironmentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteEnvironmentCommandOutput) => void + ): void; + public deleteEnvironment( + args: DeleteEnvironmentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteEnvironmentCommandOutput) => void), + cb?: (err: any, data?: DeleteEnvironmentCommandOutput) => void + ): Promise | void { + const command = new DeleteEnvironmentCommand(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); + } + } + + /** + * + *

Delete a deployment strategy. Deleting a deployment strategy does not delete a + * configuration from a host.

+ * + */ + public deleteDeploymentStrategy( + args: DeleteDeploymentStrategyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteDeploymentStrategy( + args: DeleteDeploymentStrategyCommandInput, + cb: (err: any, data?: DeleteDeploymentStrategyCommandOutput) => void + ): void; + public deleteDeploymentStrategy( + args: DeleteDeploymentStrategyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteDeploymentStrategyCommandOutput) => void + ): void; + public deleteDeploymentStrategy( + args: DeleteDeploymentStrategyCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteDeploymentStrategyCommandOutput) => void), + cb?: (err: any, data?: DeleteDeploymentStrategyCommandOutput) => void + ): Promise | void { + const command = new DeleteDeploymentStrategyCommand(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 list of key-value tags assigned to the resource.

+ * + */ + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListTagsForResourceCommandOutput) => void), + cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): Promise | void { + const command = new ListTagsForResourceCommand(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); + } + } + + /** + * + *

Lists the deployments for an environment.

+ * + */ + public listDeployments( + args: ListDeploymentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listDeployments( + args: ListDeploymentsCommandInput, + cb: (err: any, data?: ListDeploymentsCommandOutput) => void + ): void; + public listDeployments( + args: ListDeploymentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDeploymentsCommandOutput) => void + ): void; + public listDeployments( + args: ListDeploymentsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListDeploymentsCommandOutput) => void), + cb?: (err: any, data?: ListDeploymentsCommandOutput) => void + ): Promise | void { + const command = new ListDeploymentsCommand(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); + } + } + + /** + * + *

List all applications in your AWS account.

+ * + */ + public listApplications( + args: ListApplicationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listApplications( + args: ListApplicationsCommandInput, + cb: (err: any, data?: ListApplicationsCommandOutput) => void + ): void; + public listApplications( + args: ListApplicationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListApplicationsCommandOutput) => void + ): void; + public listApplications( + args: ListApplicationsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListApplicationsCommandOutput) => void), + cb?: (err: any, data?: ListApplicationsCommandOutput) => void + ): Promise | void { + const command = new ListApplicationsCommand(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); + } + } + + /** + * + *

Lists the configuration profiles for an application.

+ * + */ + public listConfigurationProfiles( + args: ListConfigurationProfilesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listConfigurationProfiles( + args: ListConfigurationProfilesCommandInput, + cb: (err: any, data?: ListConfigurationProfilesCommandOutput) => void + ): void; + public listConfigurationProfiles( + args: ListConfigurationProfilesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListConfigurationProfilesCommandOutput) => void + ): void; + public listConfigurationProfiles( + args: ListConfigurationProfilesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListConfigurationProfilesCommandOutput) => void), + cb?: (err: any, data?: ListConfigurationProfilesCommandOutput) => void + ): Promise | void { + const command = new ListConfigurationProfilesCommand(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 a configuration profile.

+ * + */ + public updateConfigurationProfile( + args: UpdateConfigurationProfileCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateConfigurationProfile( + args: UpdateConfigurationProfileCommandInput, + cb: (err: any, data?: UpdateConfigurationProfileCommandOutput) => void + ): void; + public updateConfigurationProfile( + args: UpdateConfigurationProfileCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateConfigurationProfileCommandOutput) => void + ): void; + public updateConfigurationProfile( + args: UpdateConfigurationProfileCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateConfigurationProfileCommandOutput) => void), + cb?: (err: any, data?: UpdateConfigurationProfileCommandOutput) => void + ): Promise | void { + const command = new UpdateConfigurationProfileCommand(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); + } + } + + /** + * + *

Stops a deployment. This API action works only on deployments that have a status of + * DEPLOYING. This action moves the deployment to a status of + * ROLLED_BACK.

+ * + */ + public stopDeployment( + args: StopDeploymentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopDeployment( + args: StopDeploymentCommandInput, + cb: (err: any, data?: StopDeploymentCommandOutput) => void + ): void; + public stopDeployment( + args: StopDeploymentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopDeploymentCommandOutput) => void + ): void; + public stopDeployment( + args: StopDeploymentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StopDeploymentCommandOutput) => void), + cb?: (err: any, data?: StopDeploymentCommandOutput) => void + ): Promise | void { + const command = new StopDeploymentCommand(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); + } + } + + /** + * + *

An application in AppConfig is a logical unit of code that provides capabilities for your + * customers. For example, an application can be a microservice that runs on Amazon EC2 instances, + * a mobile application installed by your users, a serverless application using Amazon API + * Gateway and AWS Lambda, or any system you run on behalf of others.

+ * + */ + public createApplication( + args: CreateApplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createApplication( + args: CreateApplicationCommandInput, + cb: (err: any, data?: CreateApplicationCommandOutput) => void + ): void; + public createApplication( + args: CreateApplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateApplicationCommandOutput) => void + ): void; + public createApplication( + args: CreateApplicationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateApplicationCommandOutput) => void), + cb?: (err: any, data?: CreateApplicationCommandOutput) => void + ): Promise | void { + const command = new CreateApplicationCommand(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); + } + } + + /** + * + *

Retrieve information about a deployment strategy. A deployment strategy defines + * important criteria for rolling out your configuration to the designated targets. A + * deployment strategy includes: the overall duration required, a percentage of targets to + * receive the deployment during each interval, an algorithm that defines how percentage + * grows, and bake time.

+ * + */ + public getDeploymentStrategy( + args: GetDeploymentStrategyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getDeploymentStrategy( + args: GetDeploymentStrategyCommandInput, + cb: (err: any, data?: GetDeploymentStrategyCommandOutput) => void + ): void; + public getDeploymentStrategy( + args: GetDeploymentStrategyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetDeploymentStrategyCommandOutput) => void + ): void; + public getDeploymentStrategy( + args: GetDeploymentStrategyCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetDeploymentStrategyCommandOutput) => void), + cb?: (err: any, data?: GetDeploymentStrategyCommandOutput) => void + ): Promise | void { + const command = new GetDeploymentStrategyCommand(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); + } + } + + /** + * + *

Delete an application. Deleting an application does not delete a configuration from a + * host.

+ * + */ + public deleteApplication( + args: DeleteApplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteApplication( + args: DeleteApplicationCommandInput, + cb: (err: any, data?: DeleteApplicationCommandOutput) => void + ): void; + public deleteApplication( + args: DeleteApplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteApplicationCommandOutput) => void + ): void; + public deleteApplication( + args: DeleteApplicationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteApplicationCommandOutput) => void), + cb?: (err: any, data?: DeleteApplicationCommandOutput) => void + ): Promise | void { + const command = new DeleteApplicationCommand(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); + } + } + + /** + * + *

List deployment strategies.

+ * + */ + public listDeploymentStrategies( + args: ListDeploymentStrategiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listDeploymentStrategies( + args: ListDeploymentStrategiesCommandInput, + cb: (err: any, data?: ListDeploymentStrategiesCommandOutput) => void + ): void; + public listDeploymentStrategies( + args: ListDeploymentStrategiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDeploymentStrategiesCommandOutput) => void + ): void; + public listDeploymentStrategies( + args: ListDeploymentStrategiesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListDeploymentStrategiesCommandOutput) => void), + cb?: (err: any, data?: ListDeploymentStrategiesCommandOutput) => void + ): Promise | void { + const command = new ListDeploymentStrategiesCommand(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); + } + } + + /** + * + *

Uses the validators in a configuration profile to validate a configuration.

+ * + */ + public validateConfiguration( + args: ValidateConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public validateConfiguration( + args: ValidateConfigurationCommandInput, + cb: (err: any, data?: ValidateConfigurationCommandOutput) => void + ): void; + public validateConfiguration( + args: ValidateConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ValidateConfigurationCommandOutput) => void + ): void; + public validateConfiguration( + args: ValidateConfigurationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ValidateConfigurationCommandOutput) => void), + cb?: (err: any, data?: ValidateConfigurationCommandOutput) => void + ): Promise | void { + const command = new ValidateConfigurationCommand(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 a tag key and value from an AppConfig resource.

+ * + */ + public untagResource( + args: UntagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public untagResource( + args: UntagResourceCommandInput, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UntagResourceCommandOutput) => void), + cb?: (err: any, data?: UntagResourceCommandOutput) => void + ): Promise | void { + const command = new UntagResourceCommand(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); + } + } + + /** + * + *

Starts a deployment.

+ * + */ + public startDeployment( + args: StartDeploymentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startDeployment( + args: StartDeploymentCommandInput, + cb: (err: any, data?: StartDeploymentCommandOutput) => void + ): void; + public startDeployment( + args: StartDeploymentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartDeploymentCommandOutput) => void + ): void; + public startDeployment( + args: StartDeploymentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StartDeploymentCommandOutput) => void), + cb?: (err: any, data?: StartDeploymentCommandOutput) => void + ): Promise | void { + const command = new StartDeploymentCommand(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); + } + } + + /** + * + *

Retrieve information about a configuration.

+ * + */ + public getConfiguration( + args: GetConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getConfiguration( + args: GetConfigurationCommandInput, + cb: (err: any, data?: GetConfigurationCommandOutput) => void + ): void; + public getConfiguration( + args: GetConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetConfigurationCommandOutput) => void + ): void; + public getConfiguration( + args: GetConfigurationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetConfigurationCommandOutput) => void), + cb?: (err: any, data?: GetConfigurationCommandOutput) => void + ): Promise | void { + const command = new GetConfigurationCommand(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 a deployment strategy.

+ * + */ + public updateDeploymentStrategy( + args: UpdateDeploymentStrategyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateDeploymentStrategy( + args: UpdateDeploymentStrategyCommandInput, + cb: (err: any, data?: UpdateDeploymentStrategyCommandOutput) => void + ): void; + public updateDeploymentStrategy( + args: UpdateDeploymentStrategyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateDeploymentStrategyCommandOutput) => void + ): void; + public updateDeploymentStrategy( + args: UpdateDeploymentStrategyCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateDeploymentStrategyCommandOutput) => void), + cb?: (err: any, data?: UpdateDeploymentStrategyCommandOutput) => void + ): Promise | void { + const command = new UpdateDeploymentStrategyCommand(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); + } + } + + /** + * + *

Retrieve information about an environment. An environment is a logical deployment group + * of AppConfig applications, such as applications in a Production environment or in + * an EU_Region environment. Each configuration deployment targets an + * environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is + * triggered during a deployment, AppConfig roles back the configuration.

+ * + */ + public getEnvironment( + args: GetEnvironmentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getEnvironment( + args: GetEnvironmentCommandInput, + cb: (err: any, data?: GetEnvironmentCommandOutput) => void + ): void; + public getEnvironment( + args: GetEnvironmentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetEnvironmentCommandOutput) => void + ): void; + public getEnvironment( + args: GetEnvironmentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetEnvironmentCommandOutput) => void), + cb?: (err: any, data?: GetEnvironmentCommandOutput) => void + ): Promise | void { + const command = new GetEnvironmentCommand(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); + } + } + + /** + * + *

List the environments for an application.

+ * + */ + public listEnvironments( + args: ListEnvironmentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listEnvironments( + args: ListEnvironmentsCommandInput, + cb: (err: any, data?: ListEnvironmentsCommandOutput) => void + ): void; + public listEnvironments( + args: ListEnvironmentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListEnvironmentsCommandOutput) => void + ): void; + public listEnvironments( + args: ListEnvironmentsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListEnvironmentsCommandOutput) => void), + cb?: (err: any, data?: ListEnvironmentsCommandOutput) => void + ): Promise | void { + const command = new ListEnvironmentsCommand(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); + } + } + + /** + * + *

Information that enables AppConfig to access the configuration source. Valid configuration + * sources include Systems Manager (SSM) documents and SSM Parameter Store parameters. A configuration + * profile includes the following information.

+ *
    + *
  • + *

    The Uri location of the configuration data.

    + *
  • + *
  • + *

    The AWS Identity and Access Management (IAM) role that provides access to the configuration data.

    + *
  • + *
  • + *

    A validator for the configuration data. Available validators include either a JSON + * Schema or an AWS Lambda function.

    + *
  • + *
+ * + */ + public createConfigurationProfile( + args: CreateConfigurationProfileCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createConfigurationProfile( + args: CreateConfigurationProfileCommandInput, + cb: (err: any, data?: CreateConfigurationProfileCommandOutput) => void + ): void; + public createConfigurationProfile( + args: CreateConfigurationProfileCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateConfigurationProfileCommandOutput) => void + ): void; + public createConfigurationProfile( + args: CreateConfigurationProfileCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateConfigurationProfileCommandOutput) => void), + cb?: (err: any, data?: CreateConfigurationProfileCommandOutput) => void + ): Promise | void { + const command = new CreateConfigurationProfileCommand(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); + } + } + + /** + * + *

Delete a configuration profile. Deleting a configuration profile does not delete a + * configuration from a host.

+ * + */ + public deleteConfigurationProfile( + args: DeleteConfigurationProfileCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteConfigurationProfile( + args: DeleteConfigurationProfileCommandInput, + cb: (err: any, data?: DeleteConfigurationProfileCommandOutput) => void + ): void; + public deleteConfigurationProfile( + args: DeleteConfigurationProfileCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteConfigurationProfileCommandOutput) => void + ): void; + public deleteConfigurationProfile( + args: DeleteConfigurationProfileCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteConfigurationProfileCommandOutput) => void), + cb?: (err: any, data?: DeleteConfigurationProfileCommandOutput) => void + ): Promise | void { + const command = new DeleteConfigurationProfileCommand(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); + } + } + + /** + * + *

Retrieve information about a configuration deployment.

+ * + */ + public getDeployment( + args: GetDeploymentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getDeployment( + args: GetDeploymentCommandInput, + cb: (err: any, data?: GetDeploymentCommandOutput) => void + ): void; + public getDeployment( + args: GetDeploymentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetDeploymentCommandOutput) => void + ): void; + public getDeployment( + args: GetDeploymentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetDeploymentCommandOutput) => void), + cb?: (err: any, data?: GetDeploymentCommandOutput) => void + ): Promise | void { + const command = new GetDeploymentCommand(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 an application.

+ * + */ + public updateApplication( + args: UpdateApplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateApplication( + args: UpdateApplicationCommandInput, + cb: (err: any, data?: UpdateApplicationCommandOutput) => void + ): void; + public updateApplication( + args: UpdateApplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateApplicationCommandOutput) => void + ): void; + public updateApplication( + args: UpdateApplicationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateApplicationCommandOutput) => void), + cb?: (err: any, data?: UpdateApplicationCommandOutput) => void + ): Promise | void { + const command = new UpdateApplicationCommand(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); + } + } + + /** + * + *

Retrieve information about an application.

+ * + */ + public getApplication( + args: GetApplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getApplication( + args: GetApplicationCommandInput, + cb: (err: any, data?: GetApplicationCommandOutput) => void + ): void; + public getApplication( + args: GetApplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetApplicationCommandOutput) => void + ): void; + public getApplication( + args: GetApplicationCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetApplicationCommandOutput) => void), + cb?: (err: any, data?: GetApplicationCommandOutput) => void + ): Promise | void { + const command = new GetApplicationCommand(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); + } + } + + /** + * + *

A deployment strategy defines important criteria for rolling out your configuration to + * the designated targets. A deployment strategy includes: the overall duration required, a + * percentage of targets to receive the deployment during each interval, an algorithm that + * defines how percentage grows, and bake time.

+ * + */ + public createDeploymentStrategy( + args: CreateDeploymentStrategyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createDeploymentStrategy( + args: CreateDeploymentStrategyCommandInput, + cb: (err: any, data?: CreateDeploymentStrategyCommandOutput) => void + ): void; + public createDeploymentStrategy( + args: CreateDeploymentStrategyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateDeploymentStrategyCommandOutput) => void + ): void; + public createDeploymentStrategy( + args: CreateDeploymentStrategyCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateDeploymentStrategyCommandOutput) => void), + cb?: (err: any, data?: CreateDeploymentStrategyCommandOutput) => void + ): Promise | void { + const command = new CreateDeploymentStrategyCommand(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); + } + } + + /** + * + *

Retrieve information about a configuration profile.

+ * + */ + public getConfigurationProfile( + args: GetConfigurationProfileCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getConfigurationProfile( + args: GetConfigurationProfileCommandInput, + cb: (err: any, data?: GetConfigurationProfileCommandOutput) => void + ): void; + public getConfigurationProfile( + args: GetConfigurationProfileCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetConfigurationProfileCommandOutput) => void + ): void; + public getConfigurationProfile( + args: GetConfigurationProfileCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetConfigurationProfileCommandOutput) => void), + cb?: (err: any, data?: GetConfigurationProfileCommandOutput) => void + ): Promise | void { + const command = new GetConfigurationProfileCommand(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 an environment.

+ * + */ + public updateEnvironment( + args: UpdateEnvironmentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateEnvironment( + args: UpdateEnvironmentCommandInput, + cb: (err: any, data?: UpdateEnvironmentCommandOutput) => void + ): void; + public updateEnvironment( + args: UpdateEnvironmentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateEnvironmentCommandOutput) => void + ): void; + public updateEnvironment( + args: UpdateEnvironmentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateEnvironmentCommandOutput) => void), + cb?: (err: any, data?: UpdateEnvironmentCommandOutput) => void + ): Promise | void { + const command = new UpdateEnvironmentCommand(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); + } + } + + /** + * + *

Metadata to assign to an AppConfig resource. Tags help organize and categorize your AppConfig + * resources. Each tag consists of a key and an optional value, both of which you define. You + * can specify a maximum of 50 tags for a resource.

+ * + */ + public tagResource( + args: TagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public tagResource( + args: TagResourceCommandInput, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + public tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + public tagResource( + args: TagResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: TagResourceCommandOutput) => void), + cb?: (err: any, data?: TagResourceCommandOutput) => void + ): Promise | void { + const command = new TagResourceCommand(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-appconfig/AppConfigClient.ts b/clients/client-appconfig/AppConfigClient.ts new file mode 100644 index 000000000000..5b6c18f10b23 --- /dev/null +++ b/clients/client-appconfig/AppConfigClient.ts @@ -0,0 +1,334 @@ +import { + Application, + Applications, + Configuration, + ConfigurationProfile, + ConfigurationProfiles, + CreateApplicationRequest, + CreateConfigurationProfileRequest, + CreateDeploymentStrategyRequest, + CreateEnvironmentRequest, + DeleteApplicationRequest, + DeleteConfigurationProfileRequest, + DeleteDeploymentStrategyRequest, + DeleteEnvironmentRequest, + Deployment, + DeploymentStrategies, + DeploymentStrategy, + Deployments, + Environment, + Environments, + GetApplicationRequest, + GetConfigurationProfileRequest, + GetConfigurationRequest, + GetDeploymentRequest, + GetDeploymentStrategyRequest, + GetEnvironmentRequest, + ListApplicationsRequest, + ListConfigurationProfilesRequest, + ListDeploymentStrategiesRequest, + ListDeploymentsRequest, + ListEnvironmentsRequest, + ListTagsForResourceRequest, + ResourceTags, + StartDeploymentRequest, + StopDeploymentRequest, + TagResourceRequest, + UntagResourceRequest, + UpdateApplicationRequest, + UpdateConfigurationProfileRequest, + UpdateDeploymentStrategyRequest, + UpdateEnvironmentRequest, + ValidateConfigurationRequest +} 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, + MetadataBearer as __MetadataBearer, + Provider as __Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser +} from "@aws-sdk/types"; + +export type ServiceInputTypes = + | CreateApplicationRequest + | CreateConfigurationProfileRequest + | CreateDeploymentStrategyRequest + | CreateEnvironmentRequest + | DeleteApplicationRequest + | DeleteConfigurationProfileRequest + | DeleteDeploymentStrategyRequest + | DeleteEnvironmentRequest + | GetApplicationRequest + | GetConfigurationProfileRequest + | GetConfigurationRequest + | GetDeploymentRequest + | GetDeploymentStrategyRequest + | GetEnvironmentRequest + | ListApplicationsRequest + | ListConfigurationProfilesRequest + | ListDeploymentStrategiesRequest + | ListDeploymentsRequest + | ListEnvironmentsRequest + | ListTagsForResourceRequest + | StartDeploymentRequest + | StopDeploymentRequest + | TagResourceRequest + | UntagResourceRequest + | UpdateApplicationRequest + | UpdateConfigurationProfileRequest + | UpdateDeploymentStrategyRequest + | UpdateEnvironmentRequest + | ValidateConfigurationRequest; + +export type ServiceOutputTypes = + | __MetadataBearer + | Application + | Application + | Application + | Applications + | Configuration + | ConfigurationProfile + | ConfigurationProfile + | ConfigurationProfile + | ConfigurationProfiles + | Deployment + | Deployment + | Deployment + | DeploymentStrategies + | DeploymentStrategy + | DeploymentStrategy + | DeploymentStrategy + | Deployments + | Environment + | Environment + | Environment + | Environments + | ResourceTags; + +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 AppConfigClientConfig = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointsInputConfig & + AwsAuthInputConfig & + RetryInputConfig & + UserAgentInputConfig & + HostHeaderInputConfig; + +export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration< + __HttpHandlerOptions +> & + Required & + RegionResolvedConfig & + EndpointsResolvedConfig & + AwsAuthResolvedConfig & + RetryResolvedConfig & + UserAgentResolvedConfig & + HostHeaderResolvedConfig; + +/** + * + * AWS AppConfig + *

Use AWS AppConfig, a capability of AWS Systems Manager, to create, manage, and quickly deploy + * application configurations. AppConfig supports controlled deployments to applications of any size + * and includes built-in validation checks and monitoring. You can use AppConfig with applications + * hosted on Amazon EC2 instances, AWS Lambda, containers, mobile applications, or IoT + * devices.

+ * + *

To prevent errors when deploying application configurations, especially for production + * systems where a simple typo could cause an unexpected outage, AppConfig includes validators. A + * validator provides a syntactic or semantic check to ensure that the configuration you want + * to deploy works as intended. To validate your application configuration data, you provide a + * schema or a Lambda function that runs against the configuration. The configuration + * deployment or update can only proceed when the configuration data is valid.

+ * + *

During a configuration deployment, AppConfig monitors the application to ensure that the + * deployment is successful. If the system encounters an error, AppConfig rolls back the change to + * minimize impact for your application users. You can configure a deployment strategy for + * each application or environment that includes deployment criteria, including velocity, bake + * time, and alarms to monitor. Similar to error monitoring, if a deployment triggers an alarm, + * AppConfig automatically rolls back to the previous version.

+ * + *

AppConfig supports multiple use cases. Here are some examples.

+ *
    + *
  • + *

    + * Application tuning: Use AppConfig to carefully + * introduce changes to your application that can only be tested with production + * traffic.

    + *
  • + *
  • + *

    + * Feature toggle: Use AppConfig to turn on new features + * that require a timely deployment, such as a product launch or announcement.

    + *
  • + *
  • + *

    + * User membership: Use AppConfig to allow premium + * subscribers to access paid content.

    + *
  • + *
  • + *

    + * Operational issues: Use AppConfig to reduce stress on + * your application when a dependency or other external factor impacts the + * system.

    + *
  • + *
+ *

This reference is intended to be used with the AWS AppConfig User Guide.

+ * + */ +export class AppConfigClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + AppConfigClientResolvedConfig +> { + readonly config: AppConfigClientResolvedConfig; + + constructor(configuration: AppConfigClientConfig) { + 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-appconfig/LICENSE b/clients/client-appconfig/LICENSE new file mode 100644 index 000000000000..b7d2463d8cc0 --- /dev/null +++ b/clients/client-appconfig/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-appconfig/README.md b/clients/client-appconfig/README.md new file mode 100644 index 000000000000..4cbdfe41560b --- /dev/null +++ b/clients/client-appconfig/README.md @@ -0,0 +1,6 @@ +@aws-sdk/client-appconfig + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appconfig/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-appconfig) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appconfig.svg)](https://www.npmjs.com/package/@aws-sdk/client-appconfig) + +For SDK usage, please step to [SDK reademe](https://github.com/aws/aws-sdk-js-v3). diff --git a/clients/client-appconfig/commands/CreateApplicationCommand.ts b/clients/client-appconfig/commands/CreateApplicationCommand.ts new file mode 100644 index 000000000000..3f3d0c9d7864 --- /dev/null +++ b/clients/client-appconfig/commands/CreateApplicationCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Application, CreateApplicationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1CreateApplicationCommand, + serializeAws_restJson1_1CreateApplicationCommand +} from "../protocols/Aws_restJson1_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 CreateApplicationCommandInput = CreateApplicationRequest; +export type CreateApplicationCommandOutput = Application; + +export class CreateApplicationCommand extends $Command< + CreateApplicationCommandInput, + CreateApplicationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateApplicationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: CreateApplicationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1CreateApplicationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1CreateApplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/CreateConfigurationProfileCommand.ts b/clients/client-appconfig/commands/CreateConfigurationProfileCommand.ts new file mode 100644 index 000000000000..56d73dd704ef --- /dev/null +++ b/clients/client-appconfig/commands/CreateConfigurationProfileCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + ConfigurationProfile, + CreateConfigurationProfileRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1CreateConfigurationProfileCommand, + serializeAws_restJson1_1CreateConfigurationProfileCommand +} from "../protocols/Aws_restJson1_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 CreateConfigurationProfileCommandInput = CreateConfigurationProfileRequest; +export type CreateConfigurationProfileCommandOutput = ConfigurationProfile; + +export class CreateConfigurationProfileCommand extends $Command< + CreateConfigurationProfileCommandInput, + CreateConfigurationProfileCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateConfigurationProfileCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + CreateConfigurationProfileCommandInput, + CreateConfigurationProfileCommandOutput + > { + 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: CreateConfigurationProfileCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1CreateConfigurationProfileCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1CreateConfigurationProfileCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/CreateDeploymentStrategyCommand.ts b/clients/client-appconfig/commands/CreateDeploymentStrategyCommand.ts new file mode 100644 index 000000000000..b661e210c56f --- /dev/null +++ b/clients/client-appconfig/commands/CreateDeploymentStrategyCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + CreateDeploymentStrategyRequest, + DeploymentStrategy +} from "../models/index"; +import { + deserializeAws_restJson1_1CreateDeploymentStrategyCommand, + serializeAws_restJson1_1CreateDeploymentStrategyCommand +} from "../protocols/Aws_restJson1_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 CreateDeploymentStrategyCommandInput = CreateDeploymentStrategyRequest; +export type CreateDeploymentStrategyCommandOutput = DeploymentStrategy; + +export class CreateDeploymentStrategyCommand extends $Command< + CreateDeploymentStrategyCommandInput, + CreateDeploymentStrategyCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateDeploymentStrategyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + CreateDeploymentStrategyCommandInput, + CreateDeploymentStrategyCommandOutput + > { + 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: CreateDeploymentStrategyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1CreateDeploymentStrategyCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1CreateDeploymentStrategyCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/CreateEnvironmentCommand.ts b/clients/client-appconfig/commands/CreateEnvironmentCommand.ts new file mode 100644 index 000000000000..4debb806e603 --- /dev/null +++ b/clients/client-appconfig/commands/CreateEnvironmentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { CreateEnvironmentRequest, Environment } from "../models/index"; +import { + deserializeAws_restJson1_1CreateEnvironmentCommand, + serializeAws_restJson1_1CreateEnvironmentCommand +} from "../protocols/Aws_restJson1_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 CreateEnvironmentCommandInput = CreateEnvironmentRequest; +export type CreateEnvironmentCommandOutput = Environment; + +export class CreateEnvironmentCommand extends $Command< + CreateEnvironmentCommandInput, + CreateEnvironmentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateEnvironmentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: CreateEnvironmentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1CreateEnvironmentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1CreateEnvironmentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/DeleteApplicationCommand.ts b/clients/client-appconfig/commands/DeleteApplicationCommand.ts new file mode 100644 index 000000000000..eb9e946e0400 --- /dev/null +++ b/clients/client-appconfig/commands/DeleteApplicationCommand.ts @@ -0,0 +1,82 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { DeleteApplicationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1DeleteApplicationCommand, + serializeAws_restJson1_1DeleteApplicationCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type DeleteApplicationCommandInput = DeleteApplicationRequest; +export type DeleteApplicationCommandOutput = __MetadataBearer; + +export class DeleteApplicationCommand extends $Command< + DeleteApplicationCommandInput, + DeleteApplicationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteApplicationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: DeleteApplicationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1DeleteApplicationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1DeleteApplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/DeleteConfigurationProfileCommand.ts b/clients/client-appconfig/commands/DeleteConfigurationProfileCommand.ts new file mode 100644 index 000000000000..7bbea45bd45d --- /dev/null +++ b/clients/client-appconfig/commands/DeleteConfigurationProfileCommand.ts @@ -0,0 +1,91 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { DeleteConfigurationProfileRequest } from "../models/index"; +import { + deserializeAws_restJson1_1DeleteConfigurationProfileCommand, + serializeAws_restJson1_1DeleteConfigurationProfileCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type DeleteConfigurationProfileCommandInput = DeleteConfigurationProfileRequest; +export type DeleteConfigurationProfileCommandOutput = __MetadataBearer; + +export class DeleteConfigurationProfileCommand extends $Command< + DeleteConfigurationProfileCommandInput, + DeleteConfigurationProfileCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteConfigurationProfileCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeleteConfigurationProfileCommandInput, + DeleteConfigurationProfileCommandOutput + > { + 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: DeleteConfigurationProfileCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1DeleteConfigurationProfileCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1DeleteConfigurationProfileCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/DeleteDeploymentStrategyCommand.ts b/clients/client-appconfig/commands/DeleteDeploymentStrategyCommand.ts new file mode 100644 index 000000000000..5ad83327c939 --- /dev/null +++ b/clients/client-appconfig/commands/DeleteDeploymentStrategyCommand.ts @@ -0,0 +1,91 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { DeleteDeploymentStrategyRequest } from "../models/index"; +import { + deserializeAws_restJson1_1DeleteDeploymentStrategyCommand, + serializeAws_restJson1_1DeleteDeploymentStrategyCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type DeleteDeploymentStrategyCommandInput = DeleteDeploymentStrategyRequest; +export type DeleteDeploymentStrategyCommandOutput = __MetadataBearer; + +export class DeleteDeploymentStrategyCommand extends $Command< + DeleteDeploymentStrategyCommandInput, + DeleteDeploymentStrategyCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteDeploymentStrategyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeleteDeploymentStrategyCommandInput, + DeleteDeploymentStrategyCommandOutput + > { + 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: DeleteDeploymentStrategyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1DeleteDeploymentStrategyCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1DeleteDeploymentStrategyCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/DeleteEnvironmentCommand.ts b/clients/client-appconfig/commands/DeleteEnvironmentCommand.ts new file mode 100644 index 000000000000..a788656d6cbe --- /dev/null +++ b/clients/client-appconfig/commands/DeleteEnvironmentCommand.ts @@ -0,0 +1,82 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { DeleteEnvironmentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1DeleteEnvironmentCommand, + serializeAws_restJson1_1DeleteEnvironmentCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type DeleteEnvironmentCommandInput = DeleteEnvironmentRequest; +export type DeleteEnvironmentCommandOutput = __MetadataBearer; + +export class DeleteEnvironmentCommand extends $Command< + DeleteEnvironmentCommandInput, + DeleteEnvironmentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteEnvironmentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: DeleteEnvironmentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1DeleteEnvironmentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1DeleteEnvironmentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetApplicationCommand.ts b/clients/client-appconfig/commands/GetApplicationCommand.ts new file mode 100644 index 000000000000..3642f851a677 --- /dev/null +++ b/clients/client-appconfig/commands/GetApplicationCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Application, GetApplicationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1GetApplicationCommand, + serializeAws_restJson1_1GetApplicationCommand +} from "../protocols/Aws_restJson1_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 GetApplicationCommandInput = GetApplicationRequest; +export type GetApplicationCommandOutput = Application; + +export class GetApplicationCommand extends $Command< + GetApplicationCommandInput, + GetApplicationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetApplicationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: GetApplicationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetApplicationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetApplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetConfigurationCommand.ts b/clients/client-appconfig/commands/GetConfigurationCommand.ts new file mode 100644 index 000000000000..f769581956e1 --- /dev/null +++ b/clients/client-appconfig/commands/GetConfigurationCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Configuration, GetConfigurationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1GetConfigurationCommand, + serializeAws_restJson1_1GetConfigurationCommand +} from "../protocols/Aws_restJson1_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 GetConfigurationCommandInput = GetConfigurationRequest; +export type GetConfigurationCommandOutput = Configuration; + +export class GetConfigurationCommand extends $Command< + GetConfigurationCommandInput, + GetConfigurationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: GetConfigurationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetConfigurationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetConfigurationProfileCommand.ts b/clients/client-appconfig/commands/GetConfigurationProfileCommand.ts new file mode 100644 index 000000000000..295bd22fca98 --- /dev/null +++ b/clients/client-appconfig/commands/GetConfigurationProfileCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + ConfigurationProfile, + GetConfigurationProfileRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1GetConfigurationProfileCommand, + serializeAws_restJson1_1GetConfigurationProfileCommand +} from "../protocols/Aws_restJson1_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 GetConfigurationProfileCommandInput = GetConfigurationProfileRequest; +export type GetConfigurationProfileCommandOutput = ConfigurationProfile; + +export class GetConfigurationProfileCommand extends $Command< + GetConfigurationProfileCommandInput, + GetConfigurationProfileCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetConfigurationProfileCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetConfigurationProfileCommandInput, + GetConfigurationProfileCommandOutput + > { + 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: GetConfigurationProfileCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetConfigurationProfileCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetConfigurationProfileCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetDeploymentCommand.ts b/clients/client-appconfig/commands/GetDeploymentCommand.ts new file mode 100644 index 000000000000..a6bb6d7f5990 --- /dev/null +++ b/clients/client-appconfig/commands/GetDeploymentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Deployment, GetDeploymentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1GetDeploymentCommand, + serializeAws_restJson1_1GetDeploymentCommand +} from "../protocols/Aws_restJson1_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 GetDeploymentCommandInput = GetDeploymentRequest; +export type GetDeploymentCommandOutput = Deployment; + +export class GetDeploymentCommand extends $Command< + GetDeploymentCommandInput, + GetDeploymentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetDeploymentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: GetDeploymentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetDeploymentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetDeploymentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetDeploymentStrategyCommand.ts b/clients/client-appconfig/commands/GetDeploymentStrategyCommand.ts new file mode 100644 index 000000000000..958c600ae815 --- /dev/null +++ b/clients/client-appconfig/commands/GetDeploymentStrategyCommand.ts @@ -0,0 +1,90 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + DeploymentStrategy, + GetDeploymentStrategyRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1GetDeploymentStrategyCommand, + serializeAws_restJson1_1GetDeploymentStrategyCommand +} from "../protocols/Aws_restJson1_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 GetDeploymentStrategyCommandInput = GetDeploymentStrategyRequest; +export type GetDeploymentStrategyCommandOutput = DeploymentStrategy; + +export class GetDeploymentStrategyCommand extends $Command< + GetDeploymentStrategyCommandInput, + GetDeploymentStrategyCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetDeploymentStrategyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetDeploymentStrategyCommandInput, + GetDeploymentStrategyCommandOutput + > { + 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: GetDeploymentStrategyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetDeploymentStrategyCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetDeploymentStrategyCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/GetEnvironmentCommand.ts b/clients/client-appconfig/commands/GetEnvironmentCommand.ts new file mode 100644 index 000000000000..d7b9c3bba54d --- /dev/null +++ b/clients/client-appconfig/commands/GetEnvironmentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Environment, GetEnvironmentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1GetEnvironmentCommand, + serializeAws_restJson1_1GetEnvironmentCommand +} from "../protocols/Aws_restJson1_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 GetEnvironmentCommandInput = GetEnvironmentRequest; +export type GetEnvironmentCommandOutput = Environment; + +export class GetEnvironmentCommand extends $Command< + GetEnvironmentCommandInput, + GetEnvironmentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetEnvironmentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: GetEnvironmentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1GetEnvironmentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1GetEnvironmentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListApplicationsCommand.ts b/clients/client-appconfig/commands/ListApplicationsCommand.ts new file mode 100644 index 000000000000..9e04347ac755 --- /dev/null +++ b/clients/client-appconfig/commands/ListApplicationsCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Applications, ListApplicationsRequest } from "../models/index"; +import { + deserializeAws_restJson1_1ListApplicationsCommand, + serializeAws_restJson1_1ListApplicationsCommand +} from "../protocols/Aws_restJson1_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 ListApplicationsCommandInput = ListApplicationsRequest; +export type ListApplicationsCommandOutput = Applications; + +export class ListApplicationsCommand extends $Command< + ListApplicationsCommandInput, + ListApplicationsCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListApplicationsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: ListApplicationsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListApplicationsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListApplicationsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListConfigurationProfilesCommand.ts b/clients/client-appconfig/commands/ListConfigurationProfilesCommand.ts new file mode 100644 index 000000000000..07432dc501c0 --- /dev/null +++ b/clients/client-appconfig/commands/ListConfigurationProfilesCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + ConfigurationProfiles, + ListConfigurationProfilesRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1ListConfigurationProfilesCommand, + serializeAws_restJson1_1ListConfigurationProfilesCommand +} from "../protocols/Aws_restJson1_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 ListConfigurationProfilesCommandInput = ListConfigurationProfilesRequest; +export type ListConfigurationProfilesCommandOutput = ConfigurationProfiles; + +export class ListConfigurationProfilesCommand extends $Command< + ListConfigurationProfilesCommandInput, + ListConfigurationProfilesCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListConfigurationProfilesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListConfigurationProfilesCommandInput, + ListConfigurationProfilesCommandOutput + > { + 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: ListConfigurationProfilesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListConfigurationProfilesCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListConfigurationProfilesCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListDeploymentStrategiesCommand.ts b/clients/client-appconfig/commands/ListDeploymentStrategiesCommand.ts new file mode 100644 index 000000000000..1e327b45a811 --- /dev/null +++ b/clients/client-appconfig/commands/ListDeploymentStrategiesCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + DeploymentStrategies, + ListDeploymentStrategiesRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1ListDeploymentStrategiesCommand, + serializeAws_restJson1_1ListDeploymentStrategiesCommand +} from "../protocols/Aws_restJson1_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 ListDeploymentStrategiesCommandInput = ListDeploymentStrategiesRequest; +export type ListDeploymentStrategiesCommandOutput = DeploymentStrategies; + +export class ListDeploymentStrategiesCommand extends $Command< + ListDeploymentStrategiesCommandInput, + ListDeploymentStrategiesCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListDeploymentStrategiesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListDeploymentStrategiesCommandInput, + ListDeploymentStrategiesCommandOutput + > { + 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: ListDeploymentStrategiesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListDeploymentStrategiesCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListDeploymentStrategiesCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListDeploymentsCommand.ts b/clients/client-appconfig/commands/ListDeploymentsCommand.ts new file mode 100644 index 000000000000..b936f20e3763 --- /dev/null +++ b/clients/client-appconfig/commands/ListDeploymentsCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Deployments, ListDeploymentsRequest } from "../models/index"; +import { + deserializeAws_restJson1_1ListDeploymentsCommand, + serializeAws_restJson1_1ListDeploymentsCommand +} from "../protocols/Aws_restJson1_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 ListDeploymentsCommandInput = ListDeploymentsRequest; +export type ListDeploymentsCommandOutput = Deployments; + +export class ListDeploymentsCommand extends $Command< + ListDeploymentsCommandInput, + ListDeploymentsCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListDeploymentsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: ListDeploymentsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListDeploymentsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListDeploymentsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListEnvironmentsCommand.ts b/clients/client-appconfig/commands/ListEnvironmentsCommand.ts new file mode 100644 index 000000000000..ebbf0d6ff4ab --- /dev/null +++ b/clients/client-appconfig/commands/ListEnvironmentsCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Environments, ListEnvironmentsRequest } from "../models/index"; +import { + deserializeAws_restJson1_1ListEnvironmentsCommand, + serializeAws_restJson1_1ListEnvironmentsCommand +} from "../protocols/Aws_restJson1_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 ListEnvironmentsCommandInput = ListEnvironmentsRequest; +export type ListEnvironmentsCommandOutput = Environments; + +export class ListEnvironmentsCommand extends $Command< + ListEnvironmentsCommandInput, + ListEnvironmentsCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListEnvironmentsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: ListEnvironmentsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListEnvironmentsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListEnvironmentsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ListTagsForResourceCommand.ts b/clients/client-appconfig/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..1eaad7b4d187 --- /dev/null +++ b/clients/client-appconfig/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,87 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { ListTagsForResourceRequest, ResourceTags } from "../models/index"; +import { + deserializeAws_restJson1_1ListTagsForResourceCommand, + serializeAws_restJson1_1ListTagsForResourceCommand +} from "../protocols/Aws_restJson1_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 ListTagsForResourceCommandInput = ListTagsForResourceRequest; +export type ListTagsForResourceCommandOutput = ResourceTags; + +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListTagsForResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput + > { + 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: ListTagsForResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ListTagsForResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ListTagsForResourceCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/StartDeploymentCommand.ts b/clients/client-appconfig/commands/StartDeploymentCommand.ts new file mode 100644 index 000000000000..1cfeec675530 --- /dev/null +++ b/clients/client-appconfig/commands/StartDeploymentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Deployment, StartDeploymentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1StartDeploymentCommand, + serializeAws_restJson1_1StartDeploymentCommand +} from "../protocols/Aws_restJson1_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 StartDeploymentCommandInput = StartDeploymentRequest; +export type StartDeploymentCommandOutput = Deployment; + +export class StartDeploymentCommand extends $Command< + StartDeploymentCommandInput, + StartDeploymentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartDeploymentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: StartDeploymentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1StartDeploymentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1StartDeploymentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/StopDeploymentCommand.ts b/clients/client-appconfig/commands/StopDeploymentCommand.ts new file mode 100644 index 000000000000..566c1668dfe1 --- /dev/null +++ b/clients/client-appconfig/commands/StopDeploymentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Deployment, StopDeploymentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1StopDeploymentCommand, + serializeAws_restJson1_1StopDeploymentCommand +} from "../protocols/Aws_restJson1_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 StopDeploymentCommandInput = StopDeploymentRequest; +export type StopDeploymentCommandOutput = Deployment; + +export class StopDeploymentCommand extends $Command< + StopDeploymentCommandInput, + StopDeploymentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopDeploymentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: StopDeploymentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1StopDeploymentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1StopDeploymentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/TagResourceCommand.ts b/clients/client-appconfig/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..c80772ec435c --- /dev/null +++ b/clients/client-appconfig/commands/TagResourceCommand.ts @@ -0,0 +1,82 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { TagResourceRequest } from "../models/index"; +import { + deserializeAws_restJson1_1TagResourceCommand, + serializeAws_restJson1_1TagResourceCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type TagResourceCommandInput = TagResourceRequest; +export type TagResourceCommandOutput = __MetadataBearer; + +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: TagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: TagResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1TagResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1TagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/UntagResourceCommand.ts b/clients/client-appconfig/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..217d9b58cb5b --- /dev/null +++ b/clients/client-appconfig/commands/UntagResourceCommand.ts @@ -0,0 +1,82 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { UntagResourceRequest } from "../models/index"; +import { + deserializeAws_restJson1_1UntagResourceCommand, + serializeAws_restJson1_1UntagResourceCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type UntagResourceCommandInput = UntagResourceRequest; +export type UntagResourceCommandOutput = __MetadataBearer; + +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UntagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: UntagResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1UntagResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1UntagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/UpdateApplicationCommand.ts b/clients/client-appconfig/commands/UpdateApplicationCommand.ts new file mode 100644 index 000000000000..4d1d62ea4ad0 --- /dev/null +++ b/clients/client-appconfig/commands/UpdateApplicationCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Application, UpdateApplicationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1UpdateApplicationCommand, + serializeAws_restJson1_1UpdateApplicationCommand +} from "../protocols/Aws_restJson1_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 UpdateApplicationCommandInput = UpdateApplicationRequest; +export type UpdateApplicationCommandOutput = Application; + +export class UpdateApplicationCommand extends $Command< + UpdateApplicationCommandInput, + UpdateApplicationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateApplicationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: UpdateApplicationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1UpdateApplicationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1UpdateApplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/UpdateConfigurationProfileCommand.ts b/clients/client-appconfig/commands/UpdateConfigurationProfileCommand.ts new file mode 100644 index 000000000000..d5763869e8ee --- /dev/null +++ b/clients/client-appconfig/commands/UpdateConfigurationProfileCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + ConfigurationProfile, + UpdateConfigurationProfileRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1UpdateConfigurationProfileCommand, + serializeAws_restJson1_1UpdateConfigurationProfileCommand +} from "../protocols/Aws_restJson1_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 UpdateConfigurationProfileCommandInput = UpdateConfigurationProfileRequest; +export type UpdateConfigurationProfileCommandOutput = ConfigurationProfile; + +export class UpdateConfigurationProfileCommand extends $Command< + UpdateConfigurationProfileCommandInput, + UpdateConfigurationProfileCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateConfigurationProfileCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + UpdateConfigurationProfileCommandInput, + UpdateConfigurationProfileCommandOutput + > { + 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: UpdateConfigurationProfileCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1UpdateConfigurationProfileCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1UpdateConfigurationProfileCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/UpdateDeploymentStrategyCommand.ts b/clients/client-appconfig/commands/UpdateDeploymentStrategyCommand.ts new file mode 100644 index 000000000000..a995c622e05c --- /dev/null +++ b/clients/client-appconfig/commands/UpdateDeploymentStrategyCommand.ts @@ -0,0 +1,93 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { + DeploymentStrategy, + UpdateDeploymentStrategyRequest +} from "../models/index"; +import { + deserializeAws_restJson1_1UpdateDeploymentStrategyCommand, + serializeAws_restJson1_1UpdateDeploymentStrategyCommand +} from "../protocols/Aws_restJson1_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 UpdateDeploymentStrategyCommandInput = UpdateDeploymentStrategyRequest; +export type UpdateDeploymentStrategyCommandOutput = DeploymentStrategy; + +export class UpdateDeploymentStrategyCommand extends $Command< + UpdateDeploymentStrategyCommandInput, + UpdateDeploymentStrategyCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateDeploymentStrategyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + UpdateDeploymentStrategyCommandInput, + UpdateDeploymentStrategyCommandOutput + > { + 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: UpdateDeploymentStrategyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1UpdateDeploymentStrategyCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1UpdateDeploymentStrategyCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/UpdateEnvironmentCommand.ts b/clients/client-appconfig/commands/UpdateEnvironmentCommand.ts new file mode 100644 index 000000000000..9651d3b024c7 --- /dev/null +++ b/clients/client-appconfig/commands/UpdateEnvironmentCommand.ts @@ -0,0 +1,81 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { Environment, UpdateEnvironmentRequest } from "../models/index"; +import { + deserializeAws_restJson1_1UpdateEnvironmentCommand, + serializeAws_restJson1_1UpdateEnvironmentCommand +} from "../protocols/Aws_restJson1_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 UpdateEnvironmentCommandInput = UpdateEnvironmentRequest; +export type UpdateEnvironmentCommandOutput = Environment; + +export class UpdateEnvironmentCommand extends $Command< + UpdateEnvironmentCommandInput, + UpdateEnvironmentCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateEnvironmentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + 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: UpdateEnvironmentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1UpdateEnvironmentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1UpdateEnvironmentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/commands/ValidateConfigurationCommand.ts b/clients/client-appconfig/commands/ValidateConfigurationCommand.ts new file mode 100644 index 000000000000..4cc1fe88ab3f --- /dev/null +++ b/clients/client-appconfig/commands/ValidateConfigurationCommand.ts @@ -0,0 +1,88 @@ +import { + AppConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AppConfigClient"; +import { ValidateConfigurationRequest } from "../models/index"; +import { + deserializeAws_restJson1_1ValidateConfigurationCommand, + serializeAws_restJson1_1ValidateConfigurationCommand +} from "../protocols/Aws_restJson1_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, + MetadataBearer as __MetadataBearer +} from "@aws-sdk/types"; + +export type ValidateConfigurationCommandInput = ValidateConfigurationRequest; +export type ValidateConfigurationCommandOutput = __MetadataBearer; + +export class ValidateConfigurationCommand extends $Command< + ValidateConfigurationCommandInput, + ValidateConfigurationCommandOutput, + AppConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ValidateConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AppConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ValidateConfigurationCommandInput, + ValidateConfigurationCommandOutput + > { + 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: ValidateConfigurationCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restJson1_1ValidateConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restJson1_1ValidateConfigurationCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-appconfig/endpoints.ts b/clients/client-appconfig/endpoints.ts new file mode 100644 index 000000000000..9eb4b1da48d6 --- /dev/null +++ b/clients/client-appconfig/endpoints.ts @@ -0,0 +1,78 @@ +import { RegionInfo, RegionInfoProvider } from "@aws-sdk/types"; + +// Partition default templates +const AWS_TEMPLATE = "appconfig.{region}.amazonaws.com"; +const AWS_CN_TEMPLATE = "appconfig.{region}.amazonaws.com.cn"; +const AWS_ISO_TEMPLATE = "appconfig.{region}.c2s.ic.gov"; +const AWS_ISO_B_TEMPLATE = "appconfig.{region}.sc2s.sgov.gov"; +const AWS_US_GOV_TEMPLATE = "appconfig.{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. + // 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-appconfig/index.ts b/clients/client-appconfig/index.ts new file mode 100644 index 000000000000..eb09c4ac5ca6 --- /dev/null +++ b/clients/client-appconfig/index.ts @@ -0,0 +1,31 @@ +export * from "./AppConfigClient"; +export * from "./AppConfig"; +export * from "./commands/CreateEnvironmentCommand"; +export * from "./commands/DeleteEnvironmentCommand"; +export * from "./commands/DeleteDeploymentStrategyCommand"; +export * from "./commands/ListTagsForResourceCommand"; +export * from "./commands/ListDeploymentsCommand"; +export * from "./commands/ListApplicationsCommand"; +export * from "./commands/ListConfigurationProfilesCommand"; +export * from "./commands/UpdateConfigurationProfileCommand"; +export * from "./commands/StopDeploymentCommand"; +export * from "./commands/CreateApplicationCommand"; +export * from "./commands/GetDeploymentStrategyCommand"; +export * from "./commands/DeleteApplicationCommand"; +export * from "./commands/ListDeploymentStrategiesCommand"; +export * from "./commands/ValidateConfigurationCommand"; +export * from "./commands/UntagResourceCommand"; +export * from "./commands/StartDeploymentCommand"; +export * from "./commands/GetConfigurationCommand"; +export * from "./commands/UpdateDeploymentStrategyCommand"; +export * from "./commands/GetEnvironmentCommand"; +export * from "./commands/ListEnvironmentsCommand"; +export * from "./commands/CreateConfigurationProfileCommand"; +export * from "./commands/DeleteConfigurationProfileCommand"; +export * from "./commands/GetDeploymentCommand"; +export * from "./commands/UpdateApplicationCommand"; +export * from "./commands/GetApplicationCommand"; +export * from "./commands/CreateDeploymentStrategyCommand"; +export * from "./commands/GetConfigurationProfileCommand"; +export * from "./commands/UpdateEnvironmentCommand"; +export * from "./commands/TagResourceCommand"; diff --git a/clients/client-appconfig/models/index.ts b/clients/client-appconfig/models/index.ts new file mode 100644 index 000000000000..cf751a341600 --- /dev/null +++ b/clients/client-appconfig/models/index.ts @@ -0,0 +1,1773 @@ +import * as _smithy from "@aws-sdk/smithy-client"; +import { MetadataBearer as $MetadataBearer } from "@aws-sdk/types"; + +export interface Application extends $MetadataBearer { + __type?: "Application"; + /** + * + *

The description of the application.

+ * + */ + Description?: string; + + /** + * + *

The application ID.

+ * + */ + Id?: string; + + /** + * + *

The application name.

+ * + */ + Name?: string; +} + +export namespace Application { + export function isa(o: any): o is Application { + return _smithy.isa(o, "Application"); + } +} + +export interface Applications extends $MetadataBearer { + __type?: "Applications"; + /** + * + *

The elements from this collection.

+ * + */ + Items?: Array; + + /** + * + *

The token for the next set of items to return. Use this token to get the next set of + * results.

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

The input fails to satisfy the constraints specified by an AWS service.

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

The configuration version.

+ * + */ + ConfigurationVersion?: string; + + /** + * + *

The content of the configuration or the configuration data.

+ * + */ + Content?: Uint8Array; + + /** + * + *

A standard MIME type describing the format of the configuration content. For more + * information, see Content-Type.

+ * + */ + ContentType?: string; +} + +export namespace Configuration { + export function isa(o: any): o is Configuration { + return _smithy.isa(o, "Configuration"); + } +} + +export interface ConfigurationProfile extends $MetadataBearer { + __type?: "ConfigurationProfile"; + /** + * + *

The application ID.

+ * + */ + ApplicationId?: string; + + /** + * + *

The configuration profile description.

+ * + */ + Description?: string; + + /** + * + *

The configuration profile ID.

+ * + */ + Id?: string; + + /** + * + *

The URI location of the configuration.

+ * + */ + LocationUri?: string; + + /** + * + *

The name of the configuration profile.

+ * + */ + Name?: string; + + /** + * + *

The ARN of an IAM role with permission to access the configuration at the specified + * LocationUri.

+ * + */ + RetrievalRoleArn?: string; + + /** + * + *

A list of methods for validating the configuration.

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

A summary of a configuration profile.

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

The application ID.

+ * + */ + ApplicationId?: string; + + /** + * + *

The ID of the configuration profile.

+ * + */ + Id?: string; + + /** + * + *

The URI location of the configuration.

+ * + */ + LocationUri?: string; + + /** + * + *

The name of the configuration profile.

+ * + */ + Name?: string; + + /** + * + *

The types of validators in the configuration profile.

+ * + */ + ValidatorTypes?: Array; +} + +export namespace ConfigurationProfileSummary { + export function isa(o: any): o is ConfigurationProfileSummary { + return _smithy.isa(o, "ConfigurationProfileSummary"); + } +} + +export interface ConfigurationProfiles extends $MetadataBearer { + __type?: "ConfigurationProfiles"; + /** + * + *

The elements from this collection.

+ * + */ + Items?: Array; + + /** + * + *

The token for the next set of items to return. Use this token to get the next set of + * results.

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

The request could not be processed because of conflict in the current state of the + * resource.

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

A description of the application.

+ * + */ + Description?: string; + + /** + * + *

A name for the application.

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

Metadata to assign to the application. Tags help organize and categorize your AppConfig + * resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; +} + +export namespace CreateApplicationRequest { + export function isa(o: any): o is CreateApplicationRequest { + return _smithy.isa(o, "CreateApplicationRequest"); + } +} + +export interface CreateConfigurationProfileRequest { + __type?: "CreateConfigurationProfileRequest"; + /** + * + *

The application ID.

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

A description of the configuration profile.

+ * + */ + Description?: string; + + /** + * + *

A URI to locate the configuration. You can specify either a Systems Manager (SSM) document or an SSM Parameter Store parameter. For an SSM document, specify either the document name in the format ssm-document:// or the Amazon Resource Name (ARN). For a parameter, specify either the parameter name in the format ssm-parameter:// or the ARN.

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

A name for the configuration profile.

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

The ARN of an IAM role with permission to access the configuration at the specified + * LocationUri.

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

Metadata to assign to the configuration profile. Tags help organize and categorize your + * AppConfig resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; + + /** + * + *

A list of methods for validating the configuration.

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

Total amount of time for a deployment to last.

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

A description of the deployment strategy.

+ * + */ + Description?: string; + + /** + * + *

The amount of time AppConfig monitors for alarms before considering the deployment to be + * complete and no longer eligible for automatic roll back.

+ * + */ + FinalBakeTimeInMinutes?: number; + + /** + * + *

The percentage of targets to receive a deployed configuration during each + * interval.

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

The algorithm used to define how percentage grows over time.

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

A name for the deployment strategy.

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

Save the deployment strategy to a Systems Manager (SSM) document.

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

Metadata to assign to the deployment strategy. Tags help organize and categorize your + * AppConfig resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; +} + +export namespace CreateDeploymentStrategyRequest { + export function isa(o: any): o is CreateDeploymentStrategyRequest { + return _smithy.isa(o, "CreateDeploymentStrategyRequest"); + } +} + +export interface CreateEnvironmentRequest { + __type?: "CreateEnvironmentRequest"; + /** + * + *

The application ID.

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

A description of the environment.

+ * + */ + Description?: string; + + /** + * + *

Amazon CloudWatch alarms to monitor during the deployment process.

+ * + */ + Monitors?: Array; + + /** + * + *

A name for the environment.

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

Metadata to assign to the environment. Tags help organize and categorize your AppConfig + * resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; +} + +export namespace CreateEnvironmentRequest { + export function isa(o: any): o is CreateEnvironmentRequest { + return _smithy.isa(o, "CreateEnvironmentRequest"); + } +} + +export interface DeleteApplicationRequest { + __type?: "DeleteApplicationRequest"; + /** + * + *

The ID of the application to delete.

+ * + */ + ApplicationId: string | undefined; +} + +export namespace DeleteApplicationRequest { + export function isa(o: any): o is DeleteApplicationRequest { + return _smithy.isa(o, "DeleteApplicationRequest"); + } +} + +export interface DeleteConfigurationProfileRequest { + __type?: "DeleteConfigurationProfileRequest"; + /** + * + *

The application ID that includes the configuration profile you want to delete.

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

The ID of the configuration profile you want to delete.

+ * + */ + ConfigurationProfileId: string | undefined; +} + +export namespace DeleteConfigurationProfileRequest { + export function isa(o: any): o is DeleteConfigurationProfileRequest { + return _smithy.isa(o, "DeleteConfigurationProfileRequest"); + } +} + +export interface DeleteDeploymentStrategyRequest { + __type?: "DeleteDeploymentStrategyRequest"; + /** + * + *

The ID of the deployment strategy you want to delete.

+ * + */ + DeploymentStrategyId: string | undefined; +} + +export namespace DeleteDeploymentStrategyRequest { + export function isa(o: any): o is DeleteDeploymentStrategyRequest { + return _smithy.isa(o, "DeleteDeploymentStrategyRequest"); + } +} + +export interface DeleteEnvironmentRequest { + __type?: "DeleteEnvironmentRequest"; + /** + * + *

The application ID that includes the environment you want to delete.

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

The ID of the environment you want to delete.

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

The ID of the application that was deployed.

+ * + */ + ApplicationId?: string; + + /** + * + *

The time the deployment completed.

+ * + */ + CompletedAt?: Date; + + /** + * + *

Information about the source location of the configuration.

+ * + */ + ConfigurationLocationUri?: string; + + /** + * + *

The name of the configuration.

+ * + */ + ConfigurationName?: string; + + /** + * + *

The ID of the configuration profile that was deployed.

+ * + */ + ConfigurationProfileId?: string; + + /** + * + *

The configuration version that was deployed.

+ * + */ + ConfigurationVersion?: string; + + /** + * + *

Total amount of time the deployment lasted.

+ * + */ + DeploymentDurationInMinutes?: number; + + /** + * + *

The sequence number of the deployment.

+ * + */ + DeploymentNumber?: number; + + /** + * + *

The ID of the deployment strategy that was deployed.

+ * + */ + DeploymentStrategyId?: string; + + /** + * + *

The description of the deployment.

+ * + */ + Description?: string; + + /** + * + *

The ID of the environment that was deployed.

+ * + */ + EnvironmentId?: string; + + /** + * + *

The amount of time AppConfig monitored for alarms before considering the deployment to be + * complete and no longer eligible for automatic roll back.

+ * + */ + FinalBakeTimeInMinutes?: number; + + /** + * + *

The percentage of targets to receive a deployed configuration during each + * interval.

+ * + */ + GrowthFactor?: number; + + /** + * + *

The algorithm used to define how percentage grew over time.

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

The percentage of targets for which the deployment is available.

+ * + */ + PercentageComplete?: number; + + /** + * + *

The time the deployment started.

+ * + */ + StartedAt?: Date; + + /** + * + *

The state of the deployment.

+ * + */ + State?: DeploymentState | string; +} + +export namespace Deployment { + export function isa(o: any): o is Deployment { + return _smithy.isa(o, "Deployment"); + } +} + +export enum DeploymentState { + BAKING = "BAKING", + COMPLETE = "COMPLETE", + DEPLOYING = "DEPLOYING", + ROLLED_BACK = "ROLLED_BACK", + ROLLING_BACK = "ROLLING_BACK", + VALIDATING = "VALIDATING" +} + +export interface DeploymentStrategies extends $MetadataBearer { + __type?: "DeploymentStrategies"; + /** + * + *

The elements from this collection.

+ * + */ + Items?: Array; + + /** + * + *

The token for the next set of items to return. Use this token to get the next set of + * results.

+ * + */ + NextToken?: string; +} + +export namespace DeploymentStrategies { + export function isa(o: any): o is DeploymentStrategies { + return _smithy.isa(o, "DeploymentStrategies"); + } +} + +export interface DeploymentStrategy extends $MetadataBearer { + __type?: "DeploymentStrategy"; + /** + * + *

Total amount of time the deployment lasted.

+ * + */ + DeploymentDurationInMinutes?: number; + + /** + * + *

The description of the deployment strategy.

+ * + */ + Description?: string; + + /** + * + *

The amount of time AppConfig monitored for alarms before considering the deployment to be + * complete and no longer eligible for automatic roll back.

+ * + */ + FinalBakeTimeInMinutes?: number; + + /** + * + *

The percentage of targets that received a deployed configuration during each + * interval.

+ * + */ + GrowthFactor?: number; + + /** + * + *

The algorithm used to define how percentage grew over time.

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

The deployment strategy ID.

+ * + */ + Id?: string; + + /** + * + *

The name of the deployment strategy.

+ * + */ + Name?: string; + + /** + * + *

Save the deployment strategy to a Systems Manager (SSM) document.

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

Information about the deployment.

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

Time the deployment completed.

+ * + */ + CompletedAt?: Date; + + /** + * + *

The name of the configuration.

+ * + */ + ConfigurationName?: string; + + /** + * + *

The version of the configuration.

+ * + */ + ConfigurationVersion?: string; + + /** + * + *

Total amount of time the deployment lasted.

+ * + */ + DeploymentDurationInMinutes?: number; + + /** + * + *

The sequence number of the deployment.

+ * + */ + DeploymentNumber?: number; + + /** + * + *

The amount of time AppConfig monitors for alarms before considering the deployment to be + * complete and no longer eligible for automatic roll back.

+ * + */ + FinalBakeTimeInMinutes?: number; + + /** + * + *

The percentage of targets to receive a deployed configuration during each + * interval.

+ * + */ + GrowthFactor?: number; + + /** + * + *

The algorithm used to define how percentage grows over time.

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

The percentage of targets for which the deployment is available.

+ * + */ + PercentageComplete?: number; + + /** + * + *

Time the deployment started.

+ * + */ + StartedAt?: Date; + + /** + * + *

The state of the deployment.

+ * + */ + State?: DeploymentState | string; +} + +export namespace DeploymentSummary { + export function isa(o: any): o is DeploymentSummary { + return _smithy.isa(o, "DeploymentSummary"); + } +} + +export interface Deployments extends $MetadataBearer { + __type?: "Deployments"; + /** + * + *

The elements from this collection.

+ * + */ + Items?: Array; + + /** + * + *

The token for the next set of items to return. Use this token to get the next set of + * results.

+ * + */ + NextToken?: string; +} + +export namespace Deployments { + export function isa(o: any): o is Deployments { + return _smithy.isa(o, "Deployments"); + } +} + +export interface Environment extends $MetadataBearer { + __type?: "Environment"; + /** + * + *

The application ID.

+ * + */ + ApplicationId?: string; + + /** + * + *

The description of the environment.

+ * + */ + Description?: string; + + /** + * + *

The environment ID.

+ * + */ + Id?: string; + + /** + * + *

Amazon CloudWatch alarms monitored during the deployment.

+ * + */ + Monitors?: Array; + + /** + * + *

The name of the environment.

+ * + */ + Name?: string; + + /** + * + *

The state of the environment. An environment can be in one of the following states: + * READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, or + * ROLLED_BACK + *

+ * + */ + State?: EnvironmentState | string; +} + +export namespace Environment { + export function isa(o: any): o is Environment { + return _smithy.isa(o, "Environment"); + } +} + +export enum EnvironmentState { + DEPLOYING = "DEPLOYING", + READY_FOR_DEPLOYMENT = "READY_FOR_DEPLOYMENT", + ROLLED_BACK = "ROLLED_BACK", + ROLLING_BACK = "ROLLING_BACK" +} + +export interface Environments extends $MetadataBearer { + __type?: "Environments"; + /** + * + *

The elements from this collection.

+ * + */ + Items?: Array; + + /** + * + *

The token for the next set of items to return. Use this token to get the next set of + * results.

+ * + */ + NextToken?: string; +} + +export namespace Environments { + export function isa(o: any): o is Environments { + return _smithy.isa(o, "Environments"); + } +} + +export interface GetApplicationRequest { + __type?: "GetApplicationRequest"; + /** + * + *

The ID of the application you want to get.

+ * + */ + ApplicationId: string | undefined; +} + +export namespace GetApplicationRequest { + export function isa(o: any): o is GetApplicationRequest { + return _smithy.isa(o, "GetApplicationRequest"); + } +} + +export interface GetConfigurationProfileRequest { + __type?: "GetConfigurationProfileRequest"; + /** + * + *

The ID of the application that includes the configuration profile you want to + * get.

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

The ID of the configuration profile you want to get.

+ * + */ + ConfigurationProfileId: string | undefined; +} + +export namespace GetConfigurationProfileRequest { + export function isa(o: any): o is GetConfigurationProfileRequest { + return _smithy.isa(o, "GetConfigurationProfileRequest"); + } +} + +export interface GetConfigurationRequest { + __type?: "GetConfigurationRequest"; + /** + * + *

The application to get.

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

The configuration version returned in the most recent GetConfiguration response.

+ * + */ + ClientConfigurationVersion?: string; + + /** + * + *

A unique ID to identify the client for the configuration. This ID enables AppConfig to deploy + * the configuration in intervals, as defined in the deployment strategy.

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

The configuration to get.

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

The environment to get.

+ * + */ + Environment: string | undefined; +} + +export namespace GetConfigurationRequest { + export function isa(o: any): o is GetConfigurationRequest { + return _smithy.isa(o, "GetConfigurationRequest"); + } +} + +export interface GetDeploymentRequest { + __type?: "GetDeploymentRequest"; + /** + * + *

The ID of the application that includes the deployment you want to get.

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

The sequence number of the deployment.

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

The ID of the environment that includes the deployment you want to get.

+ * + */ + EnvironmentId: string | undefined; +} + +export namespace GetDeploymentRequest { + export function isa(o: any): o is GetDeploymentRequest { + return _smithy.isa(o, "GetDeploymentRequest"); + } +} + +export interface GetDeploymentStrategyRequest { + __type?: "GetDeploymentStrategyRequest"; + /** + * + *

The ID of the deployment strategy to get.

+ * + */ + DeploymentStrategyId: string | undefined; +} + +export namespace GetDeploymentStrategyRequest { + export function isa(o: any): o is GetDeploymentStrategyRequest { + return _smithy.isa(o, "GetDeploymentStrategyRequest"); + } +} + +export interface GetEnvironmentRequest { + __type?: "GetEnvironmentRequest"; + /** + * + *

The ID of the application that includes the environment you want to get.

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

The ID of the environment you wnat to get.

+ * + */ + EnvironmentId: string | undefined; +} + +export namespace GetEnvironmentRequest { + export function isa(o: any): o is GetEnvironmentRequest { + return _smithy.isa(o, "GetEnvironmentRequest"); + } +} + +export enum GrowthType { + LINEAR = "LINEAR" +} + +/** + * + *

There was an internal failure in the AppConfig service.

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

The maximum number of items to return for this call. The call also returns a token that + * you can specify in a subsequent call to get the next set of results.

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

A token to start the list. Use this token to get the next set of results.

+ * + */ + NextToken?: string; +} + +export namespace ListApplicationsRequest { + export function isa(o: any): o is ListApplicationsRequest { + return _smithy.isa(o, "ListApplicationsRequest"); + } +} + +export interface ListConfigurationProfilesRequest { + __type?: "ListConfigurationProfilesRequest"; + /** + * + *

The application ID.

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

The maximum number of items to return for this call. The call also returns a token that + * you can specify in a subsequent call to get the next set of results.

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

A token to start the list. Use this token to get the next set of results.

+ * + */ + NextToken?: string; +} + +export namespace ListConfigurationProfilesRequest { + export function isa(o: any): o is ListConfigurationProfilesRequest { + return _smithy.isa(o, "ListConfigurationProfilesRequest"); + } +} + +export interface ListDeploymentStrategiesRequest { + __type?: "ListDeploymentStrategiesRequest"; + /** + * + *

The maximum number of items to return for this call. The call also returns a token that + * you can specify in a subsequent call to get the next set of results.

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

A token to start the list. Use this token to get the next set of results.

+ * + */ + NextToken?: string; +} + +export namespace ListDeploymentStrategiesRequest { + export function isa(o: any): o is ListDeploymentStrategiesRequest { + return _smithy.isa(o, "ListDeploymentStrategiesRequest"); + } +} + +export interface ListDeploymentsRequest { + __type?: "ListDeploymentsRequest"; + /** + * + *

The application ID.

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

The environment ID.

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

The maximum number of items to return for this call. The call also returns a token that + * you can specify in a subsequent call to get the next set of results.

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

A token to start the list. Use this token to get the next set of results.

+ * + */ + NextToken?: string; +} + +export namespace ListDeploymentsRequest { + export function isa(o: any): o is ListDeploymentsRequest { + return _smithy.isa(o, "ListDeploymentsRequest"); + } +} + +export interface ListEnvironmentsRequest { + __type?: "ListEnvironmentsRequest"; + /** + * + *

The application ID.

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

The maximum number of items to return for this call. The call also returns a token that + * you can specify in a subsequent call to get the next set of results.

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

A token to start the list. Use this token to get the next set of results.

+ * + */ + NextToken?: string; +} + +export namespace ListEnvironmentsRequest { + export function isa(o: any): o is ListEnvironmentsRequest { + return _smithy.isa(o, "ListEnvironmentsRequest"); + } +} + +export interface ListTagsForResourceRequest { + __type?: "ListTagsForResourceRequest"; + /** + * + *

The resource ARN.

+ * + */ + ResourceArn: string | undefined; +} + +export namespace ListTagsForResourceRequest { + export function isa(o: any): o is ListTagsForResourceRequest { + return _smithy.isa(o, "ListTagsForResourceRequest"); + } +} + +/** + * + *

Amazon CloudWatch alarms to monitor during the deployment process.

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

ARN of the Amazon CloudWatch alarm.

+ * + */ + AlarmArn?: string; + + /** + * + *

ARN of an IAM role for AppConfig to monitor AlarmArn.

+ * + */ + AlarmRoleArn?: string; +} + +export namespace Monitor { + export function isa(o: any): o is Monitor { + return _smithy.isa(o, "Monitor"); + } +} + +export enum ReplicateTo { + NONE = "NONE", + SSM_DOCUMENT = "SSM_DOCUMENT" +} + +/** + * + *

The requested resource could not be found.

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

Metadata to assign to AppConfig resources. Tags help organize and categorize your AppConfig + * resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; +} + +export namespace ResourceTags { + export function isa(o: any): o is ResourceTags { + return _smithy.isa(o, "ResourceTags"); + } +} + +export interface StartDeploymentRequest { + __type?: "StartDeploymentRequest"; + /** + * + *

The application ID.

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

The configuration profile ID.

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

The configuration version to deploy.

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

The deployment strategy ID.

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

A description of the deployment.

+ * + */ + Description?: string; + + /** + * + *

The environment ID.

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

Metadata to assign to the deployment. Tags help organize and categorize your AppConfig + * resources. Each tag consists of a key and an optional value, both of which you + * define.

+ * + */ + Tags?: { [key: string]: string }; +} + +export namespace StartDeploymentRequest { + export function isa(o: any): o is StartDeploymentRequest { + return _smithy.isa(o, "StartDeploymentRequest"); + } +} + +export interface StopDeploymentRequest { + __type?: "StopDeploymentRequest"; + /** + * + *

The application ID.

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

The sequence number of the deployment.

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

The environment ID.

+ * + */ + EnvironmentId: string | undefined; +} + +export namespace StopDeploymentRequest { + export function isa(o: any): o is StopDeploymentRequest { + return _smithy.isa(o, "StopDeploymentRequest"); + } +} + +export interface TagResourceRequest { + __type?: "TagResourceRequest"; + /** + * + *

The ARN of the resource for which to retrieve tags.

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

The key-value string map. The valid character set is [a-zA-Z+-=._:/]. The tag key can be + * up to 128 characters and must not start with aws:. The tag value can be up to + * 256 characters.

+ * + */ + Tags: { [key: string]: string } | undefined; +} + +export namespace TagResourceRequest { + export function isa(o: any): o is TagResourceRequest { + return _smithy.isa(o, "TagResourceRequest"); + } +} + +export interface UntagResourceRequest { + __type?: "UntagResourceRequest"; + /** + * + *

The ARN of the resource for which to remove tags.

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

The tag keys to delete.

+ * + */ + TagKeys: Array | undefined; +} + +export namespace UntagResourceRequest { + export function isa(o: any): o is UntagResourceRequest { + return _smithy.isa(o, "UntagResourceRequest"); + } +} + +export interface UpdateApplicationRequest { + __type?: "UpdateApplicationRequest"; + /** + * + *

The application ID.

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

A description of the application.

+ * + */ + Description?: string; + + /** + * + *

The name of the application.

+ * + */ + Name?: string; +} + +export namespace UpdateApplicationRequest { + export function isa(o: any): o is UpdateApplicationRequest { + return _smithy.isa(o, "UpdateApplicationRequest"); + } +} + +export interface UpdateConfigurationProfileRequest { + __type?: "UpdateConfigurationProfileRequest"; + /** + * + *

The application ID.

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

The ID of the configuration profile.

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

A description of the configuration profile.

+ * + */ + Description?: string; + + /** + * + *

The name of the configuration profile.

+ * + */ + Name?: string; + + /** + * + *

The ARN of an IAM role with permission to access the configuration at the specified + * LocationUri.

+ * + */ + RetrievalRoleArn?: string; + + /** + * + *

A list of methods for validating the configuration.

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

Total amount of time for a deployment to last.

+ * + */ + DeploymentDurationInMinutes?: number; + + /** + * + *

The deployment strategy ID.

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

A description of the deployment strategy.

+ * + */ + Description?: string; + + /** + * + *

The amount of time AppConfig monitors for alarms before considering the deployment to be + * complete and no longer eligible for automatic roll back.

+ * + */ + FinalBakeTimeInMinutes?: number; + + /** + * + *

The percentage of targets to receive a deployed configuration during each + * interval.

+ * + */ + GrowthFactor?: number; + + /** + * + *

The algorithm used to define how percentage grows over time.

+ * + */ + GrowthType?: GrowthType | string; +} + +export namespace UpdateDeploymentStrategyRequest { + export function isa(o: any): o is UpdateDeploymentStrategyRequest { + return _smithy.isa(o, "UpdateDeploymentStrategyRequest"); + } +} + +export interface UpdateEnvironmentRequest { + __type?: "UpdateEnvironmentRequest"; + /** + * + *

The application ID.

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

A description of the environment.

+ * + */ + Description?: string; + + /** + * + *

The environment ID.

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

Amazon CloudWatch alarms to monitor during the deployment process.

+ * + */ + Monitors?: Array; + + /** + * + *

The name of the environment.

+ * + */ + Name?: string; +} + +export namespace UpdateEnvironmentRequest { + export function isa(o: any): o is UpdateEnvironmentRequest { + return _smithy.isa(o, "UpdateEnvironmentRequest"); + } +} + +export interface ValidateConfigurationRequest { + __type?: "ValidateConfigurationRequest"; + /** + * + *

The application ID.

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

The configuration profile ID.

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

The version of the configuration to validate.

+ * + */ + ConfigurationVersion: string | undefined; +} + +export namespace ValidateConfigurationRequest { + export function isa(o: any): o is ValidateConfigurationRequest { + return _smithy.isa(o, "ValidateConfigurationRequest"); + } +} + +/** + * + *

A validator provides a syntactic or semantic check to ensure the configuration you want + * to deploy functions as intended. To validate your application configuration data, you + * provide a schema or a Lambda function that runs against the configuration. The + * configuration deployment or update can only proceed when the configuration data is + * valid.

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

Either the JSON Schema content or an AWS Lambda function name.

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

AppConfig supports validators of type JSON_SCHEMA and LAMBDA + *

+ * + */ + Type: ValidatorType | string | undefined; +} + +export namespace Validator { + export function isa(o: any): o is Validator { + return _smithy.isa(o, "Validator"); + } +} + +export enum ValidatorType { + JSON_SCHEMA = "JSON_SCHEMA", + LAMBDA = "LAMBDA" +} diff --git a/clients/client-appconfig/package.json b/clients/client-appconfig/package.json new file mode 100644 index 000000000000..007c818921c5 --- /dev/null +++ b/clients/client-appconfig/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aws-sdk/client-appconfig", + "description": "@aws-sdk/client-appconfig client", + "version": "0.1.0-preview.1", + "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-appconfig/protocols/Aws_restJson1_1.ts b/clients/client-appconfig/protocols/Aws_restJson1_1.ts new file mode 100644 index 000000000000..8c52d9fb641d --- /dev/null +++ b/clients/client-appconfig/protocols/Aws_restJson1_1.ts @@ -0,0 +1,4138 @@ +import { + CreateApplicationCommandInput, + CreateApplicationCommandOutput +} from "../commands/CreateApplicationCommand"; +import { + CreateConfigurationProfileCommandInput, + CreateConfigurationProfileCommandOutput +} from "../commands/CreateConfigurationProfileCommand"; +import { + CreateDeploymentStrategyCommandInput, + CreateDeploymentStrategyCommandOutput +} from "../commands/CreateDeploymentStrategyCommand"; +import { + CreateEnvironmentCommandInput, + CreateEnvironmentCommandOutput +} from "../commands/CreateEnvironmentCommand"; +import { + DeleteApplicationCommandInput, + DeleteApplicationCommandOutput +} from "../commands/DeleteApplicationCommand"; +import { + DeleteConfigurationProfileCommandInput, + DeleteConfigurationProfileCommandOutput +} from "../commands/DeleteConfigurationProfileCommand"; +import { + DeleteDeploymentStrategyCommandInput, + DeleteDeploymentStrategyCommandOutput +} from "../commands/DeleteDeploymentStrategyCommand"; +import { + DeleteEnvironmentCommandInput, + DeleteEnvironmentCommandOutput +} from "../commands/DeleteEnvironmentCommand"; +import { + GetApplicationCommandInput, + GetApplicationCommandOutput +} from "../commands/GetApplicationCommand"; +import { + GetConfigurationCommandInput, + GetConfigurationCommandOutput +} from "../commands/GetConfigurationCommand"; +import { + GetConfigurationProfileCommandInput, + GetConfigurationProfileCommandOutput +} from "../commands/GetConfigurationProfileCommand"; +import { + GetDeploymentCommandInput, + GetDeploymentCommandOutput +} from "../commands/GetDeploymentCommand"; +import { + GetDeploymentStrategyCommandInput, + GetDeploymentStrategyCommandOutput +} from "../commands/GetDeploymentStrategyCommand"; +import { + GetEnvironmentCommandInput, + GetEnvironmentCommandOutput +} from "../commands/GetEnvironmentCommand"; +import { + ListApplicationsCommandInput, + ListApplicationsCommandOutput +} from "../commands/ListApplicationsCommand"; +import { + ListConfigurationProfilesCommandInput, + ListConfigurationProfilesCommandOutput +} from "../commands/ListConfigurationProfilesCommand"; +import { + ListDeploymentStrategiesCommandInput, + ListDeploymentStrategiesCommandOutput +} from "../commands/ListDeploymentStrategiesCommand"; +import { + ListDeploymentsCommandInput, + ListDeploymentsCommandOutput +} from "../commands/ListDeploymentsCommand"; +import { + ListEnvironmentsCommandInput, + ListEnvironmentsCommandOutput +} from "../commands/ListEnvironmentsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput +} from "../commands/ListTagsForResourceCommand"; +import { + StartDeploymentCommandInput, + StartDeploymentCommandOutput +} from "../commands/StartDeploymentCommand"; +import { + StopDeploymentCommandInput, + StopDeploymentCommandOutput +} from "../commands/StopDeploymentCommand"; +import { + TagResourceCommandInput, + TagResourceCommandOutput +} from "../commands/TagResourceCommand"; +import { + UntagResourceCommandInput, + UntagResourceCommandOutput +} from "../commands/UntagResourceCommand"; +import { + UpdateApplicationCommandInput, + UpdateApplicationCommandOutput +} from "../commands/UpdateApplicationCommand"; +import { + UpdateConfigurationProfileCommandInput, + UpdateConfigurationProfileCommandOutput +} from "../commands/UpdateConfigurationProfileCommand"; +import { + UpdateDeploymentStrategyCommandInput, + UpdateDeploymentStrategyCommandOutput +} from "../commands/UpdateDeploymentStrategyCommand"; +import { + UpdateEnvironmentCommandInput, + UpdateEnvironmentCommandOutput +} from "../commands/UpdateEnvironmentCommand"; +import { + ValidateConfigurationCommandInput, + ValidateConfigurationCommandOutput +} from "../commands/ValidateConfigurationCommand"; +import { + Application, + BadRequestException, + ConfigurationProfileSummary, + ConflictException, + DeploymentStrategy, + DeploymentSummary, + Environment, + InternalServerException, + Monitor, + ResourceNotFoundException, + Validator, + ValidatorType +} 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_restJson1_1CreateApplicationCommand( + input: CreateApplicationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/applications"; + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1CreateConfigurationProfileCommand( + input: CreateConfigurationProfileCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/applications/{ApplicationId}/configurationprofiles"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.LocationUri !== undefined) { + bodyParams["LocationUri"] = input.LocationUri; + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.RetrievalRoleArn !== undefined) { + bodyParams["RetrievalRoleArn"] = input.RetrievalRoleArn; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + if (input.Validators !== undefined) { + bodyParams["Validators"] = serializeAws_restJson1_1ValidatorList( + input.Validators, + context + ); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1CreateDeploymentStrategyCommand( + input: CreateDeploymentStrategyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/deploymentstrategies"; + let body: any = {}; + const bodyParams: any = {}; + if (input.DeploymentDurationInMinutes !== undefined) { + bodyParams["DeploymentDurationInMinutes"] = + input.DeploymentDurationInMinutes; + } + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.FinalBakeTimeInMinutes !== undefined) { + bodyParams["FinalBakeTimeInMinutes"] = input.FinalBakeTimeInMinutes; + } + if (input.GrowthFactor !== undefined) { + bodyParams["GrowthFactor"] = input.GrowthFactor; + } + if (input.GrowthType !== undefined) { + bodyParams["GrowthType"] = input.GrowthType; + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.ReplicateTo !== undefined) { + bodyParams["ReplicateTo"] = input.ReplicateTo; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1CreateEnvironmentCommand( + input: CreateEnvironmentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/applications/{ApplicationId}/environments"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Monitors !== undefined) { + bodyParams["Monitors"] = serializeAws_restJson1_1MonitorList( + input.Monitors, + context + ); + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1DeleteApplicationCommand( + input: DeleteApplicationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/applications/{ApplicationId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1DeleteConfigurationProfileCommand( + input: DeleteConfigurationProfileCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.ConfigurationProfileId !== undefined) { + const labelValue: any = input.ConfigurationProfileId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ConfigurationProfileId." + ); + } + resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: ConfigurationProfileId." + ); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1DeleteDeploymentStrategyCommand( + input: DeleteDeploymentStrategyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/deployementstrategies/{DeploymentStrategyId}"; + if (input.DeploymentStrategyId !== undefined) { + const labelValue: any = input.DeploymentStrategyId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: DeploymentStrategyId." + ); + } + resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: DeploymentStrategyId." + ); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1DeleteEnvironmentCommand( + input: DeleteEnvironmentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1GetApplicationCommand( + input: GetApplicationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/applications/{ApplicationId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1GetConfigurationCommand( + input: GetConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{Application}/environments/{Environment}/configurations/{Configuration}"; + if (input.Application !== undefined) { + const labelValue: any = input.Application.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: Application." + ); + } + resolvedPath = resolvedPath.replace("{Application}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Application."); + } + if (input.Configuration !== undefined) { + const labelValue: any = input.Configuration.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: Configuration." + ); + } + resolvedPath = resolvedPath.replace("{Configuration}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Configuration."); + } + if (input.Environment !== undefined) { + const labelValue: any = input.Environment.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: Environment." + ); + } + resolvedPath = resolvedPath.replace("{Environment}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Environment."); + } + const query: any = {}; + if (input.ClientConfigurationVersion !== undefined) { + query[ + "client_configuration_version" + ] = input.ClientConfigurationVersion.toString(); + } + if (input.ClientId !== undefined) { + query["client_id"] = input.ClientId.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1GetConfigurationProfileCommand( + input: GetConfigurationProfileCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.ConfigurationProfileId !== undefined) { + const labelValue: any = input.ConfigurationProfileId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ConfigurationProfileId." + ); + } + resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: ConfigurationProfileId." + ); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1GetDeploymentCommand( + input: GetDeploymentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.DeploymentNumber !== undefined) { + const labelValue: any = input.DeploymentNumber.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: DeploymentNumber." + ); + } + resolvedPath = resolvedPath.replace("{DeploymentNumber}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: DeploymentNumber." + ); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1GetDeploymentStrategyCommand( + input: GetDeploymentStrategyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/deploymentstrategies/{DeploymentStrategyId}"; + if (input.DeploymentStrategyId !== undefined) { + const labelValue: any = input.DeploymentStrategyId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: DeploymentStrategyId." + ); + } + resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: DeploymentStrategyId." + ); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1GetEnvironmentCommand( + input: GetEnvironmentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1ListApplicationsCommand( + input: ListApplicationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/applications"; + const query: any = {}; + if (input.MaxResults !== undefined) { + query["max_results"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["next_token"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1ListConfigurationProfilesCommand( + input: ListConfigurationProfilesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/applications/{ApplicationId}/configurationprofiles"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + const query: any = {}; + if (input.MaxResults !== undefined) { + query["max_results"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["next_token"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1ListDeploymentStrategiesCommand( + input: ListDeploymentStrategiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/deploymentstrategies"; + const query: any = {}; + if (input.MaxResults !== undefined) { + query["max_results"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["next_token"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1ListDeploymentsCommand( + input: ListDeploymentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + const query: any = {}; + if (input.MaxResults !== undefined) { + query["max_results"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["next_token"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1ListEnvironmentsCommand( + input: ListEnvironmentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/applications/{ApplicationId}/environments"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + const query: any = {}; + if (input.MaxResults !== undefined) { + query["max_results"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["next_token"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1ListTagsForResourceCommand( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/tags/{ResourceArn}"; + if (input.ResourceArn !== undefined) { + const labelValue: any = input.ResourceArn.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ResourceArn." + ); + } + resolvedPath = resolvedPath.replace("{ResourceArn}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ResourceArn."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1StartDeploymentCommand( + input: StartDeploymentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.ConfigurationProfileId !== undefined) { + bodyParams["ConfigurationProfileId"] = input.ConfigurationProfileId; + } + if (input.ConfigurationVersion !== undefined) { + bodyParams["ConfigurationVersion"] = input.ConfigurationVersion; + } + if (input.DeploymentStrategyId !== undefined) { + bodyParams["DeploymentStrategyId"] = input.DeploymentStrategyId; + } + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1StopDeploymentCommand( + input: StopDeploymentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.DeploymentNumber !== undefined) { + const labelValue: any = input.DeploymentNumber.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: DeploymentNumber." + ); + } + resolvedPath = resolvedPath.replace("{DeploymentNumber}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: DeploymentNumber." + ); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restJson1_1TagResourceCommand( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/tags/{ResourceArn}"; + if (input.ResourceArn !== undefined) { + const labelValue: any = input.ResourceArn.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ResourceArn." + ); + } + resolvedPath = resolvedPath.replace("{ResourceArn}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ResourceArn."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_restJson1_1TagMap(input.Tags, context); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1UntagResourceCommand( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = "/tags/{ResourceArn}"; + if (input.ResourceArn !== undefined) { + const labelValue: any = input.ResourceArn.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ResourceArn." + ); + } + resolvedPath = resolvedPath.replace("{ResourceArn}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ResourceArn."); + } + const query: any = {}; + if (input.TagKeys !== undefined) { + query["tagKeys"] = input.TagKeys; + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restJson1_1UpdateApplicationCommand( + input: UpdateApplicationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/applications/{ApplicationId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PATCH", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1UpdateConfigurationProfileCommand( + input: UpdateConfigurationProfileCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = + "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.ConfigurationProfileId !== undefined) { + const labelValue: any = input.ConfigurationProfileId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ConfigurationProfileId." + ); + } + resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: ConfigurationProfileId." + ); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.RetrievalRoleArn !== undefined) { + bodyParams["RetrievalRoleArn"] = input.RetrievalRoleArn; + } + if (input.Validators !== undefined) { + bodyParams["Validators"] = serializeAws_restJson1_1ValidatorList( + input.Validators, + context + ); + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PATCH", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1UpdateDeploymentStrategyCommand( + input: UpdateDeploymentStrategyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = "/deploymentstrategies/{DeploymentStrategyId}"; + if (input.DeploymentStrategyId !== undefined) { + const labelValue: any = input.DeploymentStrategyId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: DeploymentStrategyId." + ); + } + resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: DeploymentStrategyId." + ); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.DeploymentDurationInMinutes !== undefined) { + bodyParams["DeploymentDurationInMinutes"] = + input.DeploymentDurationInMinutes; + } + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.FinalBakeTimeInMinutes !== undefined) { + bodyParams["FinalBakeTimeInMinutes"] = input.FinalBakeTimeInMinutes; + } + if (input.GrowthFactor !== undefined) { + bodyParams["GrowthFactor"] = input.GrowthFactor; + } + if (input.GrowthType !== undefined) { + bodyParams["GrowthType"] = input.GrowthType; + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PATCH", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1UpdateEnvironmentCommand( + input: UpdateEnvironmentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/json"; + let resolvedPath = + "/applications/{ApplicationId}/environments/{EnvironmentId}"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.EnvironmentId !== undefined) { + const labelValue: any = input.EnvironmentId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: EnvironmentId." + ); + } + resolvedPath = resolvedPath.replace("{EnvironmentId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: EnvironmentId."); + } + let body: any = {}; + const bodyParams: any = {}; + if (input.Description !== undefined) { + bodyParams["Description"] = input.Description; + } + if (input.Monitors !== undefined) { + bodyParams["Monitors"] = serializeAws_restJson1_1MonitorList( + input.Monitors, + context + ); + } + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + body = JSON.stringify(bodyParams); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PATCH", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restJson1_1ValidateConfigurationCommand( + input: ValidateConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + let resolvedPath = + "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/validators"; + if (input.ApplicationId !== undefined) { + const labelValue: any = input.ApplicationId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ApplicationId." + ); + } + resolvedPath = resolvedPath.replace("{ApplicationId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: ApplicationId."); + } + if (input.ConfigurationProfileId !== undefined) { + const labelValue: any = input.ConfigurationProfileId.toString(); + if (labelValue.length <= 0) { + throw new Error( + "Empty value provided for input HTTP label: ConfigurationProfileId." + ); + } + resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", labelValue); + } else { + throw new Error( + "No value provided for input HTTP label: ConfigurationProfileId." + ); + } + const query: any = {}; + if (input.ConfigurationVersion !== undefined) { + query["configuration_version"] = input.ConfigurationVersion.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function deserializeAws_restJson1_1CreateApplicationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 201) { + return deserializeAws_restJson1_1CreateApplicationCommandError( + output, + context + ); + } + const contents: CreateApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Application", + Description: undefined, + Id: undefined, + Name: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1CreateApplicationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1CreateConfigurationProfileCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 201) { + return deserializeAws_restJson1_1CreateConfigurationProfileCommandError( + output, + context + ); + } + const contents: CreateConfigurationProfileCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ConfigurationProfile", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + LocationUri: undefined, + Name: undefined, + RetrievalRoleArn: undefined, + Validators: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.LocationUri !== undefined) { + contents.LocationUri = data.LocationUri; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.RetrievalRoleArn !== undefined) { + contents.RetrievalRoleArn = data.RetrievalRoleArn; + } + if (data.Validators !== undefined) { + contents.Validators = deserializeAws_restJson1_1ValidatorList( + data.Validators, + context + ); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1CreateConfigurationProfileCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1CreateDeploymentStrategyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 201) { + return deserializeAws_restJson1_1CreateDeploymentStrategyCommandError( + output, + context + ); + } + const contents: CreateDeploymentStrategyCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeploymentStrategy", + DeploymentDurationInMinutes: undefined, + Description: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + Id: undefined, + Name: undefined, + ReplicateTo: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.ReplicateTo !== undefined) { + contents.ReplicateTo = data.ReplicateTo; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1CreateDeploymentStrategyCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1CreateEnvironmentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 201) { + return deserializeAws_restJson1_1CreateEnvironmentCommandError( + output, + context + ); + } + const contents: CreateEnvironmentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Environment", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + Monitors: undefined, + Name: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Monitors !== undefined) { + contents.Monitors = deserializeAws_restJson1_1MonitorList( + data.Monitors, + context + ); + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1CreateEnvironmentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1DeleteApplicationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1DeleteApplicationCommandError( + output, + context + ); + } + const contents: DeleteApplicationCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1DeleteApplicationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1DeleteConfigurationProfileCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1DeleteConfigurationProfileCommandError( + output, + context + ); + } + const contents: DeleteConfigurationProfileCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1DeleteConfigurationProfileCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ConflictException": + case "com.amazonaws.services.blue#ConflictException": + response = await deserializeAws_restJson1_1ConflictExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1DeleteDeploymentStrategyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1DeleteDeploymentStrategyCommandError( + output, + context + ); + } + const contents: DeleteDeploymentStrategyCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1DeleteDeploymentStrategyCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1DeleteEnvironmentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1DeleteEnvironmentCommandError( + output, + context + ); + } + const contents: DeleteEnvironmentCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1DeleteEnvironmentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ConflictException": + case "com.amazonaws.services.blue#ConflictException": + response = await deserializeAws_restJson1_1ConflictExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetApplicationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetApplicationCommandError( + output, + context + ); + } + const contents: GetApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Application", + Description: undefined, + Id: undefined, + Name: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetApplicationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetConfigurationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetConfigurationCommandError( + output, + context + ); + } + const contents: GetConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Configuration", + ConfigurationVersion: undefined, + Content: undefined, + ContentType: undefined + }; + if (output.headers["Configuration-Version"] !== undefined) { + contents.ConfigurationVersion = output.headers["Configuration-Version"]; + } + if (output.headers["Content-Type"] !== undefined) { + contents.ContentType = output.headers["Content-Type"]; + } + const data: any = await parseBody(output.body, context); + contents.Content = data; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetConfigurationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetConfigurationProfileCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetConfigurationProfileCommandError( + output, + context + ); + } + const contents: GetConfigurationProfileCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ConfigurationProfile", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + LocationUri: undefined, + Name: undefined, + RetrievalRoleArn: undefined, + Validators: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.LocationUri !== undefined) { + contents.LocationUri = data.LocationUri; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.RetrievalRoleArn !== undefined) { + contents.RetrievalRoleArn = data.RetrievalRoleArn; + } + if (data.Validators !== undefined) { + contents.Validators = deserializeAws_restJson1_1ValidatorList( + data.Validators, + context + ); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetConfigurationProfileCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetDeploymentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetDeploymentCommandError(output, context); + } + const contents: GetDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Deployment", + ApplicationId: undefined, + CompletedAt: undefined, + ConfigurationLocationUri: undefined, + ConfigurationName: undefined, + ConfigurationProfileId: undefined, + ConfigurationVersion: undefined, + DeploymentDurationInMinutes: undefined, + DeploymentNumber: undefined, + DeploymentStrategyId: undefined, + Description: undefined, + EnvironmentId: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + PercentageComplete: undefined, + StartedAt: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.CompletedAt !== undefined) { + contents.CompletedAt = new Date(data.CompletedAt); + } + if (data.ConfigurationLocationUri !== undefined) { + contents.ConfigurationLocationUri = data.ConfigurationLocationUri; + } + if (data.ConfigurationName !== undefined) { + contents.ConfigurationName = data.ConfigurationName; + } + if (data.ConfigurationProfileId !== undefined) { + contents.ConfigurationProfileId = data.ConfigurationProfileId; + } + if (data.ConfigurationVersion !== undefined) { + contents.ConfigurationVersion = data.ConfigurationVersion; + } + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.DeploymentNumber !== undefined) { + contents.DeploymentNumber = data.DeploymentNumber; + } + if (data.DeploymentStrategyId !== undefined) { + contents.DeploymentStrategyId = data.DeploymentStrategyId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.EnvironmentId !== undefined) { + contents.EnvironmentId = data.EnvironmentId; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.PercentageComplete !== undefined) { + contents.PercentageComplete = data.PercentageComplete; + } + if (data.StartedAt !== undefined) { + contents.StartedAt = new Date(data.StartedAt); + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetDeploymentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetDeploymentStrategyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetDeploymentStrategyCommandError( + output, + context + ); + } + const contents: GetDeploymentStrategyCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeploymentStrategy", + DeploymentDurationInMinutes: undefined, + Description: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + Id: undefined, + Name: undefined, + ReplicateTo: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.ReplicateTo !== undefined) { + contents.ReplicateTo = data.ReplicateTo; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetDeploymentStrategyCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1GetEnvironmentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1GetEnvironmentCommandError( + output, + context + ); + } + const contents: GetEnvironmentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Environment", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + Monitors: undefined, + Name: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Monitors !== undefined) { + contents.Monitors = deserializeAws_restJson1_1MonitorList( + data.Monitors, + context + ); + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1GetEnvironmentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListApplicationsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListApplicationsCommandError( + output, + context + ); + } + const contents: ListApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Applications", + Items: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Items !== undefined) { + contents.Items = deserializeAws_restJson1_1ApplicationList( + data.Items, + context + ); + } + if (data.NextToken !== undefined) { + contents.NextToken = data.NextToken; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListApplicationsCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListConfigurationProfilesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListConfigurationProfilesCommandError( + output, + context + ); + } + const contents: ListConfigurationProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ConfigurationProfiles", + Items: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Items !== undefined) { + contents.Items = deserializeAws_restJson1_1ConfigurationProfileSummaryList( + data.Items, + context + ); + } + if (data.NextToken !== undefined) { + contents.NextToken = data.NextToken; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListConfigurationProfilesCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListDeploymentStrategiesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListDeploymentStrategiesCommandError( + output, + context + ); + } + const contents: ListDeploymentStrategiesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeploymentStrategies", + Items: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Items !== undefined) { + contents.Items = deserializeAws_restJson1_1DeploymentStrategyList( + data.Items, + context + ); + } + if (data.NextToken !== undefined) { + contents.NextToken = data.NextToken; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListDeploymentStrategiesCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListDeploymentsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListDeploymentsCommandError( + output, + context + ); + } + const contents: ListDeploymentsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Deployments", + Items: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Items !== undefined) { + contents.Items = deserializeAws_restJson1_1DeploymentList( + data.Items, + context + ); + } + if (data.NextToken !== undefined) { + contents.NextToken = data.NextToken; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListDeploymentsCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListEnvironmentsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListEnvironmentsCommandError( + output, + context + ); + } + const contents: ListEnvironmentsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Environments", + Items: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Items !== undefined) { + contents.Items = deserializeAws_restJson1_1EnvironmentList( + data.Items, + context + ); + } + if (data.NextToken !== undefined) { + contents.NextToken = data.NextToken; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListEnvironmentsCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ListTagsForResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1ListTagsForResourceCommandError( + output, + context + ); + } + const contents: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ResourceTags", + Tags: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Tags !== undefined) { + contents.Tags = deserializeAws_restJson1_1TagMap(data.Tags, context); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ListTagsForResourceCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1StartDeploymentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 201) { + return deserializeAws_restJson1_1StartDeploymentCommandError( + output, + context + ); + } + const contents: StartDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Deployment", + ApplicationId: undefined, + CompletedAt: undefined, + ConfigurationLocationUri: undefined, + ConfigurationName: undefined, + ConfigurationProfileId: undefined, + ConfigurationVersion: undefined, + DeploymentDurationInMinutes: undefined, + DeploymentNumber: undefined, + DeploymentStrategyId: undefined, + Description: undefined, + EnvironmentId: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + PercentageComplete: undefined, + StartedAt: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.CompletedAt !== undefined) { + contents.CompletedAt = new Date(data.CompletedAt); + } + if (data.ConfigurationLocationUri !== undefined) { + contents.ConfigurationLocationUri = data.ConfigurationLocationUri; + } + if (data.ConfigurationName !== undefined) { + contents.ConfigurationName = data.ConfigurationName; + } + if (data.ConfigurationProfileId !== undefined) { + contents.ConfigurationProfileId = data.ConfigurationProfileId; + } + if (data.ConfigurationVersion !== undefined) { + contents.ConfigurationVersion = data.ConfigurationVersion; + } + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.DeploymentNumber !== undefined) { + contents.DeploymentNumber = data.DeploymentNumber; + } + if (data.DeploymentStrategyId !== undefined) { + contents.DeploymentStrategyId = data.DeploymentStrategyId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.EnvironmentId !== undefined) { + contents.EnvironmentId = data.EnvironmentId; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.PercentageComplete !== undefined) { + contents.PercentageComplete = data.PercentageComplete; + } + if (data.StartedAt !== undefined) { + contents.StartedAt = new Date(data.StartedAt); + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1StartDeploymentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ConflictException": + case "com.amazonaws.services.blue#ConflictException": + response = await deserializeAws_restJson1_1ConflictExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1StopDeploymentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 202) { + return deserializeAws_restJson1_1StopDeploymentCommandError( + output, + context + ); + } + const contents: StopDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Deployment", + ApplicationId: undefined, + CompletedAt: undefined, + ConfigurationLocationUri: undefined, + ConfigurationName: undefined, + ConfigurationProfileId: undefined, + ConfigurationVersion: undefined, + DeploymentDurationInMinutes: undefined, + DeploymentNumber: undefined, + DeploymentStrategyId: undefined, + Description: undefined, + EnvironmentId: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + PercentageComplete: undefined, + StartedAt: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.CompletedAt !== undefined) { + contents.CompletedAt = new Date(data.CompletedAt); + } + if (data.ConfigurationLocationUri !== undefined) { + contents.ConfigurationLocationUri = data.ConfigurationLocationUri; + } + if (data.ConfigurationName !== undefined) { + contents.ConfigurationName = data.ConfigurationName; + } + if (data.ConfigurationProfileId !== undefined) { + contents.ConfigurationProfileId = data.ConfigurationProfileId; + } + if (data.ConfigurationVersion !== undefined) { + contents.ConfigurationVersion = data.ConfigurationVersion; + } + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.DeploymentNumber !== undefined) { + contents.DeploymentNumber = data.DeploymentNumber; + } + if (data.DeploymentStrategyId !== undefined) { + contents.DeploymentStrategyId = data.DeploymentStrategyId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.EnvironmentId !== undefined) { + contents.EnvironmentId = data.EnvironmentId; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.PercentageComplete !== undefined) { + contents.PercentageComplete = data.PercentageComplete; + } + if (data.StartedAt !== undefined) { + contents.StartedAt = new Date(data.StartedAt); + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1StopDeploymentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1TagResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1TagResourceCommandError(output, context); + } + const contents: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1TagResourceCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1UntagResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1UntagResourceCommandError(output, context); + } + const contents: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1UntagResourceCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1UpdateApplicationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1UpdateApplicationCommandError( + output, + context + ); + } + const contents: UpdateApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Application", + Description: undefined, + Id: undefined, + Name: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1UpdateApplicationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1UpdateConfigurationProfileCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1UpdateConfigurationProfileCommandError( + output, + context + ); + } + const contents: UpdateConfigurationProfileCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ConfigurationProfile", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + LocationUri: undefined, + Name: undefined, + RetrievalRoleArn: undefined, + Validators: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.LocationUri !== undefined) { + contents.LocationUri = data.LocationUri; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.RetrievalRoleArn !== undefined) { + contents.RetrievalRoleArn = data.RetrievalRoleArn; + } + if (data.Validators !== undefined) { + contents.Validators = deserializeAws_restJson1_1ValidatorList( + data.Validators, + context + ); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1UpdateConfigurationProfileCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1UpdateDeploymentStrategyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1UpdateDeploymentStrategyCommandError( + output, + context + ); + } + const contents: UpdateDeploymentStrategyCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeploymentStrategy", + DeploymentDurationInMinutes: undefined, + Description: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + Id: undefined, + Name: undefined, + ReplicateTo: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = data.DeploymentDurationInMinutes; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = data.FinalBakeTimeInMinutes; + } + if (data.GrowthFactor !== undefined) { + contents.GrowthFactor = data.GrowthFactor; + } + if (data.GrowthType !== undefined) { + contents.GrowthType = data.GrowthType; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.ReplicateTo !== undefined) { + contents.ReplicateTo = data.ReplicateTo; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1UpdateDeploymentStrategyCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1UpdateEnvironmentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200) { + return deserializeAws_restJson1_1UpdateEnvironmentCommandError( + output, + context + ); + } + const contents: UpdateEnvironmentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "Environment", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + Monitors: undefined, + Name: undefined, + State: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.ApplicationId !== undefined) { + contents.ApplicationId = data.ApplicationId; + } + if (data.Description !== undefined) { + contents.Description = data.Description; + } + if (data.Id !== undefined) { + contents.Id = data.Id; + } + if (data.Monitors !== undefined) { + contents.Monitors = deserializeAws_restJson1_1MonitorList( + data.Monitors, + context + ); + } + if (data.Name !== undefined) { + contents.Name = data.Name; + } + if (data.State !== undefined) { + contents.State = data.State; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1UpdateEnvironmentCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_restJson1_1ValidateConfigurationCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 204) { + return deserializeAws_restJson1_1ValidateConfigurationCommandError( + output, + context + ); + } + const contents: ValidateConfigurationCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restJson1_1ValidateConfigurationCommandError( + 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; + errorCode = output.headers["x-amzn-errortype"].split(":")[0]; + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.services.blue#BadRequestException": + response = await deserializeAws_restJson1_1BadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.services.blue#InternalServerException": + response = await deserializeAws_restJson1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.services.blue#ResourceNotFoundException": + response = await deserializeAws_restJson1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.services.blue#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +const deserializeAws_restJson1_1BadRequestExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: BadRequestException = { + __type: "BadRequestException", + $fault: "client", + $metadata: deserializeMetadata(output), + Message: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Message !== undefined) { + contents.Message = data.Message; + } + return contents; +}; + +const deserializeAws_restJson1_1ConflictExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: ConflictException = { + __type: "ConflictException", + $fault: "client", + $metadata: deserializeMetadata(output), + Message: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Message !== undefined) { + contents.Message = data.Message; + } + return contents; +}; + +const deserializeAws_restJson1_1InternalServerExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: InternalServerException = { + __type: "InternalServerException", + $fault: "server", + $metadata: deserializeMetadata(output), + Message: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Message !== undefined) { + contents.Message = data.Message; + } + return contents; +}; + +const deserializeAws_restJson1_1ResourceNotFoundExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: ResourceNotFoundException = { + __type: "ResourceNotFoundException", + $fault: "client", + $metadata: deserializeMetadata(output), + Message: undefined, + ResourceName: undefined + }; + const data: any = await parseBody(output.body, context); + if (data.Message !== undefined) { + contents.Message = data.Message; + } + if (data.ResourceName !== undefined) { + contents.ResourceName = data.ResourceName; + } + return contents; +}; + +const serializeAws_restJson1_1Monitor = ( + input: Monitor, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.AlarmArn !== undefined) { + bodyParams["AlarmArn"] = input.AlarmArn; + } + if (input.AlarmRoleArn !== undefined) { + bodyParams["AlarmRoleArn"] = input.AlarmRoleArn; + } + return bodyParams; +}; + +const serializeAws_restJson1_1MonitorList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_restJson1_1Monitor(entry, context) + ); +}; + +const serializeAws_restJson1_1TagMap = ( + input: { [key: string]: string }, + context: __SerdeContext +): any => { + let mapParams: any = {}; + Object.keys(input).forEach(key => { + mapParams[key] = input[key]; + }); + return mapParams; +}; + +const serializeAws_restJson1_1Validator = ( + input: Validator, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Content !== undefined) { + bodyParams["Content"] = input.Content; + } + if (input.Type !== undefined) { + bodyParams["Type"] = input.Type; + } + return bodyParams; +}; + +const serializeAws_restJson1_1ValidatorList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_restJson1_1Validator(entry, context) + ); +}; + +const deserializeAws_restJson1_1Application = ( + output: any, + context: __SerdeContext +): Application => { + let contents: any = { + __type: "Application", + Description: undefined, + Id: undefined, + Name: undefined + }; + if (output.Description !== undefined) { + contents.Description = output.Description; + } + if (output.Id !== undefined) { + contents.Id = output.Id; + } + if (output.Name !== undefined) { + contents.Name = output.Name; + } + return contents; +}; + +const deserializeAws_restJson1_1ApplicationList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1Application(entry, context) + ); +}; + +const deserializeAws_restJson1_1ConfigurationProfileSummary = ( + output: any, + context: __SerdeContext +): ConfigurationProfileSummary => { + let contents: any = { + __type: "ConfigurationProfileSummary", + ApplicationId: undefined, + Id: undefined, + LocationUri: undefined, + Name: undefined, + ValidatorTypes: undefined + }; + if (output.ApplicationId !== undefined) { + contents.ApplicationId = output.ApplicationId; + } + if (output.Id !== undefined) { + contents.Id = output.Id; + } + if (output.LocationUri !== undefined) { + contents.LocationUri = output.LocationUri; + } + if (output.Name !== undefined) { + contents.Name = output.Name; + } + if (output.ValidatorTypes !== undefined) { + contents.ValidatorTypes = deserializeAws_restJson1_1ValidatorTypeList( + output.ValidatorTypes, + context + ); + } + return contents; +}; + +const deserializeAws_restJson1_1ConfigurationProfileSummaryList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1ConfigurationProfileSummary(entry, context) + ); +}; + +const deserializeAws_restJson1_1DeploymentList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1DeploymentSummary(entry, context) + ); +}; + +const deserializeAws_restJson1_1DeploymentStrategy = ( + output: any, + context: __SerdeContext +): DeploymentStrategy => { + let contents: any = { + __type: "DeploymentStrategy", + DeploymentDurationInMinutes: undefined, + Description: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + Id: undefined, + Name: undefined, + ReplicateTo: undefined + }; + if (output.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = output.DeploymentDurationInMinutes; + } + if (output.Description !== undefined) { + contents.Description = output.Description; + } + if (output.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = output.FinalBakeTimeInMinutes; + } + if (output.GrowthFactor !== undefined) { + contents.GrowthFactor = output.GrowthFactor; + } + if (output.GrowthType !== undefined) { + contents.GrowthType = output.GrowthType; + } + if (output.Id !== undefined) { + contents.Id = output.Id; + } + if (output.Name !== undefined) { + contents.Name = output.Name; + } + if (output.ReplicateTo !== undefined) { + contents.ReplicateTo = output.ReplicateTo; + } + return contents; +}; + +const deserializeAws_restJson1_1DeploymentStrategyList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1DeploymentStrategy(entry, context) + ); +}; + +const deserializeAws_restJson1_1DeploymentSummary = ( + output: any, + context: __SerdeContext +): DeploymentSummary => { + let contents: any = { + __type: "DeploymentSummary", + CompletedAt: undefined, + ConfigurationName: undefined, + ConfigurationVersion: undefined, + DeploymentDurationInMinutes: undefined, + DeploymentNumber: undefined, + FinalBakeTimeInMinutes: undefined, + GrowthFactor: undefined, + GrowthType: undefined, + PercentageComplete: undefined, + StartedAt: undefined, + State: undefined + }; + if (output.CompletedAt !== undefined) { + contents.CompletedAt = new Date(output.CompletedAt); + } + if (output.ConfigurationName !== undefined) { + contents.ConfigurationName = output.ConfigurationName; + } + if (output.ConfigurationVersion !== undefined) { + contents.ConfigurationVersion = output.ConfigurationVersion; + } + if (output.DeploymentDurationInMinutes !== undefined) { + contents.DeploymentDurationInMinutes = output.DeploymentDurationInMinutes; + } + if (output.DeploymentNumber !== undefined) { + contents.DeploymentNumber = output.DeploymentNumber; + } + if (output.FinalBakeTimeInMinutes !== undefined) { + contents.FinalBakeTimeInMinutes = output.FinalBakeTimeInMinutes; + } + if (output.GrowthFactor !== undefined) { + contents.GrowthFactor = output.GrowthFactor; + } + if (output.GrowthType !== undefined) { + contents.GrowthType = output.GrowthType; + } + if (output.PercentageComplete !== undefined) { + contents.PercentageComplete = output.PercentageComplete; + } + if (output.StartedAt !== undefined) { + contents.StartedAt = new Date(output.StartedAt); + } + if (output.State !== undefined) { + contents.State = output.State; + } + return contents; +}; + +const deserializeAws_restJson1_1Environment = ( + output: any, + context: __SerdeContext +): Environment => { + let contents: any = { + __type: "Environment", + ApplicationId: undefined, + Description: undefined, + Id: undefined, + Monitors: undefined, + Name: undefined, + State: undefined + }; + if (output.ApplicationId !== undefined) { + contents.ApplicationId = output.ApplicationId; + } + if (output.Description !== undefined) { + contents.Description = output.Description; + } + if (output.Id !== undefined) { + contents.Id = output.Id; + } + if (output.Monitors !== undefined) { + contents.Monitors = deserializeAws_restJson1_1MonitorList( + output.Monitors, + context + ); + } + if (output.Name !== undefined) { + contents.Name = output.Name; + } + if (output.State !== undefined) { + contents.State = output.State; + } + return contents; +}; + +const deserializeAws_restJson1_1EnvironmentList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1Environment(entry, context) + ); +}; + +const deserializeAws_restJson1_1Monitor = ( + output: any, + context: __SerdeContext +): Monitor => { + let contents: any = { + __type: "Monitor", + AlarmArn: undefined, + AlarmRoleArn: undefined + }; + if (output.AlarmArn !== undefined) { + contents.AlarmArn = output.AlarmArn; + } + if (output.AlarmRoleArn !== undefined) { + contents.AlarmRoleArn = output.AlarmRoleArn; + } + return contents; +}; + +const deserializeAws_restJson1_1MonitorList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1Monitor(entry, context) + ); +}; + +const deserializeAws_restJson1_1TagMap = ( + output: any, + context: __SerdeContext +): { [key: string]: string } => { + let mapParams: any = {}; + Object.keys(output).forEach(key => { + mapParams[key] = output[key]; + }); + return mapParams; +}; + +const deserializeAws_restJson1_1Validator = ( + output: any, + context: __SerdeContext +): Validator => { + let contents: any = { + __type: "Validator", + Content: undefined, + Type: undefined + }; + if (output.Content !== undefined) { + contents.Content = output.Content; + } + if (output.Type !== undefined) { + contents.Type = output.Type; + } + return contents; +}; + +const deserializeAws_restJson1_1ValidatorList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restJson1_1Validator(entry, context) + ); +}; + +const deserializeAws_restJson1_1ValidatorTypeList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => entry); +}; + +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-appconfig/runtimeConfig.browser.ts b/clients/client-appconfig/runtimeConfig.browser.ts new file mode 100644 index 000000000000..88d68a0e997e --- /dev/null +++ b/clients/client-appconfig/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 "./AppConfigClient"; +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: "appconfig", + credentialDefaultProvider: invalidFunction("Credential is missing") as any, + regionDefaultProvider: invalidFunction("Region is missing") as any +}; diff --git a/clients/client-appconfig/runtimeConfig.shared.ts b/clients/client-appconfig/runtimeConfig.shared.ts new file mode 100644 index 000000000000..8015bb14b82d --- /dev/null +++ b/clients/client-appconfig/runtimeConfig.shared.ts @@ -0,0 +1,7 @@ +import { defaultRegionInfoProvider } from "./endpoints"; + +export const ClientSharedValues = { + apiVersion: "2019-10-09", + signingName: "appconfig", + regionInfoProvider: defaultRegionInfoProvider +}; diff --git a/clients/client-appconfig/runtimeConfig.ts b/clients/client-appconfig/runtimeConfig.ts new file mode 100644 index 000000000000..7bced4d41a92 --- /dev/null +++ b/clients/client-appconfig/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 "./AppConfigClient"; +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: "appconfig", + credentialDefaultProvider, + regionDefaultProvider +}; diff --git a/clients/client-appconfig/tsconfig.es.json b/clients/client-appconfig/tsconfig.es.json new file mode 100644 index 000000000000..9add6a7c2445 --- /dev/null +++ b/clients/client-appconfig/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-appconfig/tsconfig.json b/clients/client-appconfig/tsconfig.json new file mode 100644 index 000000000000..ca2fadc08187 --- /dev/null +++ b/clients/client-appconfig/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" + } +}