From 43794db552b3a062eed69552893abdc47d9df688 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 14 Jan 2020 15:16:47 -0800 Subject: [PATCH] feat: add client-s3-control (#729) --- clients/client-s3-control/.gitignore | 14 + clients/client-s3-control/.npmignore | 4 + clients/client-s3-control/LICENSE | 201 ++ clients/client-s3-control/README.md | 6 + clients/client-s3-control/S3Control.ts | 686 ++++ clients/client-s3-control/S3ControlClient.ts | 252 ++ .../commands/CreateAccessPointCommand.ts | 82 + .../commands/CreateJobCommand.ts | 81 + .../commands/DeleteAccessPointCommand.ts | 82 + .../DeleteAccessPointPolicyCommand.ts | 88 + .../DeletePublicAccessBlockCommand.ts | 88 + .../commands/DescribeJobCommand.ts | 81 + .../commands/GetAccessPointCommand.ts | 81 + .../commands/GetAccessPointPolicyCommand.ts | 87 + .../GetAccessPointPolicyStatusCommand.ts | 93 + .../commands/GetPublicAccessBlockCommand.ts | 87 + .../commands/ListAccessPointsCommand.ts | 84 + .../commands/ListJobsCommand.ts | 81 + .../commands/PutAccessPointPolicyCommand.ts | 85 + .../commands/PutPublicAccessBlockCommand.ts | 85 + .../commands/UpdateJobPriorityCommand.ts | 84 + .../commands/UpdateJobStatusCommand.ts | 81 + clients/client-s3-control/endpoints.ts | 234 ++ clients/client-s3-control/index.ts | 18 + clients/client-s3-control/models/index.ts | 2120 +++++++++++ clients/client-s3-control/package.json | 78 + .../protocols/Aws_restXml.ts | 3209 +++++++++++++++++ .../runtimeConfig.browser.ts | 30 + .../client-s3-control/runtimeConfig.shared.ts | 7 + clients/client-s3-control/runtimeConfig.ts | 31 + clients/client-s3-control/tsconfig.es.json | 19 + clients/client-s3-control/tsconfig.json | 27 + 32 files changed, 8286 insertions(+) create mode 100644 clients/client-s3-control/.gitignore create mode 100644 clients/client-s3-control/.npmignore create mode 100644 clients/client-s3-control/LICENSE create mode 100644 clients/client-s3-control/README.md create mode 100644 clients/client-s3-control/S3Control.ts create mode 100644 clients/client-s3-control/S3ControlClient.ts create mode 100644 clients/client-s3-control/commands/CreateAccessPointCommand.ts create mode 100644 clients/client-s3-control/commands/CreateJobCommand.ts create mode 100644 clients/client-s3-control/commands/DeleteAccessPointCommand.ts create mode 100644 clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts create mode 100644 clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts create mode 100644 clients/client-s3-control/commands/DescribeJobCommand.ts create mode 100644 clients/client-s3-control/commands/GetAccessPointCommand.ts create mode 100644 clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts create mode 100644 clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts create mode 100644 clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts create mode 100644 clients/client-s3-control/commands/ListAccessPointsCommand.ts create mode 100644 clients/client-s3-control/commands/ListJobsCommand.ts create mode 100644 clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts create mode 100644 clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts create mode 100644 clients/client-s3-control/commands/UpdateJobPriorityCommand.ts create mode 100644 clients/client-s3-control/commands/UpdateJobStatusCommand.ts create mode 100644 clients/client-s3-control/endpoints.ts create mode 100644 clients/client-s3-control/index.ts create mode 100644 clients/client-s3-control/models/index.ts create mode 100644 clients/client-s3-control/package.json create mode 100644 clients/client-s3-control/protocols/Aws_restXml.ts create mode 100644 clients/client-s3-control/runtimeConfig.browser.ts create mode 100644 clients/client-s3-control/runtimeConfig.shared.ts create mode 100644 clients/client-s3-control/runtimeConfig.ts create mode 100644 clients/client-s3-control/tsconfig.es.json create mode 100644 clients/client-s3-control/tsconfig.json diff --git a/clients/client-s3-control/.gitignore b/clients/client-s3-control/.gitignore new file mode 100644 index 000000000000..b41c05b597c4 --- /dev/null +++ b/clients/client-s3-control/.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-s3-control/.npmignore b/clients/client-s3-control/.npmignore new file mode 100644 index 000000000000..b7ff81137c4a --- /dev/null +++ b/clients/client-s3-control/.npmignore @@ -0,0 +1,4 @@ +/coverage/ +/docs/ +tsconfig.test.json +*.tsbuildinfo diff --git a/clients/client-s3-control/LICENSE b/clients/client-s3-control/LICENSE new file mode 100644 index 000000000000..b7d2463d8cc0 --- /dev/null +++ b/clients/client-s3-control/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-s3-control/README.md b/clients/client-s3-control/README.md new file mode 100644 index 000000000000..faa93934070e --- /dev/null +++ b/clients/client-s3-control/README.md @@ -0,0 +1,6 @@ +@aws-sdk/client-s3-control + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-s3-control/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3-control) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-s3-control.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3-control) + +For SDK usage, please step to [SDK reademe](https://github.com/aws/aws-sdk-js-v3). diff --git a/clients/client-s3-control/S3Control.ts b/clients/client-s3-control/S3Control.ts new file mode 100644 index 000000000000..8a78a04c460a --- /dev/null +++ b/clients/client-s3-control/S3Control.ts @@ -0,0 +1,686 @@ +import { S3ControlClient } from "./S3ControlClient"; +import { + CreateAccessPointCommand, + CreateAccessPointCommandInput, + CreateAccessPointCommandOutput +} from "./commands/CreateAccessPointCommand"; +import { + CreateJobCommand, + CreateJobCommandInput, + CreateJobCommandOutput +} from "./commands/CreateJobCommand"; +import { + DeleteAccessPointCommand, + DeleteAccessPointCommandInput, + DeleteAccessPointCommandOutput +} from "./commands/DeleteAccessPointCommand"; +import { + DeleteAccessPointPolicyCommand, + DeleteAccessPointPolicyCommandInput, + DeleteAccessPointPolicyCommandOutput +} from "./commands/DeleteAccessPointPolicyCommand"; +import { + DeletePublicAccessBlockCommand, + DeletePublicAccessBlockCommandInput, + DeletePublicAccessBlockCommandOutput +} from "./commands/DeletePublicAccessBlockCommand"; +import { + DescribeJobCommand, + DescribeJobCommandInput, + DescribeJobCommandOutput +} from "./commands/DescribeJobCommand"; +import { + GetAccessPointCommand, + GetAccessPointCommandInput, + GetAccessPointCommandOutput +} from "./commands/GetAccessPointCommand"; +import { + GetAccessPointPolicyCommand, + GetAccessPointPolicyCommandInput, + GetAccessPointPolicyCommandOutput +} from "./commands/GetAccessPointPolicyCommand"; +import { + GetAccessPointPolicyStatusCommand, + GetAccessPointPolicyStatusCommandInput, + GetAccessPointPolicyStatusCommandOutput +} from "./commands/GetAccessPointPolicyStatusCommand"; +import { + GetPublicAccessBlockCommand, + GetPublicAccessBlockCommandInput, + GetPublicAccessBlockCommandOutput +} from "./commands/GetPublicAccessBlockCommand"; +import { + ListAccessPointsCommand, + ListAccessPointsCommandInput, + ListAccessPointsCommandOutput +} from "./commands/ListAccessPointsCommand"; +import { + ListJobsCommand, + ListJobsCommandInput, + ListJobsCommandOutput +} from "./commands/ListJobsCommand"; +import { + PutAccessPointPolicyCommand, + PutAccessPointPolicyCommandInput, + PutAccessPointPolicyCommandOutput +} from "./commands/PutAccessPointPolicyCommand"; +import { + PutPublicAccessBlockCommand, + PutPublicAccessBlockCommandInput, + PutPublicAccessBlockCommandOutput +} from "./commands/PutPublicAccessBlockCommand"; +import { + UpdateJobPriorityCommand, + UpdateJobPriorityCommandInput, + UpdateJobPriorityCommandOutput +} from "./commands/UpdateJobPriorityCommand"; +import { + UpdateJobStatusCommand, + UpdateJobStatusCommandInput, + UpdateJobStatusCommandOutput +} from "./commands/UpdateJobStatusCommand"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +/** + * + *

+ * AWS S3 Control provides access to Amazon S3 control plane operations. + *

+ * + */ +export class S3Control extends S3ControlClient { + /** + * + *

Creates an access point and associates it with the specified bucket.

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

Creates an Amazon S3 batch operations job.

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

Deletes the specified access point.

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

Deletes the access point policy for the specified access point.

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

Removes the PublicAccessBlock configuration for an Amazon Web Services + * account.

+ * + */ + public deletePublicAccessBlock( + args: DeletePublicAccessBlockCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deletePublicAccessBlock( + args: DeletePublicAccessBlockCommandInput, + cb: (err: any, data?: DeletePublicAccessBlockCommandOutput) => void + ): void; + public deletePublicAccessBlock( + args: DeletePublicAccessBlockCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeletePublicAccessBlockCommandOutput) => void + ): void; + public deletePublicAccessBlock( + args: DeletePublicAccessBlockCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeletePublicAccessBlockCommandOutput) => void), + cb?: (err: any, data?: DeletePublicAccessBlockCommandOutput) => void + ): Promise | void { + const command = new DeletePublicAccessBlockCommand(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 configuration parameters and status for a batch operations job.

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

Returns configuration information about the specified access point.

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

Returns the access point policy associated with the specified access point.

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

Indicates whether the specified access point currently has a policy that allows public access. For more information about public access through access points, see Managing Data Access with Amazon S3 Access Points in the Amazon Simple Storage Service Developer Guide.

+ * + */ + public getAccessPointPolicyStatus( + args: GetAccessPointPolicyStatusCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getAccessPointPolicyStatus( + args: GetAccessPointPolicyStatusCommandInput, + cb: (err: any, data?: GetAccessPointPolicyStatusCommandOutput) => void + ): void; + public getAccessPointPolicyStatus( + args: GetAccessPointPolicyStatusCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAccessPointPolicyStatusCommandOutput) => void + ): void; + public getAccessPointPolicyStatus( + args: GetAccessPointPolicyStatusCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: GetAccessPointPolicyStatusCommandOutput) => void), + cb?: (err: any, data?: GetAccessPointPolicyStatusCommandOutput) => void + ): Promise | void { + const command = new GetAccessPointPolicyStatusCommand(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 PublicAccessBlock configuration for an Amazon Web Services account.

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

Returns a list of the access points currently associated with the specified bucket. You can + * retrieve up to 1000 access points per call. If the specified bucket has more than 1000 access points (or the number specified in maxResults, whichever is less), then the response will include a continuation token that you can use to list the additional access points.

+ * + */ + public listAccessPoints( + args: ListAccessPointsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listAccessPoints( + args: ListAccessPointsCommandInput, + cb: (err: any, data?: ListAccessPointsCommandOutput) => void + ): void; + public listAccessPoints( + args: ListAccessPointsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAccessPointsCommandOutput) => void + ): void; + public listAccessPoints( + args: ListAccessPointsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListAccessPointsCommandOutput) => void), + cb?: (err: any, data?: ListAccessPointsCommandOutput) => void + ): Promise | void { + const command = new ListAccessPointsCommand(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 current jobs and jobs that have ended within the last 30 days for the AWS account making the request.

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

Associates an access policy with the specified access point. Each access point can have only one policy, so a request made to this API replaces any existing policy associated with the specified access point.

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

Creates or modifies the PublicAccessBlock configuration for an Amazon Web Services + * account.

+ * + */ + public putPublicAccessBlock( + args: PutPublicAccessBlockCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public putPublicAccessBlock( + args: PutPublicAccessBlockCommandInput, + cb: (err: any, data?: PutPublicAccessBlockCommandOutput) => void + ): void; + public putPublicAccessBlock( + args: PutPublicAccessBlockCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutPublicAccessBlockCommandOutput) => void + ): void; + public putPublicAccessBlock( + args: PutPublicAccessBlockCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: PutPublicAccessBlockCommandOutput) => void), + cb?: (err: any, data?: PutPublicAccessBlockCommandOutput) => void + ): Promise | void { + const command = new PutPublicAccessBlockCommand(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 existing job's priority.

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

Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job.

+ * + */ + public updateJobStatus( + args: UpdateJobStatusCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateJobStatus( + args: UpdateJobStatusCommandInput, + cb: (err: any, data?: UpdateJobStatusCommandOutput) => void + ): void; + public updateJobStatus( + args: UpdateJobStatusCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateJobStatusCommandOutput) => void + ): void; + public updateJobStatus( + args: UpdateJobStatusCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateJobStatusCommandOutput) => void), + cb?: (err: any, data?: UpdateJobStatusCommandOutput) => void + ): Promise | void { + const command = new UpdateJobStatusCommand(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-s3-control/S3ControlClient.ts b/clients/client-s3-control/S3ControlClient.ts new file mode 100644 index 000000000000..7b4a10803958 --- /dev/null +++ b/clients/client-s3-control/S3ControlClient.ts @@ -0,0 +1,252 @@ +import { + CreateAccessPointRequest, + CreateJobRequest, + CreateJobResult, + DeleteAccessPointPolicyRequest, + DeleteAccessPointRequest, + DeletePublicAccessBlockRequest, + DescribeJobRequest, + DescribeJobResult, + GetAccessPointPolicyRequest, + GetAccessPointPolicyResult, + GetAccessPointPolicyStatusRequest, + GetAccessPointPolicyStatusResult, + GetAccessPointRequest, + GetAccessPointResult, + GetPublicAccessBlockOutput, + GetPublicAccessBlockRequest, + ListAccessPointsRequest, + ListAccessPointsResult, + ListJobsRequest, + ListJobsResult, + PutAccessPointPolicyRequest, + PutPublicAccessBlockRequest, + UpdateJobPriorityRequest, + UpdateJobPriorityResult, + UpdateJobStatusRequest, + UpdateJobStatusResult +} 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 { getPrependAccountIdPlugin } from "@aws-sdk/middleware-sdk-s3-control"; +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 = + | CreateAccessPointRequest + | CreateJobRequest + | DeleteAccessPointPolicyRequest + | DeleteAccessPointRequest + | DeletePublicAccessBlockRequest + | DescribeJobRequest + | GetAccessPointPolicyRequest + | GetAccessPointPolicyStatusRequest + | GetAccessPointRequest + | GetPublicAccessBlockRequest + | ListAccessPointsRequest + | ListJobsRequest + | PutAccessPointPolicyRequest + | PutPublicAccessBlockRequest + | UpdateJobPriorityRequest + | UpdateJobStatusRequest; + +export type ServiceOutputTypes = + | __MetadataBearer + | CreateJobResult + | DescribeJobResult + | GetAccessPointPolicyResult + | GetAccessPointPolicyStatusResult + | GetAccessPointResult + | GetPublicAccessBlockOutput + | ListAccessPointsResult + | ListJobsResult + | UpdateJobPriorityResult + | UpdateJobStatusResult; + +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 S3ControlClientConfig = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointsInputConfig & + AwsAuthInputConfig & + RetryInputConfig & + UserAgentInputConfig & + HostHeaderInputConfig; + +export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration< + __HttpHandlerOptions +> & + Required & + RegionResolvedConfig & + EndpointsResolvedConfig & + AwsAuthResolvedConfig & + RetryResolvedConfig & + UserAgentResolvedConfig & + HostHeaderResolvedConfig; + +/** + * + *

+ * AWS S3 Control provides access to Amazon S3 control plane operations. + *

+ * + */ +export class S3ControlClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + S3ControlClientResolvedConfig +> { + readonly config: S3ControlClientResolvedConfig; + + constructor(configuration: S3ControlClientConfig) { + 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(getPrependAccountIdPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + } + + destroy(): void {} +} diff --git a/clients/client-s3-control/commands/CreateAccessPointCommand.ts b/clients/client-s3-control/commands/CreateAccessPointCommand.ts new file mode 100644 index 000000000000..0babff350b16 --- /dev/null +++ b/clients/client-s3-control/commands/CreateAccessPointCommand.ts @@ -0,0 +1,82 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { CreateAccessPointRequest } from "../models/index"; +import { + deserializeAws_restXmlCreateAccessPointCommand, + serializeAws_restXmlCreateAccessPointCommand +} from "../protocols/Aws_restXml"; +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 CreateAccessPointCommandInput = CreateAccessPointRequest; +export type CreateAccessPointCommandOutput = __MetadataBearer; + +export class CreateAccessPointCommand extends $Command< + CreateAccessPointCommandInput, + CreateAccessPointCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateAccessPointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: CreateAccessPointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlCreateAccessPointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlCreateAccessPointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/CreateJobCommand.ts b/clients/client-s3-control/commands/CreateJobCommand.ts new file mode 100644 index 000000000000..89eee8320da2 --- /dev/null +++ b/clients/client-s3-control/commands/CreateJobCommand.ts @@ -0,0 +1,81 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { CreateJobRequest, CreateJobResult } from "../models/index"; +import { + deserializeAws_restXmlCreateJobCommand, + serializeAws_restXmlCreateJobCommand +} from "../protocols/Aws_restXml"; +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 CreateJobCommandInput = CreateJobRequest; +export type CreateJobCommandOutput = CreateJobResult; + +export class CreateJobCommand extends $Command< + CreateJobCommandInput, + CreateJobCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: CreateJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlCreateJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlCreateJobCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/DeleteAccessPointCommand.ts b/clients/client-s3-control/commands/DeleteAccessPointCommand.ts new file mode 100644 index 000000000000..09cf7d589621 --- /dev/null +++ b/clients/client-s3-control/commands/DeleteAccessPointCommand.ts @@ -0,0 +1,82 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { DeleteAccessPointRequest } from "../models/index"; +import { + deserializeAws_restXmlDeleteAccessPointCommand, + serializeAws_restXmlDeleteAccessPointCommand +} from "../protocols/Aws_restXml"; +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 DeleteAccessPointCommandInput = DeleteAccessPointRequest; +export type DeleteAccessPointCommandOutput = __MetadataBearer; + +export class DeleteAccessPointCommand extends $Command< + DeleteAccessPointCommandInput, + DeleteAccessPointCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteAccessPointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: DeleteAccessPointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlDeleteAccessPointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlDeleteAccessPointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts b/clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts new file mode 100644 index 000000000000..4bd8ff783d90 --- /dev/null +++ b/clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts @@ -0,0 +1,88 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { DeleteAccessPointPolicyRequest } from "../models/index"; +import { + deserializeAws_restXmlDeleteAccessPointPolicyCommand, + serializeAws_restXmlDeleteAccessPointPolicyCommand +} from "../protocols/Aws_restXml"; +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 DeleteAccessPointPolicyCommandInput = DeleteAccessPointPolicyRequest; +export type DeleteAccessPointPolicyCommandOutput = __MetadataBearer; + +export class DeleteAccessPointPolicyCommand extends $Command< + DeleteAccessPointPolicyCommandInput, + DeleteAccessPointPolicyCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteAccessPointPolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeleteAccessPointPolicyCommandInput, + DeleteAccessPointPolicyCommandOutput + > { + 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: DeleteAccessPointPolicyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlDeleteAccessPointPolicyCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlDeleteAccessPointPolicyCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts b/clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts new file mode 100644 index 000000000000..9e763b55d38e --- /dev/null +++ b/clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts @@ -0,0 +1,88 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { DeletePublicAccessBlockRequest } from "../models/index"; +import { + deserializeAws_restXmlDeletePublicAccessBlockCommand, + serializeAws_restXmlDeletePublicAccessBlockCommand +} from "../protocols/Aws_restXml"; +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 DeletePublicAccessBlockCommandInput = DeletePublicAccessBlockRequest; +export type DeletePublicAccessBlockCommandOutput = __MetadataBearer; + +export class DeletePublicAccessBlockCommand extends $Command< + DeletePublicAccessBlockCommandInput, + DeletePublicAccessBlockCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeletePublicAccessBlockCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeletePublicAccessBlockCommandInput, + DeletePublicAccessBlockCommandOutput + > { + 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: DeletePublicAccessBlockCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlDeletePublicAccessBlockCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlDeletePublicAccessBlockCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/DescribeJobCommand.ts b/clients/client-s3-control/commands/DescribeJobCommand.ts new file mode 100644 index 000000000000..5be60b9147d6 --- /dev/null +++ b/clients/client-s3-control/commands/DescribeJobCommand.ts @@ -0,0 +1,81 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { DescribeJobRequest, DescribeJobResult } from "../models/index"; +import { + deserializeAws_restXmlDescribeJobCommand, + serializeAws_restXmlDescribeJobCommand +} from "../protocols/Aws_restXml"; +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 DescribeJobCommandInput = DescribeJobRequest; +export type DescribeJobCommandOutput = DescribeJobResult; + +export class DescribeJobCommand extends $Command< + DescribeJobCommandInput, + DescribeJobCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: DescribeJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlDescribeJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlDescribeJobCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/GetAccessPointCommand.ts b/clients/client-s3-control/commands/GetAccessPointCommand.ts new file mode 100644 index 000000000000..ca731722eaa4 --- /dev/null +++ b/clients/client-s3-control/commands/GetAccessPointCommand.ts @@ -0,0 +1,81 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { GetAccessPointRequest, GetAccessPointResult } from "../models/index"; +import { + deserializeAws_restXmlGetAccessPointCommand, + serializeAws_restXmlGetAccessPointCommand +} from "../protocols/Aws_restXml"; +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 GetAccessPointCommandInput = GetAccessPointRequest; +export type GetAccessPointCommandOutput = GetAccessPointResult; + +export class GetAccessPointCommand extends $Command< + GetAccessPointCommandInput, + GetAccessPointCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetAccessPointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: GetAccessPointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlGetAccessPointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlGetAccessPointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts b/clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts new file mode 100644 index 000000000000..407a7de5fc9a --- /dev/null +++ b/clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts @@ -0,0 +1,87 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { + GetAccessPointPolicyRequest, + GetAccessPointPolicyResult +} from "../models/index"; +import { + deserializeAws_restXmlGetAccessPointPolicyCommand, + serializeAws_restXmlGetAccessPointPolicyCommand +} from "../protocols/Aws_restXml"; +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 GetAccessPointPolicyCommandInput = GetAccessPointPolicyRequest; +export type GetAccessPointPolicyCommandOutput = GetAccessPointPolicyResult; + +export class GetAccessPointPolicyCommand extends $Command< + GetAccessPointPolicyCommandInput, + GetAccessPointPolicyCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetAccessPointPolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetAccessPointPolicyCommandInput, + GetAccessPointPolicyCommandOutput + > { + 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: GetAccessPointPolicyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlGetAccessPointPolicyCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlGetAccessPointPolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts b/clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts new file mode 100644 index 000000000000..0b5c15a916e8 --- /dev/null +++ b/clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts @@ -0,0 +1,93 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { + GetAccessPointPolicyStatusRequest, + GetAccessPointPolicyStatusResult +} from "../models/index"; +import { + deserializeAws_restXmlGetAccessPointPolicyStatusCommand, + serializeAws_restXmlGetAccessPointPolicyStatusCommand +} from "../protocols/Aws_restXml"; +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 GetAccessPointPolicyStatusCommandInput = GetAccessPointPolicyStatusRequest; +export type GetAccessPointPolicyStatusCommandOutput = GetAccessPointPolicyStatusResult; + +export class GetAccessPointPolicyStatusCommand extends $Command< + GetAccessPointPolicyStatusCommandInput, + GetAccessPointPolicyStatusCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetAccessPointPolicyStatusCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetAccessPointPolicyStatusCommandInput, + GetAccessPointPolicyStatusCommandOutput + > { + 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: GetAccessPointPolicyStatusCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlGetAccessPointPolicyStatusCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlGetAccessPointPolicyStatusCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts b/clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts new file mode 100644 index 000000000000..401242d8754d --- /dev/null +++ b/clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts @@ -0,0 +1,87 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { + GetPublicAccessBlockOutput, + GetPublicAccessBlockRequest +} from "../models/index"; +import { + deserializeAws_restXmlGetPublicAccessBlockCommand, + serializeAws_restXmlGetPublicAccessBlockCommand +} from "../protocols/Aws_restXml"; +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 GetPublicAccessBlockCommandInput = GetPublicAccessBlockRequest; +export type GetPublicAccessBlockCommandOutput = GetPublicAccessBlockOutput; + +export class GetPublicAccessBlockCommand extends $Command< + GetPublicAccessBlockCommandInput, + GetPublicAccessBlockCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetPublicAccessBlockCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetPublicAccessBlockCommandInput, + GetPublicAccessBlockCommandOutput + > { + 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: GetPublicAccessBlockCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlGetPublicAccessBlockCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlGetPublicAccessBlockCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/ListAccessPointsCommand.ts b/clients/client-s3-control/commands/ListAccessPointsCommand.ts new file mode 100644 index 000000000000..fe3dc88f4277 --- /dev/null +++ b/clients/client-s3-control/commands/ListAccessPointsCommand.ts @@ -0,0 +1,84 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { + ListAccessPointsRequest, + ListAccessPointsResult +} from "../models/index"; +import { + deserializeAws_restXmlListAccessPointsCommand, + serializeAws_restXmlListAccessPointsCommand +} from "../protocols/Aws_restXml"; +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 ListAccessPointsCommandInput = ListAccessPointsRequest; +export type ListAccessPointsCommandOutput = ListAccessPointsResult; + +export class ListAccessPointsCommand extends $Command< + ListAccessPointsCommandInput, + ListAccessPointsCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListAccessPointsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: ListAccessPointsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlListAccessPointsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlListAccessPointsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/ListJobsCommand.ts b/clients/client-s3-control/commands/ListJobsCommand.ts new file mode 100644 index 000000000000..830d3cd41ab2 --- /dev/null +++ b/clients/client-s3-control/commands/ListJobsCommand.ts @@ -0,0 +1,81 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { ListJobsRequest, ListJobsResult } from "../models/index"; +import { + deserializeAws_restXmlListJobsCommand, + serializeAws_restXmlListJobsCommand +} from "../protocols/Aws_restXml"; +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 ListJobsCommandInput = ListJobsRequest; +export type ListJobsCommandOutput = ListJobsResult; + +export class ListJobsCommand extends $Command< + ListJobsCommandInput, + ListJobsCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: ListJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlListJobsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlListJobsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts b/clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts new file mode 100644 index 000000000000..8dc6eae2319d --- /dev/null +++ b/clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts @@ -0,0 +1,85 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { PutAccessPointPolicyRequest } from "../models/index"; +import { + deserializeAws_restXmlPutAccessPointPolicyCommand, + serializeAws_restXmlPutAccessPointPolicyCommand +} from "../protocols/Aws_restXml"; +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 PutAccessPointPolicyCommandInput = PutAccessPointPolicyRequest; +export type PutAccessPointPolicyCommandOutput = __MetadataBearer; + +export class PutAccessPointPolicyCommand extends $Command< + PutAccessPointPolicyCommandInput, + PutAccessPointPolicyCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: PutAccessPointPolicyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + PutAccessPointPolicyCommandInput, + PutAccessPointPolicyCommandOutput + > { + 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: PutAccessPointPolicyCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlPutAccessPointPolicyCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlPutAccessPointPolicyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts b/clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts new file mode 100644 index 000000000000..0822c1208a1b --- /dev/null +++ b/clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts @@ -0,0 +1,85 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { PutPublicAccessBlockRequest } from "../models/index"; +import { + deserializeAws_restXmlPutPublicAccessBlockCommand, + serializeAws_restXmlPutPublicAccessBlockCommand +} from "../protocols/Aws_restXml"; +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 PutPublicAccessBlockCommandInput = PutPublicAccessBlockRequest; +export type PutPublicAccessBlockCommandOutput = __MetadataBearer; + +export class PutPublicAccessBlockCommand extends $Command< + PutPublicAccessBlockCommandInput, + PutPublicAccessBlockCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: PutPublicAccessBlockCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + PutPublicAccessBlockCommandInput, + PutPublicAccessBlockCommandOutput + > { + 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: PutPublicAccessBlockCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlPutPublicAccessBlockCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlPutPublicAccessBlockCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/UpdateJobPriorityCommand.ts b/clients/client-s3-control/commands/UpdateJobPriorityCommand.ts new file mode 100644 index 000000000000..8288d88838fd --- /dev/null +++ b/clients/client-s3-control/commands/UpdateJobPriorityCommand.ts @@ -0,0 +1,84 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { + UpdateJobPriorityRequest, + UpdateJobPriorityResult +} from "../models/index"; +import { + deserializeAws_restXmlUpdateJobPriorityCommand, + serializeAws_restXmlUpdateJobPriorityCommand +} from "../protocols/Aws_restXml"; +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 UpdateJobPriorityCommandInput = UpdateJobPriorityRequest; +export type UpdateJobPriorityCommandOutput = UpdateJobPriorityResult; + +export class UpdateJobPriorityCommand extends $Command< + UpdateJobPriorityCommandInput, + UpdateJobPriorityCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateJobPriorityCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: UpdateJobPriorityCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlUpdateJobPriorityCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlUpdateJobPriorityCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/commands/UpdateJobStatusCommand.ts b/clients/client-s3-control/commands/UpdateJobStatusCommand.ts new file mode 100644 index 000000000000..f392761c2734 --- /dev/null +++ b/clients/client-s3-control/commands/UpdateJobStatusCommand.ts @@ -0,0 +1,81 @@ +import { + S3ControlClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../S3ControlClient"; +import { UpdateJobStatusRequest, UpdateJobStatusResult } from "../models/index"; +import { + deserializeAws_restXmlUpdateJobStatusCommand, + serializeAws_restXmlUpdateJobStatusCommand +} from "../protocols/Aws_restXml"; +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 UpdateJobStatusCommandInput = UpdateJobStatusRequest; +export type UpdateJobStatusCommandOutput = UpdateJobStatusResult; + +export class UpdateJobStatusCommand extends $Command< + UpdateJobStatusCommandInput, + UpdateJobStatusCommandOutput, + S3ControlClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateJobStatusCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: S3ControlClientResolvedConfig, + 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: UpdateJobStatusCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_restXmlUpdateJobStatusCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_restXmlUpdateJobStatusCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-s3-control/endpoints.ts b/clients/client-s3-control/endpoints.ts new file mode 100644 index 000000000000..54de26f832b1 --- /dev/null +++ b/clients/client-s3-control/endpoints.ts @@ -0,0 +1,234 @@ +import { RegionInfo, RegionInfoProvider } from "@aws-sdk/types"; + +// Partition default templates +const AWS_TEMPLATE = "s3-control.{region}.amazonaws.com"; +const AWS_CN_TEMPLATE = "s3-control.{region}.amazonaws.com.cn"; +const AWS_ISO_TEMPLATE = "s3-control.{region}.c2s.ic.gov"; +const AWS_ISO_B_TEMPLATE = "s3-control.{region}.sc2s.sgov.gov"; +const AWS_US_GOV_TEMPLATE = "s3-control.{region}.amazonaws.com"; + +// Partition regions +const AWS_REGIONS = new Set([ + "ap-south-1", + "eu-north-1", + "eu-west-3", + "eu-west-2", + "eu-west-1", + "ap-northeast-2", + "ap-northeast-1", + "me-south-1", + "ca-central-1", + "sa-east-1", + "ap-east-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "us-east-1", + "us-east-2", + "us-west-1", + "us-west-2" +]); +const AWS_CN_REGIONS = new Set(["cn-north-1", "cn-northwest-1"]); +const AWS_ISO_REGIONS = new Set(["us-iso-east-1"]); +const AWS_ISO_B_REGIONS = new Set(["us-isob-east-1"]); +const AWS_US_GOV_REGIONS = new Set(["us-gov-west-1", "us-gov-east-1"]); + +export const defaultRegionInfoProvider: RegionInfoProvider = ( + region: string, + options?: any +) => { + let regionInfo: RegionInfo | undefined = undefined; + switch (region) { + // First, try to match exact region names. + case "ap-northeast-1": + regionInfo = { + hostname: "s3-control.ap-northeast-1.amazonaws.com", + signingRegion: "ap-northeast-1" + }; + break; + case "ap-northeast-2": + regionInfo = { + hostname: "s3-control.ap-northeast-2.amazonaws.com", + signingRegion: "ap-northeast-2" + }; + break; + case "ap-south-1": + regionInfo = { + hostname: "s3-control.ap-south-1.amazonaws.com", + signingRegion: "ap-south-1" + }; + break; + case "ap-southeast-1": + regionInfo = { + hostname: "s3-control.ap-southeast-1.amazonaws.com", + signingRegion: "ap-southeast-1" + }; + break; + case "ap-southeast-2": + regionInfo = { + hostname: "s3-control.ap-southeast-2.amazonaws.com", + signingRegion: "ap-southeast-2" + }; + break; + case "ca-central-1": + regionInfo = { + hostname: "s3-control.ca-central-1.amazonaws.com", + signingRegion: "ca-central-1" + }; + break; + case "cn-north-1": + regionInfo = { + hostname: "s3-control.cn-north-1.amazonaws.com.cn", + signingRegion: "cn-north-1" + }; + break; + case "cn-northwest-1": + regionInfo = { + hostname: "s3-control.cn-northwest-1.amazonaws.com.cn", + signingRegion: "cn-northwest-1" + }; + break; + case "eu-central-1": + regionInfo = { + hostname: "s3-control.eu-central-1.amazonaws.com", + signingRegion: "eu-central-1" + }; + break; + case "eu-north-1": + regionInfo = { + hostname: "s3-control.eu-north-1.amazonaws.com", + signingRegion: "eu-north-1" + }; + break; + case "eu-west-1": + regionInfo = { + hostname: "s3-control.eu-west-1.amazonaws.com", + signingRegion: "eu-west-1" + }; + break; + case "eu-west-2": + regionInfo = { + hostname: "s3-control.eu-west-2.amazonaws.com", + signingRegion: "eu-west-2" + }; + break; + case "eu-west-3": + regionInfo = { + hostname: "s3-control.eu-west-3.amazonaws.com", + signingRegion: "eu-west-3" + }; + break; + case "sa-east-1": + regionInfo = { + hostname: "s3-control.sa-east-1.amazonaws.com", + signingRegion: "sa-east-1" + }; + break; + case "us-east-1": + regionInfo = { + hostname: "s3-control.us-east-1.amazonaws.com", + signingRegion: "us-east-1" + }; + break; + case "us-east-1-fips": + regionInfo = { + hostname: "s3-control-fips.us-east-1.amazonaws.com", + signingRegion: "us-east-1" + }; + break; + case "us-east-2": + regionInfo = { + hostname: "s3-control.us-east-2.amazonaws.com", + signingRegion: "us-east-2" + }; + break; + case "us-east-2-fips": + regionInfo = { + hostname: "s3-control-fips.us-east-2.amazonaws.com", + signingRegion: "us-east-2" + }; + break; + case "us-gov-east-1": + regionInfo = { + hostname: "s3-control.us-gov-east-1.amazonaws.com", + signingRegion: "us-gov-east-1" + }; + break; + case "us-gov-east-1-fips": + regionInfo = { + hostname: "s3-control-fips.us-gov-east-1.amazonaws.com", + signingRegion: "us-gov-east-1" + }; + break; + case "us-gov-west-1": + regionInfo = { + hostname: "s3-control.us-gov-west-1.amazonaws.com", + signingRegion: "us-gov-west-1" + }; + break; + case "us-gov-west-1-fips": + regionInfo = { + hostname: "s3-control-fips.us-gov-west-1.amazonaws.com", + signingRegion: "us-gov-west-1" + }; + break; + case "us-west-1": + regionInfo = { + hostname: "s3-control.us-west-1.amazonaws.com", + signingRegion: "us-west-1" + }; + break; + case "us-west-1-fips": + regionInfo = { + hostname: "s3-control-fips.us-west-1.amazonaws.com", + signingRegion: "us-west-1" + }; + break; + case "us-west-2": + regionInfo = { + hostname: "s3-control.us-west-2.amazonaws.com", + signingRegion: "us-west-2" + }; + break; + case "us-west-2-fips": + regionInfo = { + hostname: "s3-control-fips.us-west-2.amazonaws.com", + signingRegion: "us-west-2" + }; + break; + // Next, try to match partition endpoints. + default: + if (AWS_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_CN_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_CN_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_B_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_B_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_US_GOV_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_US_GOV_TEMPLATE.replace("{region}", region) + }; + } + // Finally, assume it's an AWS partition endpoint. + if (regionInfo === undefined) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + } + return Promise.resolve(regionInfo); +}; diff --git a/clients/client-s3-control/index.ts b/clients/client-s3-control/index.ts new file mode 100644 index 000000000000..1c713959e993 --- /dev/null +++ b/clients/client-s3-control/index.ts @@ -0,0 +1,18 @@ +export * from "./S3ControlClient"; +export * from "./S3Control"; +export * from "./commands/CreateAccessPointCommand"; +export * from "./commands/CreateJobCommand"; +export * from "./commands/DeleteAccessPointCommand"; +export * from "./commands/DeleteAccessPointPolicyCommand"; +export * from "./commands/DeletePublicAccessBlockCommand"; +export * from "./commands/DescribeJobCommand"; +export * from "./commands/GetAccessPointCommand"; +export * from "./commands/GetAccessPointPolicyCommand"; +export * from "./commands/GetAccessPointPolicyStatusCommand"; +export * from "./commands/GetPublicAccessBlockCommand"; +export * from "./commands/ListAccessPointsCommand"; +export * from "./commands/ListJobsCommand"; +export * from "./commands/PutAccessPointPolicyCommand"; +export * from "./commands/PutPublicAccessBlockCommand"; +export * from "./commands/UpdateJobPriorityCommand"; +export * from "./commands/UpdateJobStatusCommand"; diff --git a/clients/client-s3-control/models/index.ts b/clients/client-s3-control/models/index.ts new file mode 100644 index 000000000000..c9568c1668ce --- /dev/null +++ b/clients/client-s3-control/models/index.ts @@ -0,0 +1,2120 @@ +import * as _smithy from "@aws-sdk/smithy-client"; +import { MetadataBearer as $MetadataBearer } from "@aws-sdk/types"; + +/** + * + *

An access point used to access a bucket.

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

The name of the bucket associated with this access point.

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

The name of this access point.

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

Indicates whether this access point allows access from the public Internet. If VpcConfiguration is specified for this access point, then NetworkOrigin is VPC, and the access point doesn't allow + * access from the public Internet. Otherwise, NetworkOrigin is Internet, and the access point allows access from the public Internet, subject to the access point and bucket access policies.

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

The Virtual Private Cloud (VPC) configuration for this access point, if one exists.

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

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

The AWS account ID for the owner of the bucket for which you want to create an access point.

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

The name of the bucket that you want to associate this access point with.

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

The name you want to assign to this access point.

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

The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more information + * about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the Amazon Simple Storage Service Developer Guide.

+ * + */ + PublicAccessBlockConfiguration?: PublicAccessBlockConfiguration; + + /** + * + *

If you include this field, Amazon S3 restricts access to this access point to requests from the specified Virtual Private Cloud (VPC).

+ * + */ + VpcConfiguration?: VpcConfiguration; +} + +export namespace CreateAccessPointRequest { + export function isa(o: any): o is CreateAccessPointRequest { + return _smithy.isa(o, "CreateAccessPointRequest"); + } +} + +export interface CreateJobRequest { + __type?: "CreateJobRequest"; + /** + * + *

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

An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.

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

Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.

+ * + */ + ConfirmationRequired?: boolean; + + /** + * + *

A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.

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

Configuration parameters for the manifest.

+ * + */ + Manifest: JobManifest | undefined; + + /** + * + *

The operation that you want this job to perform on each object listed in the manifest. For more information about the available operations, see + * Available Operations in the Amazon Simple Storage Service Developer Guide.

+ * + */ + Operation: JobOperation | undefined; + + /** + * + *

The numerical priority for this job. Higher numbers indicate higher priority.

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

Configuration parameters for the optional job-completion report.

+ * + */ + Report: JobReport | undefined; + + /** + * + *

The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) Role that batch operations will use to execute this job's operation on each object in the manifest.

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

The ID for this job. Amazon S3 generates this ID automatically and returns it after a + * successful Create Job request.

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

The account ID for the account that owns the specified access point.

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

The name of the access point whose policy you want to delete.

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

The account ID for the account that owns the specified access point.

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

The name of the access point you want to delete.

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

The account ID for the Amazon Web Services account whose PublicAccessBlock + * configuration you want to remove.

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

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

The ID for the job whose information you want to retrieve.

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

Contains the configuration parameters and status for the job specified in the Describe Job request.

+ * + */ + Job?: JobDescriptor; +} + +export namespace DescribeJobResult { + export function isa(o: any): o is DescribeJobResult { + return _smithy.isa(o, "DescribeJobResult"); + } +} + +export interface GetAccessPointPolicyRequest { + __type?: "GetAccessPointPolicyRequest"; + /** + * + *

The account ID for the account that owns the specified access point.

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

The name of the access point whose policy you want to retrieve.

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

The access point policy associated with the specified access point.

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

The account ID for the account that owns the specified access point.

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

The name of the access point whose policy status you want to retrieve.

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

Indicates the current policy status of the specified access point.

+ * + */ + PolicyStatus?: PolicyStatus; +} + +export namespace GetAccessPointPolicyStatusResult { + export function isa(o: any): o is GetAccessPointPolicyStatusResult { + return _smithy.isa(o, "GetAccessPointPolicyStatusResult"); + } +} + +export interface GetAccessPointRequest { + __type?: "GetAccessPointRequest"; + /** + * + *

The account ID for the account that owns the specified access point.

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

The name of the access point whose configuration information you want to retrieve.

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

The name of the bucket associated with the specified access point.

+ * + */ + Bucket?: string; + + /** + * + *

The date and time when the specified access point was created.

+ * + */ + CreationDate?: Date; + + /** + * + *

The name of the specified access point.

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

Indicates whether this access point allows access from the public Internet. If VpcConfiguration is specified for this access point, then NetworkOrigin is VPC, and the access point doesn't allow + * access from the public Internet. Otherwise, NetworkOrigin is Internet, and the access point allows access from the public Internet, subject to the access point and bucket access policies.

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

The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more information + * about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the Amazon Simple Storage Service Developer Guide.

+ * + */ + PublicAccessBlockConfiguration?: PublicAccessBlockConfiguration; + + /** + * + *

Contains the Virtual Private Cloud (VPC) configuration for the specified access point.

+ * + */ + VpcConfiguration?: VpcConfiguration; +} + +export namespace GetAccessPointResult { + export function isa(o: any): o is GetAccessPointResult { + return _smithy.isa(o, "GetAccessPointResult"); + } +} + +export interface GetPublicAccessBlockOutput extends $MetadataBearer { + __type?: "GetPublicAccessBlockOutput"; + /** + * + *

The PublicAccessBlock configuration currently in effect for this Amazon Web Services + * account.

+ * + */ + PublicAccessBlockConfiguration?: PublicAccessBlockConfiguration; +} + +export namespace GetPublicAccessBlockOutput { + export function isa(o: any): o is GetPublicAccessBlockOutput { + return _smithy.isa(o, "GetPublicAccessBlockOutput"); + } +} + +export interface GetPublicAccessBlockRequest { + __type?: "GetPublicAccessBlockRequest"; + /** + * + *

The account ID for the Amazon Web Services account whose PublicAccessBlock + * configuration you want to retrieve.

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

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

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

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

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

A container element for the job configuration and status information returned by a Describe Job request.

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

Indicates whether confirmation is required before Amazon S3 begins running the specified job. Confirmation is required only for jobs created through the Amazon S3 console.

+ * + */ + ConfirmationRequired?: boolean; + + /** + * + *

A timestamp indicating when this job was created.

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

The description for this job, if one was provided in this job's Create Job request.

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

If the specified job failed, this field contains information describing the failure.

+ * + */ + FailureReasons?: Array; + + /** + * + *

The Amazon Resource Name (ARN) for this job.

+ * + */ + JobArn?: string; + + /** + * + *

The ID for the specified job.

+ * + */ + JobId?: string; + + /** + * + *

The configuration information for the specified job's manifest object.

+ * + */ + Manifest?: JobManifest; + + /** + * + *

The operation that the specified job is configured to execute on the objects listed in the manifest.

+ * + */ + Operation?: JobOperation; + + /** + * + *

The priority of the specified job.

+ * + */ + Priority?: number; + + /** + * + *

Describes the total number of tasks that the specified job has executed, the number of tasks that succeeded, and the number of tasks that failed.

+ * + */ + ProgressSummary?: JobProgressSummary; + + /** + * + *

Contains the configuration information for the job-completion report if you requested one in the Create Job request.

+ * + */ + Report?: JobReport; + + /** + * + *

The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) Role assigned to execute the tasks for this job.

+ * + */ + RoleArn?: string; + + /** + * + *

The current status of the specified job.

+ * + */ + Status?: JobStatus | string; + + /** + * + *

+ * + */ + StatusUpdateReason?: string; + + /** + * + *

The reason why the specified job was suspended. A job is only suspended if you create it through the Amazon S3 console. When you create the job, it enters + * the Suspended state to await confirmation before running. After you confirm the job, it automatically exits the Suspended state.

+ * + */ + SuspendedCause?: string; + + /** + * + *

The timestamp when this job was suspended, if it has been suspended.

+ * + */ + SuspendedDate?: Date; + + /** + * + *

A timestamp indicating when this job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled.

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

If this job failed, this element indicates why the job failed.

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

The failure code, if any, for the specified job.

+ * + */ + FailureCode?: string; + + /** + * + *

The failure reason, if any, for the specified job.

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

Contains the configuration and status information for a single job retrieved as part of a job list.

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

A timestamp indicating when the specified job was created.

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

The user-specified description that was included in the specified job's Create Job request.

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

The ID for the specified job.

+ * + */ + JobId?: string; + + /** + * + *

The operation that the specified job is configured to run on each object listed in the manifest.

+ * + */ + Operation?: OperationName | string; + + /** + * + *

The current priority for the specified job.

+ * + */ + Priority?: number; + + /** + * + *

Describes the total number of tasks that the specified job has executed, the number of tasks that succeeded, and the number of tasks that failed.

+ * + */ + ProgressSummary?: JobProgressSummary; + + /** + * + *

The specified job's current status.

+ * + */ + Status?: JobStatus | string; + + /** + * + *

A timestamp indicating when the specified job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled.

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

Contains the configuration information for a job's manifest.

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

Contains the information required to locate the specified job's manifest.

+ * + */ + Location: JobManifestLocation | undefined; + + /** + * + *

Describes the format of the specified job's manifest. If the manifest is in CSV format, also describes the columns contained within the manifest.

+ * + */ + Spec: JobManifestSpec | undefined; +} + +export namespace JobManifest { + export function isa(o: any): o is JobManifest { + return _smithy.isa(o, "JobManifest"); + } +} + +export enum JobManifestFieldName { + Bucket = "Bucket", + Ignore = "Ignore", + Key = "Key", + VersionId = "VersionId" +} + +export enum JobManifestFormat { + S3BatchOperations_CSV_20180820 = "S3BatchOperations_CSV_20180820", + S3InventoryReport_CSV_20161130 = "S3InventoryReport_CSV_20161130" +} + +/** + * + *

Contains the information required to locate a manifest object.

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

The ETag for the specified manifest object.

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

The Amazon Resource Name (ARN) for a manifest object.

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

The optional version ID to identify a specific version of the manifest object.

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

Describes the format of a manifest. If the manifest is in CSV format, also describes the columns contained within the manifest.

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

If the specified manifest object is in the S3BatchOperations_CSV_20180820 format, this element describes which columns contain the required data.

+ * + */ + Fields?: Array; + + /** + * + *

Indicates which of the available formats the specified manifest uses.

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

The operation that you want this job to perform on each object listed in the manifest. For more information about the available operations, see + * Available Operations in the Amazon Simple Storage Service Developer Guide.

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

Directs the specified job to invoke an AWS Lambda function on each object in the manifest.

+ * + */ + LambdaInvoke?: LambdaInvokeOperation; + + /** + * + *

Directs the specified job to execute an Initiate Glacier Restore call on each object in the manifest.

+ * + */ + S3InitiateRestoreObject?: S3InitiateRestoreObjectOperation; + + /** + * + *

Directs the specified job to execute a PUT Object acl call on each object in the manifest.

+ * + */ + S3PutObjectAcl?: S3SetObjectAclOperation; + + /** + * + *

Directs the specified job to execute a PUT Copy object call on each object in the manifest.

+ * + */ + S3PutObjectCopy?: S3CopyObjectOperation; + + /** + * + *

Directs the specified job to execute a PUT Object tagging call on each object in the manifest.

+ * + */ + S3PutObjectTagging?: S3SetObjectTaggingOperation; +} + +export namespace JobOperation { + export function isa(o: any): o is JobOperation { + return _smithy.isa(o, "JobOperation"); + } +} + +/** + * + *

Describes the total number of tasks that the specified job has executed, the number of tasks that succeeded, and the number of tasks that failed.

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

+ * + */ + NumberOfTasksFailed?: number; + + /** + * + *

+ * + */ + NumberOfTasksSucceeded?: number; + + /** + * + *

+ * + */ + TotalNumberOfTasks?: number; +} + +export namespace JobProgressSummary { + export function isa(o: any): o is JobProgressSummary { + return _smithy.isa(o, "JobProgressSummary"); + } +} + +/** + * + *

Contains the configuration parameters for a job-completion report.

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

The Amazon Resource Name (ARN) for the bucket where specified job-completion report will be stored.

+ * + */ + Bucket?: string; + + /** + * + *

Indicates whether the specified job will generate a job-completion report.

+ * + */ + Enabled: boolean | undefined; + + /** + * + *

The format of the specified job-completion report.

+ * + */ + Format?: JobReportFormat | string; + + /** + * + *

An optional prefix to describe where in the specified bucket the job-completion report will be stored. Amazon S3 will store the job-completion report at /job-/report.json.

+ * + */ + Prefix?: string; + + /** + * + *

Indicates whether the job-completion report will include details of all tasks or only failed tasks.

+ * + */ + ReportScope?: JobReportScope | string; +} + +export namespace JobReport { + export function isa(o: any): o is JobReport { + return _smithy.isa(o, "JobReport"); + } +} + +export enum JobReportFormat { + Report_CSV_20180820 = "Report_CSV_20180820" +} + +export enum JobReportScope { + AllTasks = "AllTasks", + FailedTasksOnly = "FailedTasksOnly" +} + +export enum JobStatus { + Active = "Active", + Cancelled = "Cancelled", + Cancelling = "Cancelling", + Complete = "Complete", + Completing = "Completing", + Failed = "Failed", + Failing = "Failing", + New = "New", + Paused = "Paused", + Pausing = "Pausing", + Preparing = "Preparing", + Ready = "Ready", + Suspended = "Suspended" +} + +/** + * + *

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

Contains the configuration parameters for a Lambda Invoke operation.

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

The Amazon Resource Name (ARN) for the AWS Lambda function that the specified job will invoke for each object in the manifest.

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

The AWS account ID for owner of the bucket whose access points you want to list.

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

The name of the bucket whose associated access points you want to list.

+ * + */ + Bucket?: string; + + /** + * + *

The maximum number of access points that you want to include in the list. If the specified bucket has more than this number of access points, then the response will include a continuation token in the NextToken field that you can use to retrieve the next page of access points.

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

A continuation token. If a previous call to ListAccessPoints returned a continuation token in the NextToken field, then providing that value here causes Amazon S3 to retrieve the next page of results.

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

Contains identification and configuration information for one or more access points associated with the specified bucket.

+ * + */ + AccessPointList?: Array; + + /** + * + *

If the specified bucket has more access points than can be returned in one call to this API, then this field contains a continuation token that you can provide in subsequent calls to this API to retrieve additional access points.

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

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

The List Jobs request returns jobs that match the statuses listed in this element.

+ * + */ + JobStatuses?: Array; + + /** + * + *

The maximum number of jobs that Amazon S3 will include in the List Jobs response. If there are more jobs than this number, the response will include a pagination token in the NextToken field to enable you to retrieve the next page of results.

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

A pagination token to request the next page of results. Use the token that Amazon S3 returned in the NextToken element of the ListJobsResult from the previous List Jobs request.

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

The list of current jobs and jobs that have ended within the last 30 days.

+ * + */ + Jobs?: Array; + + /** + * + *

If the List Jobs request produced more than the maximum number of results, you can pass this value into a subsequent List Jobs request in order to retrieve + * the next page of results.

+ * + */ + NextToken?: string; +} + +export namespace ListJobsResult { + export function isa(o: any): o is ListJobsResult { + return _smithy.isa(o, "ListJobsResult"); + } +} + +export enum NetworkOrigin { + Internet = "Internet", + VPC = "VPC" +} + +/** + * + *

Amazon S3 throws this exception if you make a GetPublicAccessBlock request + * against an account that doesn't have a PublicAccessBlockConfiguration set.

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

+ * + */ +export interface NotFoundException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "NotFoundException"; + name: "NotFoundException"; + $fault: "client"; + Message?: string; +} + +export namespace NotFoundException { + export function isa(o: any): o is NotFoundException { + return _smithy.isa(o, "NotFoundException"); + } +} + +export enum OperationName { + LambdaInvoke = "LambdaInvoke", + S3InitiateRestoreObject = "S3InitiateRestoreObject", + S3PutObjectAcl = "S3PutObjectAcl", + S3PutObjectCopy = "S3PutObjectCopy", + S3PutObjectTagging = "S3PutObjectTagging" +} + +/** + * + *

Indicates whether this access point policy is public. For more information about how Amazon S3 evaluates policies to determine whether they are public, see + * The Meaning of "Public" in the + * Amazon Simple Storage Service Developer Guide. + *

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

+ * + */ + IsPublic?: boolean; +} + +export namespace PolicyStatus { + export function isa(o: any): o is PolicyStatus { + return _smithy.isa(o, "PolicyStatus"); + } +} + +/** + * + *

The PublicAccessBlock configuration that you want to apply to this Amazon S3 + * bucket. You can enable the configuration options in any combination. For more information + * about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the Amazon Simple Storage Service Developer Guide.

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

Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in + * this account. Setting this element to TRUE causes the following behavior:

+ *
    + *
  • + *

    PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.

    + *
  • + *
  • + *

    PUT Object calls fail if the request includes a public ACL.

    + *
  • + *
  • + *

    PUT Bucket calls fail if the request includes a public ACL.

    + *
  • + *
+ *

Enabling this setting doesn't affect existing policies or ACLs.

+ * + */ + BlockPublicAcls?: boolean; + + /** + * + *

Specifies whether Amazon S3 should block public bucket policies for buckets in this account. + * Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket + * policy if the specified bucket policy allows public access.

+ *

Enabling this setting doesn't affect existing bucket policies.

+ * + */ + BlockPublicPolicy?: boolean; + + /** + * + *

Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. + * Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. + *

+ *

Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't + * prevent new public ACLs from being set.

+ * + */ + IgnorePublicAcls?: boolean; + + /** + * + *

Specifies whether Amazon S3 should restrict public bucket policies for buckets in this + * account. Setting this element to TRUE restricts access to buckets with public + * policies to only AWS services and authorized users within this account.

+ *

Enabling this setting doesn't affect previously stored bucket policies, except that public + * and cross-account access within any public bucket policy, including non-public delegation to + * specific accounts, is blocked.

+ * + */ + RestrictPublicBuckets?: boolean; +} + +export namespace PublicAccessBlockConfiguration { + export function isa(o: any): o is PublicAccessBlockConfiguration { + return _smithy.isa(o, "PublicAccessBlockConfiguration"); + } +} + +export interface PutAccessPointPolicyRequest { + __type?: "PutAccessPointPolicyRequest"; + /** + * + *

The AWS account ID for owner of the bucket associated with the specified access point.

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

The name of the access point that you want to associate with the specified policy.

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

The policy that you want to apply to the specified access point. For more information about access point policies, see Managing Data Access with Amazon S3 Access Points in the Amazon Simple Storage Service Developer Guide.

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

The account ID for the Amazon Web Services account whose PublicAccessBlock + * configuration you want to set.

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

The PublicAccessBlock configuration that you want to apply to the specified + * Amazon Web Services account.

+ * + */ + PublicAccessBlockConfiguration: PublicAccessBlockConfiguration | undefined; +} + +export namespace PutPublicAccessBlockRequest { + export function isa(o: any): o is PutPublicAccessBlockRequest { + return _smithy.isa(o, "PutPublicAccessBlockRequest"); + } +} + +export enum RequestedJobStatus { + Cancelled = "Cancelled", + Ready = "Ready" +} + +/** + * + *

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

+ * + */ + Grants?: Array; + + /** + * + *

+ * + */ + Owner: S3ObjectOwner | undefined; +} + +export namespace S3AccessControlList { + export function isa(o: any): o is S3AccessControlList { + return _smithy.isa(o, "S3AccessControlList"); + } +} + +/** + * + *

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

+ * + */ + AccessControlList?: S3AccessControlList; + + /** + * + *

+ * + */ + CannedAccessControlList?: S3CannedAccessControlList | string; +} + +export namespace S3AccessControlPolicy { + export function isa(o: any): o is S3AccessControlPolicy { + return _smithy.isa(o, "S3AccessControlPolicy"); + } +} + +export enum S3CannedAccessControlList { + AUTHENTICATED_READ = "authenticated-read", + AWS_EXEC_READ = "aws-exec-read", + BUCKET_OWNER_FULL_CONTROL = "bucket-owner-full-control", + BUCKET_OWNER_READ = "bucket-owner-read", + PRIVATE = "private", + PUBLIC_READ = "public-read", + PUBLIC_READ_WRITE = "public-read-write" +} + +/** + * + *

Contains the configuration parameters for a PUT Copy object operation. Amazon S3 batch operations passes each value through to the underlying PUT Copy object + * API. For more information about the parameters for this operation, see PUT Object - Copy.

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

+ * + */ + AccessControlGrants?: Array; + + /** + * + *

+ * + */ + CannedAccessControlList?: S3CannedAccessControlList | string; + + /** + * + *

+ * + */ + MetadataDirective?: S3MetadataDirective | string; + + /** + * + *

+ * + */ + ModifiedSinceConstraint?: Date; + + /** + * + *

+ * + */ + NewObjectMetadata?: S3ObjectMetadata; + + /** + * + *

+ * + */ + NewObjectTagging?: Array; + + /** + * + *

+ * + */ + ObjectLockLegalHoldStatus?: S3ObjectLockLegalHoldStatus | string; + + /** + * + *

+ * + */ + ObjectLockMode?: S3ObjectLockMode | string; + + /** + * + *

+ * + */ + ObjectLockRetainUntilDate?: Date; + + /** + * + *

+ * + */ + RedirectLocation?: string; + + /** + * + *

+ * + */ + RequesterPays?: boolean; + + /** + * + *

+ * + */ + SSEAwsKmsKeyId?: string; + + /** + * + *

+ * + */ + StorageClass?: S3StorageClass | string; + + /** + * + *

+ * + */ + TargetKeyPrefix?: string; + + /** + * + *

+ * + */ + TargetResource?: string; + + /** + * + *

+ * + */ + UnModifiedSinceConstraint?: Date; +} + +export namespace S3CopyObjectOperation { + export function isa(o: any): o is S3CopyObjectOperation { + return _smithy.isa(o, "S3CopyObjectOperation"); + } +} + +export enum S3GlacierJobTier { + BULK = "BULK", + STANDARD = "STANDARD" +} + +/** + * + *

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

+ * + */ + Grantee?: S3Grantee; + + /** + * + *

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

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

+ * + */ + DisplayName?: string; + + /** + * + *

+ * + */ + Identifier?: string; + + /** + * + *

+ * + */ + TypeIdentifier?: S3GranteeTypeIdentifier | string; +} + +export namespace S3Grantee { + export function isa(o: any): o is S3Grantee { + return _smithy.isa(o, "S3Grantee"); + } +} + +export enum S3GranteeTypeIdentifier { + CANONICAL = "id", + EMAIL_ADDRESS = "emailAddress", + GROUP = "uri" +} + +/** + * + *

Contains the configuration parameters for an Initiate Glacier Restore job. Amazon S3 batch operations passes each value through to the underlying POST Object restore API. + * For more information about the parameters for this operation, see Restoring Archives.

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

+ * + */ + ExpirationInDays?: number; + + /** + * + *

+ * + */ + GlacierJobTier?: S3GlacierJobTier | string; +} + +export namespace S3InitiateRestoreObjectOperation { + export function isa(o: any): o is S3InitiateRestoreObjectOperation { + return _smithy.isa(o, "S3InitiateRestoreObjectOperation"); + } +} + +export enum S3MetadataDirective { + COPY = "COPY", + REPLACE = "REPLACE" +} + +export enum S3ObjectLockLegalHoldStatus { + OFF = "OFF", + ON = "ON" +} + +export enum S3ObjectLockMode { + COMPLIANCE = "COMPLIANCE", + GOVERNANCE = "GOVERNANCE" +} + +/** + * + *

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

+ * + */ + CacheControl?: string; + + /** + * + *

+ * + */ + ContentDisposition?: string; + + /** + * + *

+ * + */ + ContentEncoding?: string; + + /** + * + *

+ * + */ + ContentLanguage?: string; + + /** + * + *

+ * + */ + ContentLength?: number; + + /** + * + *

+ * + */ + ContentMD5?: string; + + /** + * + *

+ * + */ + ContentType?: string; + + /** + * + *

+ * + */ + HttpExpiresDate?: Date; + + /** + * + *

+ * + */ + RequesterCharged?: boolean; + + /** + * + *

+ * + */ + SSEAlgorithm?: S3SSEAlgorithm | string; + + /** + * + *

+ * + */ + UserMetadata?: { [key: string]: string }; +} + +export namespace S3ObjectMetadata { + export function isa(o: any): o is S3ObjectMetadata { + return _smithy.isa(o, "S3ObjectMetadata"); + } +} + +/** + * + *

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

+ * + */ + DisplayName?: string; + + /** + * + *

+ * + */ + ID?: string; +} + +export namespace S3ObjectOwner { + export function isa(o: any): o is S3ObjectOwner { + return _smithy.isa(o, "S3ObjectOwner"); + } +} + +export enum S3Permission { + FULL_CONTROL = "FULL_CONTROL", + READ = "READ", + READ_ACP = "READ_ACP", + WRITE = "WRITE", + WRITE_ACP = "WRITE_ACP" +} + +export enum S3SSEAlgorithm { + AES256 = "AES256", + KMS = "KMS" +} + +/** + * + *

Contains the configuration parameters for a Set Object ACL operation. Amazon S3 batch operations passes each value through to the underlying PUT Object acl API. + * For more information about the parameters for this operation, see PUT Object acl.

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

+ * + */ + AccessControlPolicy?: S3AccessControlPolicy; +} + +export namespace S3SetObjectAclOperation { + export function isa(o: any): o is S3SetObjectAclOperation { + return _smithy.isa(o, "S3SetObjectAclOperation"); + } +} + +/** + * + *

Contains the configuration parameters for a Set Object Tagging operation. Amazon S3 batch operations passes each value through to the underlying PUT Object tagging API. + * For more information about the parameters for this operation, see PUT Object tagging.

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

+ * + */ + TagSet?: Array; +} + +export namespace S3SetObjectTaggingOperation { + export function isa(o: any): o is S3SetObjectTaggingOperation { + return _smithy.isa(o, "S3SetObjectTaggingOperation"); + } +} + +export enum S3StorageClass { + DEEP_ARCHIVE = "DEEP_ARCHIVE", + GLACIER = "GLACIER", + INTELLIGENT_TIERING = "INTELLIGENT_TIERING", + ONEZONE_IA = "ONEZONE_IA", + STANDARD = "STANDARD", + STANDARD_IA = "STANDARD_IA" +} + +/** + * + *

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

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

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

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

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

The ID for the job whose priority you want to update.

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

The priority you want to assign to this job.

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

The ID for the job whose priority Amazon S3 updated.

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

The new priority assigned to the specified job.

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

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

The ID of the job whose status you want to update.

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

The status that you want to move the specified job to.

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

A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length.

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

The ID for the job whose status was updated.

+ * + */ + JobId?: string; + + /** + * + *

The current status for the specified job.

+ * + */ + Status?: JobStatus | string; + + /** + * + *

The reason that the specified job's status was updated.

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

The Virtual Private Cloud (VPC) configuration for an access point.

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

If this field is specified, this access point will only allow connections from the specified VPC ID.

+ * + */ + VpcId: string | undefined; +} + +export namespace VpcConfiguration { + export function isa(o: any): o is VpcConfiguration { + return _smithy.isa(o, "VpcConfiguration"); + } +} diff --git a/clients/client-s3-control/package.json b/clients/client-s3-control/package.json new file mode 100644 index 000000000000..a7bfaf236fe7 --- /dev/null +++ b/clients/client-s3-control/package.json @@ -0,0 +1,78 @@ +{ + "name": "@aws-sdk/client-s3-control", + "description": "@aws-sdk/client-s3-control client", + "version": "1.0.0-alpha.0", + "scripts": { + "clean": "npm run remove-definitions && npm run remove-dist && npm run remove-js && npm run remove-maps", + "build-documentation": "npm run clean && typedoc ./", + "prepublishOnly": "yarn build", + "pretest": "tsc", + "remove-definitions": "rimraf ./types", + "remove-dist": "rimraf ./dist", + "remove-documentation": "rimraf ./docs", + "remove-js": "rimraf *.js && rimraf ./commands/*.js && rimraf ./models/*.js && rimraf ./protocols/*.js", + "remove-maps": "rimraf *.js.map && rimraf ./commands/*.js.map && rimraf ./models/*.js.map && rimraf ./protocols/*.js.map", + "test": "exit 0", + "smoke-test": "npm run pretest && node ./test/smoke/index.spec.js", + "build:es": "tsc -p tsconfig.es.json", + "build": "yarn pretest && yarn build:es" + }, + "main": "./dist/cjs/index.js", + "types": "./types/index.d.ts", + "module": "./dist/es/index.js", + "browser": { + "./runtimeConfig": "./runtimeConfig.browser" + }, + "sideEffects": false, + "dependencies": { + "tslib": "^1.8.0", + "@aws-crypto/sha256-browser": "^0.1.0-preview.1", + "@aws-sdk/config-resolver": "^1.0.0-alpha.1", + "@aws-sdk/credential-provider-node": "^1.0.0-alpha.0", + "@aws-sdk/fetch-http-handler": "^1.0.0-alpha.1", + "@aws-sdk/hash-node": "^1.0.0-alpha.1", + "@aws-sdk/invalid-dependency": "^1.0.0-alpha.1", + "@aws-sdk/middleware-content-length": "^1.0.0-alpha.1", + "@aws-sdk/middleware-host-header": "^1.0.0-alpha.0", + "@aws-sdk/middleware-retry": "^1.0.0-alpha.1", + "@aws-sdk/middleware-serde": "^1.0.0-alpha.1", + "@aws-sdk/middleware-signing": "^1.0.0-alpha.0", + "@aws-sdk/middleware-stack": "^1.0.0-alpha.1", + "@aws-sdk/middleware-user-agent": "^1.0.0-alpha.1", + "@aws-sdk/node-http-handler": "^1.0.0-alpha.1", + "@aws-sdk/protocol-http": "^1.0.0-alpha.1", + "@aws-sdk/region-provider": "^1.0.0-alpha.0", + "@aws-sdk/smithy-client": "^1.0.0-alpha.1", + "@aws-sdk/stream-collector-browser": "^1.0.0-alpha.1", + "@aws-sdk/stream-collector-node": "^1.0.0-alpha.1", + "@aws-sdk/types": "^1.0.0-alpha.1", + "@aws-sdk/url-parser-browser": "^1.0.0-alpha.1", + "@aws-sdk/url-parser-node": "^1.0.0-alpha.1", + "@aws-sdk/util-base64-browser": "^1.0.0-alpha.1", + "@aws-sdk/util-base64-node": "^1.0.0-alpha.1", + "@aws-sdk/util-body-length-browser": "^1.0.0-alpha.1", + "@aws-sdk/util-body-length-node": "^1.0.0-alpha.1", + "@aws-sdk/util-user-agent-browser": "^1.0.0-alpha.1", + "@aws-sdk/util-user-agent-node": "^1.0.0-alpha.1", + "@aws-sdk/util-utf8-browser": "^1.0.0-alpha.1", + "@aws-sdk/util-utf8-node": "^1.0.0-alpha.1", + "@aws-sdk/xml-builder": "^1.0.0-alpha.0", + "pixl-xml": "^1.0.13" + }, + "devDependencies": { + "rimraf": "^3.0.0", + "typedoc": "^0.15.0", + "typescript": "^3.6.3", + "@types/node": "^12.7.5", + "@types/pixl-xml": "^1.0.1", + "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-s3-control/protocols/Aws_restXml.ts b/clients/client-s3-control/protocols/Aws_restXml.ts new file mode 100644 index 000000000000..560d16d62fca --- /dev/null +++ b/clients/client-s3-control/protocols/Aws_restXml.ts @@ -0,0 +1,3209 @@ +import { + CreateAccessPointCommandInput, + CreateAccessPointCommandOutput +} from "../commands/CreateAccessPointCommand"; +import { + CreateJobCommandInput, + CreateJobCommandOutput +} from "../commands/CreateJobCommand"; +import { + DeleteAccessPointCommandInput, + DeleteAccessPointCommandOutput +} from "../commands/DeleteAccessPointCommand"; +import { + DeleteAccessPointPolicyCommandInput, + DeleteAccessPointPolicyCommandOutput +} from "../commands/DeleteAccessPointPolicyCommand"; +import { + DeletePublicAccessBlockCommandInput, + DeletePublicAccessBlockCommandOutput +} from "../commands/DeletePublicAccessBlockCommand"; +import { + DescribeJobCommandInput, + DescribeJobCommandOutput +} from "../commands/DescribeJobCommand"; +import { + GetAccessPointCommandInput, + GetAccessPointCommandOutput +} from "../commands/GetAccessPointCommand"; +import { + GetAccessPointPolicyCommandInput, + GetAccessPointPolicyCommandOutput +} from "../commands/GetAccessPointPolicyCommand"; +import { + GetAccessPointPolicyStatusCommandInput, + GetAccessPointPolicyStatusCommandOutput +} from "../commands/GetAccessPointPolicyStatusCommand"; +import { + GetPublicAccessBlockCommandInput, + GetPublicAccessBlockCommandOutput +} from "../commands/GetPublicAccessBlockCommand"; +import { + ListAccessPointsCommandInput, + ListAccessPointsCommandOutput +} from "../commands/ListAccessPointsCommand"; +import { + ListJobsCommandInput, + ListJobsCommandOutput +} from "../commands/ListJobsCommand"; +import { + PutAccessPointPolicyCommandInput, + PutAccessPointPolicyCommandOutput +} from "../commands/PutAccessPointPolicyCommand"; +import { + PutPublicAccessBlockCommandInput, + PutPublicAccessBlockCommandOutput +} from "../commands/PutPublicAccessBlockCommand"; +import { + UpdateJobPriorityCommandInput, + UpdateJobPriorityCommandOutput +} from "../commands/UpdateJobPriorityCommand"; +import { + UpdateJobStatusCommandInput, + UpdateJobStatusCommandOutput +} from "../commands/UpdateJobStatusCommand"; +import { + AccessPoint, + BadRequestException, + IdempotencyException, + InternalServiceException, + InvalidNextTokenException, + InvalidRequestException, + JobDescriptor, + JobFailure, + JobListDescriptor, + JobManifest, + JobManifestFieldName, + JobManifestLocation, + JobManifestSpec, + JobOperation, + JobProgressSummary, + JobReport, + JobStatusException, + LambdaInvokeOperation, + NoSuchPublicAccessBlockConfiguration, + NotFoundException, + PolicyStatus, + PublicAccessBlockConfiguration, + S3AccessControlList, + S3AccessControlPolicy, + S3CopyObjectOperation, + S3Grant, + S3Grantee, + S3InitiateRestoreObjectOperation, + S3ObjectMetadata, + S3ObjectOwner, + S3SetObjectAclOperation, + S3SetObjectTaggingOperation, + S3Tag, + TooManyRequestsException, + VpcConfiguration +} 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"; +import { + XmlNode as __XmlNode, + XmlText as __XmlText +} from "@aws-sdk/xml-builder"; +import { parse as pixlParse } from "pixl-xml"; + +export async function serializeAws_restXmlCreateAccessPointCommand( + input: CreateAccessPointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/xml"; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + let body: any = {}; + body = ''; + const bodyNode = new __XmlNode("CreateAccessPoint"); + bodyNode.addAttribute( + "xmlns", + "http://awss3control.amazonaws.com/doc/2018-08-20/" + ); + if (input.Bucket !== undefined) { + const memberNode = new __XmlNode("BucketName").addChildNode( + new __XmlText(input.Bucket) + ); + bodyNode.addChildNode(memberNode.withName("Bucket")); + } + if (input.PublicAccessBlockConfiguration !== undefined) { + const memberNode = serializeAws_restXmlPublicAccessBlockConfiguration( + input.PublicAccessBlockConfiguration, + context + ); + bodyNode.addChildNode( + memberNode.withName("PublicAccessBlockConfiguration") + ); + } + if (input.VpcConfiguration !== undefined) { + const memberNode = serializeAws_restXmlVpcConfiguration( + input.VpcConfiguration, + context + ); + bodyNode.addChildNode(memberNode.withName("VpcConfiguration")); + } + body += bodyNode.toString(); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PUT", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restXmlCreateJobCommand( + input: CreateJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/xml"; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/jobs"; + let body: any = {}; + body = ''; + const bodyNode = new __XmlNode("CreateJob"); + bodyNode.addAttribute( + "xmlns", + "http://awss3control.amazonaws.com/doc/2018-08-20/" + ); + if (input.ClientRequestToken !== undefined) { + const memberNode = new __XmlNode("NonEmptyMaxLength64String").addChildNode( + new __XmlText(input.ClientRequestToken) + ); + bodyNode.addChildNode(memberNode.withName("ClientRequestToken")); + } + if (input.ConfirmationRequired !== undefined) { + const memberNode = new __XmlNode("ConfirmationRequired").addChildNode( + new __XmlText(String(input.ConfirmationRequired)) + ); + bodyNode.addChildNode(memberNode.withName("ConfirmationRequired")); + } + if (input.Description !== undefined) { + const memberNode = new __XmlNode("NonEmptyMaxLength256String").addChildNode( + new __XmlText(input.Description) + ); + bodyNode.addChildNode(memberNode.withName("Description")); + } + if (input.Manifest !== undefined) { + const memberNode = serializeAws_restXmlJobManifest(input.Manifest, context); + bodyNode.addChildNode(memberNode.withName("Manifest")); + } + if (input.Operation !== undefined) { + const memberNode = serializeAws_restXmlJobOperation( + input.Operation, + context + ); + bodyNode.addChildNode(memberNode.withName("Operation")); + } + if (input.Priority !== undefined) { + const memberNode = new __XmlNode("JobPriority").addChildNode( + new __XmlText(String(input.Priority)) + ); + bodyNode.addChildNode(memberNode.withName("Priority")); + } + if (input.Report !== undefined) { + const memberNode = serializeAws_restXmlJobReport(input.Report, context); + bodyNode.addChildNode(memberNode.withName("Report")); + } + if (input.RoleArn !== undefined) { + const memberNode = new __XmlNode("IAMRoleArn").addChildNode( + new __XmlText(input.RoleArn) + ); + bodyNode.addChildNode(memberNode.withName("RoleArn")); + } + body += bodyNode.toString(); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restXmlDeleteAccessPointCommand( + input: DeleteAccessPointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlDeleteAccessPointPolicyCommand( + input: DeleteAccessPointPolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlDeletePublicAccessBlockCommand( + input: DeletePublicAccessBlockCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/configuration/publicAccessBlock"; + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "DELETE", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlDescribeJobCommand( + input: DescribeJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/jobs/{JobId}"; + if (input.JobId !== undefined) { + const labelValue: any = input.JobId.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: JobId."); + } + resolvedPath = resolvedPath.replace("{JobId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: JobId."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlGetAccessPointCommand( + input: GetAccessPointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlGetAccessPointPolicyCommand( + input: GetAccessPointPolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlGetAccessPointPolicyStatusCommand( + input: GetAccessPointPolicyStatusCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}/policyStatus"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlGetPublicAccessBlockCommand( + input: GetPublicAccessBlockCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/configuration/publicAccessBlock"; + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath + }); +} + +export async function serializeAws_restXmlListAccessPointsCommand( + input: ListAccessPointsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint"; + const query: any = {}; + if (input.Bucket !== undefined) { + query["bucket"] = input.Bucket.toString(); + } + if (input.MaxResults !== undefined) { + query["maxResults"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["nextToken"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restXmlListJobsCommand( + input: ListJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/jobs"; + const query: any = {}; + if (input.JobStatuses !== undefined) { + query["jobStatuses"] = input.JobStatuses; + } + if (input.MaxResults !== undefined) { + query["maxResults"] = input.MaxResults.toString(); + } + if (input.NextToken !== undefined) { + query["nextToken"] = input.NextToken.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "GET", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restXmlPutAccessPointPolicyCommand( + input: PutAccessPointPolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/xml"; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; + if (input.Name !== undefined) { + const labelValue: any = input.Name.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: Name."); + } + resolvedPath = resolvedPath.replace("{Name}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: Name."); + } + let body: any = {}; + body = ''; + const bodyNode = new __XmlNode("PutAccessPointPolicy"); + bodyNode.addAttribute( + "xmlns", + "http://awss3control.amazonaws.com/doc/2018-08-20/" + ); + if (input.Policy !== undefined) { + const memberNode = new __XmlNode("Policy").addChildNode( + new __XmlText(input.Policy) + ); + bodyNode.addChildNode(memberNode.withName("Policy")); + } + body += bodyNode.toString(); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PUT", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restXmlPutPublicAccessBlockCommand( + input: PutPublicAccessBlockCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/xml"; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/configuration/publicAccessBlock"; + let body: any = {}; + let contents: any; + if (input.PublicAccessBlockConfiguration !== undefined) { + contents = serializeAws_restXmlPublicAccessBlockConfiguration( + input.PublicAccessBlockConfiguration, + context + ); + body = ''; + contents.addAttribute( + "xmlns", + "http://awss3control.amazonaws.com/doc/2018-08-20/" + ); + body += contents.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "PUT", + headers: headers, + path: resolvedPath, + body: body + }); +} + +export async function serializeAws_restXmlUpdateJobPriorityCommand( + input: UpdateJobPriorityCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/jobs/{JobId}/priority"; + if (input.JobId !== undefined) { + const labelValue: any = input.JobId.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: JobId."); + } + resolvedPath = resolvedPath.replace("{JobId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: JobId."); + } + const query: any = {}; + if (input.Priority !== undefined) { + query["priority"] = input.Priority.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function serializeAws_restXmlUpdateJobStatusCommand( + input: UpdateJobStatusCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = ""; + if (input.AccountId !== undefined) { + headers["x-amz-account-id"] = input.AccountId.toString(); + } + let resolvedPath = "/v20180820/jobs/{JobId}/status"; + if (input.JobId !== undefined) { + const labelValue: any = input.JobId.toString(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: JobId."); + } + resolvedPath = resolvedPath.replace("{JobId}", labelValue); + } else { + throw new Error("No value provided for input HTTP label: JobId."); + } + const query: any = {}; + if (input.RequestedJobStatus !== undefined) { + query["requestedJobStatus"] = input.RequestedJobStatus.toString(); + } + if (input.StatusUpdateReason !== undefined) { + query["statusUpdateReason"] = input.StatusUpdateReason.toString(); + } + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + headers: headers, + path: resolvedPath, + query: query + }); +} + +export async function deserializeAws_restXmlCreateAccessPointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlCreateAccessPointCommandError(output, context); + } + const contents: CreateAccessPointCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlCreateAccessPointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlCreateJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlCreateJobCommandError(output, context); + } + const contents: CreateJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "CreateJobResult", + JobId: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["JobId"] !== undefined) { + contents.JobId = data["JobId"]; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlCreateJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.awss3control.v20180820#BadRequestException": + response = await deserializeAws_restXmlBadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "IdempotencyException": + case "com.amazonaws.awss3control.v20180820#IdempotencyException": + response = await deserializeAws_restXmlIdempotencyExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.awss3control.v20180820#InternalServiceException": + response = await deserializeAws_restXmlInternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.awss3control.v20180820#TooManyRequestsException": + response = await deserializeAws_restXmlTooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlDeleteAccessPointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlDeleteAccessPointCommandError(output, context); + } + const contents: DeleteAccessPointCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlDeleteAccessPointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlDeleteAccessPointPolicyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlDeleteAccessPointPolicyCommandError( + output, + context + ); + } + const contents: DeleteAccessPointPolicyCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlDeleteAccessPointPolicyCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlDeletePublicAccessBlockCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlDeletePublicAccessBlockCommandError( + output, + context + ); + } + const contents: DeletePublicAccessBlockCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlDeletePublicAccessBlockCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlDescribeJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlDescribeJobCommandError(output, context); + } + const contents: DescribeJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeJobResult", + Job: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["Job"] !== undefined) { + contents.Job = deserializeAws_restXmlJobDescriptor(data["Job"], context); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlDescribeJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.awss3control.v20180820#BadRequestException": + response = await deserializeAws_restXmlBadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.awss3control.v20180820#InternalServiceException": + response = await deserializeAws_restXmlInternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "NotFoundException": + case "com.amazonaws.awss3control.v20180820#NotFoundException": + response = await deserializeAws_restXmlNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.awss3control.v20180820#TooManyRequestsException": + response = await deserializeAws_restXmlTooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlGetAccessPointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlGetAccessPointCommandError(output, context); + } + const contents: GetAccessPointCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "GetAccessPointResult", + Bucket: undefined, + CreationDate: undefined, + Name: undefined, + NetworkOrigin: undefined, + PublicAccessBlockConfiguration: undefined, + VpcConfiguration: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["Bucket"] !== undefined) { + contents.Bucket = data["Bucket"]; + } + if (data["CreationDate"] !== undefined) { + contents.CreationDate = new Date(data["CreationDate"]); + } + if (data["Name"] !== undefined) { + contents.Name = data["Name"]; + } + if (data["NetworkOrigin"] !== undefined) { + contents.NetworkOrigin = data["NetworkOrigin"]; + } + if (data["PublicAccessBlockConfiguration"] !== undefined) { + contents.PublicAccessBlockConfiguration = deserializeAws_restXmlPublicAccessBlockConfiguration( + data["PublicAccessBlockConfiguration"], + context + ); + } + if (data["VpcConfiguration"] !== undefined) { + contents.VpcConfiguration = deserializeAws_restXmlVpcConfiguration( + data["VpcConfiguration"], + context + ); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlGetAccessPointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlGetAccessPointPolicyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlGetAccessPointPolicyCommandError( + output, + context + ); + } + const contents: GetAccessPointPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "GetAccessPointPolicyResult", + Policy: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["Policy"] !== undefined) { + contents.Policy = data["Policy"]; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlGetAccessPointPolicyCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlGetAccessPointPolicyStatusCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlGetAccessPointPolicyStatusCommandError( + output, + context + ); + } + const contents: GetAccessPointPolicyStatusCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "GetAccessPointPolicyStatusResult", + PolicyStatus: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["PolicyStatus"] !== undefined) { + contents.PolicyStatus = deserializeAws_restXmlPolicyStatus( + data["PolicyStatus"], + context + ); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlGetAccessPointPolicyStatusCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlGetPublicAccessBlockCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlGetPublicAccessBlockCommandError( + output, + context + ); + } + const contents: GetPublicAccessBlockCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "GetPublicAccessBlockOutput", + PublicAccessBlockConfiguration: undefined + }; + const data: any = await parseBody(output.body, context); + contents.PublicAccessBlockConfiguration = deserializeAws_restXmlPublicAccessBlockConfiguration( + data, + context + ); + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlGetPublicAccessBlockCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "NoSuchPublicAccessBlockConfiguration": + case "com.amazonaws.awss3control.v20180820#NoSuchPublicAccessBlockConfiguration": + response = await deserializeAws_restXmlNoSuchPublicAccessBlockConfigurationResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlListAccessPointsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlListAccessPointsCommandError(output, context); + } + const contents: ListAccessPointsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListAccessPointsResult", + AccessPointList: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["AccessPointList"]["AccessPoint"] !== undefined) { + contents.AccessPointList = deserializeAws_restXmlAccessPointList( + data["AccessPointList"]["AccessPoint"], + context + ); + } + if (data["NextToken"] !== undefined) { + contents.NextToken = data["NextToken"]; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlListAccessPointsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlListJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlListJobsCommandError(output, context); + } + const contents: ListJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListJobsResult", + Jobs: undefined, + NextToken: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["Jobs"]["member"] !== undefined) { + contents.Jobs = deserializeAws_restXmlJobListDescriptorList( + data["Jobs"]["member"], + context + ); + } + if (data["NextToken"] !== undefined) { + contents.NextToken = data["NextToken"]; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlListJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServiceException": + case "com.amazonaws.awss3control.v20180820#InternalServiceException": + response = await deserializeAws_restXmlInternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidNextTokenException": + case "com.amazonaws.awss3control.v20180820#InvalidNextTokenException": + response = await deserializeAws_restXmlInvalidNextTokenExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.awss3control.v20180820#InvalidRequestException": + response = await deserializeAws_restXmlInvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlPutAccessPointPolicyCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlPutAccessPointPolicyCommandError( + output, + context + ); + } + const contents: PutAccessPointPolicyCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlPutAccessPointPolicyCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlPutPublicAccessBlockCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlPutPublicAccessBlockCommandError( + output, + context + ); + } + const contents: PutPublicAccessBlockCommandOutput = { + $metadata: deserializeMetadata(output) + }; + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlPutPublicAccessBlockCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlUpdateJobPriorityCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlUpdateJobPriorityCommandError(output, context); + } + const contents: UpdateJobPriorityCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "UpdateJobPriorityResult", + JobId: undefined, + Priority: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["JobId"] !== undefined) { + contents.JobId = data["JobId"]; + } + if (data["Priority"] !== undefined) { + contents.Priority = parseInt(data["Priority"]); + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlUpdateJobPriorityCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.awss3control.v20180820#BadRequestException": + response = await deserializeAws_restXmlBadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.awss3control.v20180820#InternalServiceException": + response = await deserializeAws_restXmlInternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "NotFoundException": + case "com.amazonaws.awss3control.v20180820#NotFoundException": + response = await deserializeAws_restXmlNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.awss3control.v20180820#TooManyRequestsException": + response = await deserializeAws_restXmlTooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +export async function deserializeAws_restXmlUpdateJobStatusCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode !== 200 && output.statusCode >= 400) { + return deserializeAws_restXmlUpdateJobStatusCommandError(output, context); + } + const contents: UpdateJobStatusCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "UpdateJobStatusResult", + JobId: undefined, + Status: undefined, + StatusUpdateReason: undefined + }; + const data: any = await parseBody(output.body, context); + if (data["JobId"] !== undefined) { + contents.JobId = data["JobId"]; + } + if (data["Status"] !== undefined) { + contents.Status = data["Status"]; + } + if (data["StatusUpdateReason"] !== undefined) { + contents.StatusUpdateReason = data["StatusUpdateReason"]; + } + return Promise.resolve(contents); +} + +async function deserializeAws_restXmlUpdateJobStatusCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context) + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String = "UnknownError"; + errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.awss3control.v20180820#BadRequestException": + response = await deserializeAws_restXmlBadRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.awss3control.v20180820#InternalServiceException": + response = await deserializeAws_restXmlInternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "JobStatusException": + case "com.amazonaws.awss3control.v20180820#JobStatusException": + response = await deserializeAws_restXmlJobStatusExceptionResponse( + parsedOutput, + context + ); + break; + case "NotFoundException": + case "com.amazonaws.awss3control.v20180820#NotFoundException": + response = await deserializeAws_restXmlNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.awss3control.v20180820#TooManyRequestsException": + response = await deserializeAws_restXmlTooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + const parsedBody = parsedOutput.body; + errorCode = errorCode || "UnknownError"; + response = { + ...parsedBody, + name: `${errorCode}`, + message: parsedBody.message || parsedBody.Message || errorCode, + __type: `com.amazonaws.awss3control.v20180820#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + } as any; + } + return Promise.reject(Object.assign(new Error(), response)); +} + +const deserializeAws_restXmlBadRequestExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: BadRequestException = { + name: "BadRequestException", + __type: "BadRequestException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlIdempotencyExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: IdempotencyException = { + name: "IdempotencyException", + __type: "IdempotencyException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlInternalServiceExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: InternalServiceException = { + name: "InternalServiceException", + __type: "InternalServiceException", + $fault: "server", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlInvalidNextTokenExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: InvalidNextTokenException = { + name: "InvalidNextTokenException", + __type: "InvalidNextTokenException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlInvalidRequestExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: InvalidRequestException = { + name: "InvalidRequestException", + __type: "InvalidRequestException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlJobStatusExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: JobStatusException = { + name: "JobStatusException", + __type: "JobStatusException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlNoSuchPublicAccessBlockConfigurationResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: NoSuchPublicAccessBlockConfiguration = { + name: "NoSuchPublicAccessBlockConfiguration", + __type: "NoSuchPublicAccessBlockConfiguration", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlNotFoundExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: NotFoundException = { + name: "NotFoundException", + __type: "NotFoundException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const deserializeAws_restXmlTooManyRequestsExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: TooManyRequestsException = { + name: "TooManyRequestsException", + __type: "TooManyRequestsException", + $fault: "client", + $metadata: deserializeMetadata(parsedOutput), + Message: undefined + }; + const data: any = parsedOutput.body; + return contents; +}; + +const serializeAws_restXmlJobManifest = ( + input: JobManifest, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("JobManifest"); + if (input.Location !== undefined) { + const memberNode = serializeAws_restXmlJobManifestLocation( + input.Location, + context + ); + bodyNode.addChildNode(memberNode.withName("Location")); + } + if (input.Spec !== undefined) { + const memberNode = serializeAws_restXmlJobManifestSpec(input.Spec, context); + bodyNode.addChildNode(memberNode.withName("Spec")); + } + return bodyNode; +}; + +const serializeAws_restXmlJobManifestFieldList = ( + input: Array, + context: __SerdeContext +): any => { + const collectedNodes: any = []; + (input || []).map(entry => { + const node = new __XmlNode("JobManifestFieldName").addChildNode( + new __XmlText(entry) + ); + collectedNodes.push(node.withName("member")); + }); + return collectedNodes; +}; + +const serializeAws_restXmlJobManifestLocation = ( + input: JobManifestLocation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("JobManifestLocation"); + if (input.ETag !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ETag)); + bodyNode.addChildNode(memberNode.withName("ETag")); + } + if (input.ObjectArn !== undefined) { + const memberNode = new __XmlNode("S3KeyArnString").addChildNode( + new __XmlText(input.ObjectArn) + ); + bodyNode.addChildNode(memberNode.withName("ObjectArn")); + } + if (input.ObjectVersionId !== undefined) { + const memberNode = new __XmlNode("S3ObjectVersionId").addChildNode( + new __XmlText(input.ObjectVersionId) + ); + bodyNode.addChildNode(memberNode.withName("ObjectVersionId")); + } + return bodyNode; +}; + +const serializeAws_restXmlJobManifestSpec = ( + input: JobManifestSpec, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("JobManifestSpec"); + if (input.Fields !== undefined) { + const nodes = serializeAws_restXmlJobManifestFieldList( + input.Fields, + context + ); + const containerNode = new __XmlNode("Fields"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + if (input.Format !== undefined) { + const memberNode = new __XmlNode("JobManifestFormat").addChildNode( + new __XmlText(input.Format) + ); + bodyNode.addChildNode(memberNode.withName("Format")); + } + return bodyNode; +}; + +const serializeAws_restXmlJobOperation = ( + input: JobOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("JobOperation"); + if (input.LambdaInvoke !== undefined) { + const memberNode = serializeAws_restXmlLambdaInvokeOperation( + input.LambdaInvoke, + context + ); + bodyNode.addChildNode(memberNode.withName("LambdaInvoke")); + } + if (input.S3InitiateRestoreObject !== undefined) { + const memberNode = serializeAws_restXmlS3InitiateRestoreObjectOperation( + input.S3InitiateRestoreObject, + context + ); + bodyNode.addChildNode(memberNode.withName("S3InitiateRestoreObject")); + } + if (input.S3PutObjectAcl !== undefined) { + const memberNode = serializeAws_restXmlS3SetObjectAclOperation( + input.S3PutObjectAcl, + context + ); + bodyNode.addChildNode(memberNode.withName("S3PutObjectAcl")); + } + if (input.S3PutObjectCopy !== undefined) { + const memberNode = serializeAws_restXmlS3CopyObjectOperation( + input.S3PutObjectCopy, + context + ); + bodyNode.addChildNode(memberNode.withName("S3PutObjectCopy")); + } + if (input.S3PutObjectTagging !== undefined) { + const memberNode = serializeAws_restXmlS3SetObjectTaggingOperation( + input.S3PutObjectTagging, + context + ); + bodyNode.addChildNode(memberNode.withName("S3PutObjectTagging")); + } + return bodyNode; +}; + +const serializeAws_restXmlJobReport = ( + input: JobReport, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("JobReport"); + if (input.Bucket !== undefined) { + const memberNode = new __XmlNode("S3BucketArnString").addChildNode( + new __XmlText(input.Bucket) + ); + bodyNode.addChildNode(memberNode.withName("Bucket")); + } + if (input.Enabled !== undefined) { + const memberNode = new __XmlNode("Boolean").addChildNode( + new __XmlText(String(input.Enabled)) + ); + bodyNode.addChildNode(memberNode.withName("Enabled")); + } + if (input.Format !== undefined) { + const memberNode = new __XmlNode("JobReportFormat").addChildNode( + new __XmlText(input.Format) + ); + bodyNode.addChildNode(memberNode.withName("Format")); + } + if (input.Prefix !== undefined) { + const memberNode = new __XmlNode("ReportPrefixString").addChildNode( + new __XmlText(input.Prefix) + ); + bodyNode.addChildNode(memberNode.withName("Prefix")); + } + if (input.ReportScope !== undefined) { + const memberNode = new __XmlNode("JobReportScope").addChildNode( + new __XmlText(input.ReportScope) + ); + bodyNode.addChildNode(memberNode.withName("ReportScope")); + } + return bodyNode; +}; + +const serializeAws_restXmlLambdaInvokeOperation = ( + input: LambdaInvokeOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("LambdaInvokeOperation"); + if (input.FunctionArn !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.FunctionArn)); + bodyNode.addChildNode(memberNode.withName("FunctionArn")); + } + return bodyNode; +}; + +const serializeAws_restXmlPublicAccessBlockConfiguration = ( + input: PublicAccessBlockConfiguration, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("PublicAccessBlockConfiguration"); + if (input.BlockPublicAcls !== undefined) { + const memberNode = new __XmlNode("Setting").addChildNode( + new __XmlText(String(input.BlockPublicAcls)) + ); + bodyNode.addChildNode(memberNode.withName("BlockPublicAcls")); + } + if (input.BlockPublicPolicy !== undefined) { + const memberNode = new __XmlNode("Setting").addChildNode( + new __XmlText(String(input.BlockPublicPolicy)) + ); + bodyNode.addChildNode(memberNode.withName("BlockPublicPolicy")); + } + if (input.IgnorePublicAcls !== undefined) { + const memberNode = new __XmlNode("Setting").addChildNode( + new __XmlText(String(input.IgnorePublicAcls)) + ); + bodyNode.addChildNode(memberNode.withName("IgnorePublicAcls")); + } + if (input.RestrictPublicBuckets !== undefined) { + const memberNode = new __XmlNode("Setting").addChildNode( + new __XmlText(String(input.RestrictPublicBuckets)) + ); + bodyNode.addChildNode(memberNode.withName("RestrictPublicBuckets")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3AccessControlList = ( + input: S3AccessControlList, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3AccessControlList"); + if (input.Grants !== undefined) { + const nodes = serializeAws_restXmlS3GrantList(input.Grants, context); + const containerNode = new __XmlNode("Grants"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + if (input.Owner !== undefined) { + const memberNode = serializeAws_restXmlS3ObjectOwner(input.Owner, context); + bodyNode.addChildNode(memberNode.withName("Owner")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3AccessControlPolicy = ( + input: S3AccessControlPolicy, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3AccessControlPolicy"); + if (input.AccessControlList !== undefined) { + const memberNode = serializeAws_restXmlS3AccessControlList( + input.AccessControlList, + context + ); + bodyNode.addChildNode(memberNode.withName("AccessControlList")); + } + if (input.CannedAccessControlList !== undefined) { + const memberNode = new __XmlNode("S3CannedAccessControlList").addChildNode( + new __XmlText(input.CannedAccessControlList) + ); + bodyNode.addChildNode(memberNode.withName("CannedAccessControlList")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3CopyObjectOperation = ( + input: S3CopyObjectOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3CopyObjectOperation"); + if (input.AccessControlGrants !== undefined) { + const nodes = serializeAws_restXmlS3GrantList( + input.AccessControlGrants, + context + ); + const containerNode = new __XmlNode("AccessControlGrants"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + if (input.CannedAccessControlList !== undefined) { + const memberNode = new __XmlNode("S3CannedAccessControlList").addChildNode( + new __XmlText(input.CannedAccessControlList) + ); + bodyNode.addChildNode(memberNode.withName("CannedAccessControlList")); + } + if (input.MetadataDirective !== undefined) { + const memberNode = new __XmlNode("S3MetadataDirective").addChildNode( + new __XmlText(input.MetadataDirective) + ); + bodyNode.addChildNode(memberNode.withName("MetadataDirective")); + } + if (input.ModifiedSinceConstraint !== undefined) { + const memberNode = new __XmlNode("TimeStamp").addChildNode( + new __XmlText(input.ModifiedSinceConstraint.toISOString()) + ); + bodyNode.addChildNode(memberNode.withName("ModifiedSinceConstraint")); + } + if (input.NewObjectMetadata !== undefined) { + const memberNode = serializeAws_restXmlS3ObjectMetadata( + input.NewObjectMetadata, + context + ); + bodyNode.addChildNode(memberNode.withName("NewObjectMetadata")); + } + if (input.NewObjectTagging !== undefined) { + const nodes = serializeAws_restXmlS3TagSet(input.NewObjectTagging, context); + const containerNode = new __XmlNode("NewObjectTagging"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + if (input.ObjectLockLegalHoldStatus !== undefined) { + const memberNode = new __XmlNode( + "S3ObjectLockLegalHoldStatus" + ).addChildNode(new __XmlText(input.ObjectLockLegalHoldStatus)); + bodyNode.addChildNode(memberNode.withName("ObjectLockLegalHoldStatus")); + } + if (input.ObjectLockMode !== undefined) { + const memberNode = new __XmlNode("S3ObjectLockMode").addChildNode( + new __XmlText(input.ObjectLockMode) + ); + bodyNode.addChildNode(memberNode.withName("ObjectLockMode")); + } + if (input.ObjectLockRetainUntilDate !== undefined) { + const memberNode = new __XmlNode("TimeStamp").addChildNode( + new __XmlText(input.ObjectLockRetainUntilDate.toISOString()) + ); + bodyNode.addChildNode(memberNode.withName("ObjectLockRetainUntilDate")); + } + if (input.RedirectLocation !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength2048String" + ).addChildNode(new __XmlText(input.RedirectLocation)); + bodyNode.addChildNode(memberNode.withName("RedirectLocation")); + } + if (input.RequesterPays !== undefined) { + const memberNode = new __XmlNode("Boolean").addChildNode( + new __XmlText(String(input.RequesterPays)) + ); + bodyNode.addChildNode(memberNode.withName("RequesterPays")); + } + if (input.SSEAwsKmsKeyId !== undefined) { + const memberNode = new __XmlNode("KmsKeyArnString").addChildNode( + new __XmlText(input.SSEAwsKmsKeyId) + ); + bodyNode.addChildNode(memberNode.withName("SSEAwsKmsKeyId")); + } + if (input.StorageClass !== undefined) { + const memberNode = new __XmlNode("S3StorageClass").addChildNode( + new __XmlText(input.StorageClass) + ); + bodyNode.addChildNode(memberNode.withName("StorageClass")); + } + if (input.TargetKeyPrefix !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.TargetKeyPrefix)); + bodyNode.addChildNode(memberNode.withName("TargetKeyPrefix")); + } + if (input.TargetResource !== undefined) { + const memberNode = new __XmlNode("S3BucketArnString").addChildNode( + new __XmlText(input.TargetResource) + ); + bodyNode.addChildNode(memberNode.withName("TargetResource")); + } + if (input.UnModifiedSinceConstraint !== undefined) { + const memberNode = new __XmlNode("TimeStamp").addChildNode( + new __XmlText(input.UnModifiedSinceConstraint.toISOString()) + ); + bodyNode.addChildNode(memberNode.withName("UnModifiedSinceConstraint")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3Grant = ( + input: S3Grant, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3Grant"); + if (input.Grantee !== undefined) { + const memberNode = serializeAws_restXmlS3Grantee(input.Grantee, context); + bodyNode.addChildNode(memberNode.withName("Grantee")); + } + if (input.Permission !== undefined) { + const memberNode = new __XmlNode("S3Permission").addChildNode( + new __XmlText(input.Permission) + ); + bodyNode.addChildNode(memberNode.withName("Permission")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3GrantList = ( + input: Array, + context: __SerdeContext +): any => { + const collectedNodes: any = []; + (input || []).map(entry => { + const node = serializeAws_restXmlS3Grant(entry, context); + collectedNodes.push(node.withName("member")); + }); + return collectedNodes; +}; + +const serializeAws_restXmlS3Grantee = ( + input: S3Grantee, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3Grantee"); + if (input.DisplayName !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.DisplayName)); + bodyNode.addChildNode(memberNode.withName("DisplayName")); + } + if (input.Identifier !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.Identifier)); + bodyNode.addChildNode(memberNode.withName("Identifier")); + } + if (input.TypeIdentifier !== undefined) { + const memberNode = new __XmlNode("S3GranteeTypeIdentifier").addChildNode( + new __XmlText(input.TypeIdentifier) + ); + bodyNode.addChildNode(memberNode.withName("TypeIdentifier")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3InitiateRestoreObjectOperation = ( + input: S3InitiateRestoreObjectOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3InitiateRestoreObjectOperation"); + if (input.ExpirationInDays !== undefined) { + const memberNode = new __XmlNode("S3ExpirationInDays").addChildNode( + new __XmlText(String(input.ExpirationInDays)) + ); + bodyNode.addChildNode(memberNode.withName("ExpirationInDays")); + } + if (input.GlacierJobTier !== undefined) { + const memberNode = new __XmlNode("S3GlacierJobTier").addChildNode( + new __XmlText(input.GlacierJobTier) + ); + bodyNode.addChildNode(memberNode.withName("GlacierJobTier")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3ObjectMetadata = ( + input: S3ObjectMetadata, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3ObjectMetadata"); + if (input.CacheControl !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.CacheControl)); + bodyNode.addChildNode(memberNode.withName("CacheControl")); + } + if (input.ContentDisposition !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ContentDisposition)); + bodyNode.addChildNode(memberNode.withName("ContentDisposition")); + } + if (input.ContentEncoding !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ContentEncoding)); + bodyNode.addChildNode(memberNode.withName("ContentEncoding")); + } + if (input.ContentLanguage !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ContentLanguage)); + bodyNode.addChildNode(memberNode.withName("ContentLanguage")); + } + if (input.ContentLength !== undefined) { + const memberNode = new __XmlNode("S3ContentLength").addChildNode( + new __XmlText(String(input.ContentLength)) + ); + bodyNode.addChildNode(memberNode.withName("ContentLength")); + } + if (input.ContentMD5 !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ContentMD5)); + bodyNode.addChildNode(memberNode.withName("ContentMD5")); + } + if (input.ContentType !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ContentType)); + bodyNode.addChildNode(memberNode.withName("ContentType")); + } + if (input.HttpExpiresDate !== undefined) { + const memberNode = new __XmlNode("TimeStamp").addChildNode( + new __XmlText(input.HttpExpiresDate.toISOString()) + ); + bodyNode.addChildNode(memberNode.withName("HttpExpiresDate")); + } + if (input.RequesterCharged !== undefined) { + const memberNode = new __XmlNode("Boolean").addChildNode( + new __XmlText(String(input.RequesterCharged)) + ); + bodyNode.addChildNode(memberNode.withName("RequesterCharged")); + } + if (input.SSEAlgorithm !== undefined) { + const memberNode = new __XmlNode("S3SSEAlgorithm").addChildNode( + new __XmlText(input.SSEAlgorithm) + ); + bodyNode.addChildNode(memberNode.withName("SSEAlgorithm")); + } + if (input.UserMetadata !== undefined) { + const nodes = serializeAws_restXmlS3UserMetadata( + input.UserMetadata, + context + ); + const containerNode = new __XmlNode("UserMetadata"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + return bodyNode; +}; + +const serializeAws_restXmlS3ObjectOwner = ( + input: S3ObjectOwner, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3ObjectOwner"); + if (input.DisplayName !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.DisplayName)); + bodyNode.addChildNode(memberNode.withName("DisplayName")); + } + if (input.ID !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.ID)); + bodyNode.addChildNode(memberNode.withName("ID")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3SetObjectAclOperation = ( + input: S3SetObjectAclOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3SetObjectAclOperation"); + if (input.AccessControlPolicy !== undefined) { + const memberNode = serializeAws_restXmlS3AccessControlPolicy( + input.AccessControlPolicy, + context + ); + bodyNode.addChildNode(memberNode.withName("AccessControlPolicy")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3SetObjectTaggingOperation = ( + input: S3SetObjectTaggingOperation, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3SetObjectTaggingOperation"); + if (input.TagSet !== undefined) { + const nodes = serializeAws_restXmlS3TagSet(input.TagSet, context); + const containerNode = new __XmlNode("TagSet"); + nodes.map((node: any) => { + containerNode.addChildNode(node); + }); + bodyNode.addChildNode(containerNode); + } + return bodyNode; +}; + +const serializeAws_restXmlS3Tag = ( + input: S3Tag, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("S3Tag"); + if (input.Key !== undefined) { + const memberNode = new __XmlNode( + "NonEmptyMaxLength1024String" + ).addChildNode(new __XmlText(input.Key)); + bodyNode.addChildNode(memberNode.withName("Key")); + } + if (input.Value !== undefined) { + const memberNode = new __XmlNode("MaxLength1024String").addChildNode( + new __XmlText(input.Value) + ); + bodyNode.addChildNode(memberNode.withName("Value")); + } + return bodyNode; +}; + +const serializeAws_restXmlS3TagSet = ( + input: Array, + context: __SerdeContext +): any => { + const collectedNodes: any = []; + (input || []).map(entry => { + const node = serializeAws_restXmlS3Tag(entry, context); + collectedNodes.push(node.withName("member")); + }); + return collectedNodes; +}; + +const serializeAws_restXmlS3UserMetadata = ( + input: { [key: string]: string }, + context: __SerdeContext +): any => { + const collectedNodes: any = []; + Object.keys(input).forEach(key => { + const entryNode = new __XmlNode("entry"); + const keyNode = new __XmlNode("key"); + keyNode.addChildNode( + new __XmlNode("NonEmptyMaxLength1024String").addChildNode( + new __XmlText(key) + ) + ); + entryNode.addChildNode(keyNode); + const valueNode = new __XmlNode("value"); + valueNode.addChildNode( + new __XmlNode("MaxLength1024String").addChildNode( + new __XmlText(input[key]) + ) + ); + entryNode.addChildNode(valueNode); + collectedNodes.push(entryNode); + }); + return collectedNodes; +}; + +const serializeAws_restXmlVpcConfiguration = ( + input: VpcConfiguration, + context: __SerdeContext +): any => { + const bodyNode = new __XmlNode("VpcConfiguration"); + if (input.VpcId !== undefined) { + const memberNode = new __XmlNode("VpcId").addChildNode( + new __XmlText(input.VpcId) + ); + bodyNode.addChildNode(memberNode.withName("VpcId")); + } + return bodyNode; +}; + +const deserializeAws_restXmlAccessPoint = ( + output: any, + context: __SerdeContext +): AccessPoint => { + let contents: any = { + __type: "AccessPoint", + Bucket: undefined, + Name: undefined, + NetworkOrigin: undefined, + VpcConfiguration: undefined + }; + if (output["Bucket"] !== undefined) { + contents.Bucket = output["Bucket"]; + } + if (output["Name"] !== undefined) { + contents.Name = output["Name"]; + } + if (output["NetworkOrigin"] !== undefined) { + contents.NetworkOrigin = output["NetworkOrigin"]; + } + if (output["VpcConfiguration"] !== undefined) { + contents.VpcConfiguration = deserializeAws_restXmlVpcConfiguration( + output["VpcConfiguration"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlAccessPointList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restXmlAccessPoint(entry, context) + ); +}; + +const deserializeAws_restXmlJobDescriptor = ( + output: any, + context: __SerdeContext +): JobDescriptor => { + let contents: any = { + __type: "JobDescriptor", + ConfirmationRequired: undefined, + CreationTime: undefined, + Description: undefined, + FailureReasons: undefined, + JobArn: undefined, + JobId: undefined, + Manifest: undefined, + Operation: undefined, + Priority: undefined, + ProgressSummary: undefined, + Report: undefined, + RoleArn: undefined, + Status: undefined, + StatusUpdateReason: undefined, + SuspendedCause: undefined, + SuspendedDate: undefined, + TerminationDate: undefined + }; + if (output["ConfirmationRequired"] !== undefined) { + contents.ConfirmationRequired = output["ConfirmationRequired"] == "true"; + } + if (output["CreationTime"] !== undefined) { + contents.CreationTime = new Date(output["CreationTime"]); + } + if (output["Description"] !== undefined) { + contents.Description = output["Description"]; + } + if (output["FailureReasons"]["member"] !== undefined) { + contents.FailureReasons = deserializeAws_restXmlJobFailureList( + output["FailureReasons"]["member"], + context + ); + } + if (output["JobArn"] !== undefined) { + contents.JobArn = output["JobArn"]; + } + if (output["JobId"] !== undefined) { + contents.JobId = output["JobId"]; + } + if (output["Manifest"] !== undefined) { + contents.Manifest = deserializeAws_restXmlJobManifest( + output["Manifest"], + context + ); + } + if (output["Operation"] !== undefined) { + contents.Operation = deserializeAws_restXmlJobOperation( + output["Operation"], + context + ); + } + if (output["Priority"] !== undefined) { + contents.Priority = parseInt(output["Priority"]); + } + if (output["ProgressSummary"] !== undefined) { + contents.ProgressSummary = deserializeAws_restXmlJobProgressSummary( + output["ProgressSummary"], + context + ); + } + if (output["Report"] !== undefined) { + contents.Report = deserializeAws_restXmlJobReport( + output["Report"], + context + ); + } + if (output["RoleArn"] !== undefined) { + contents.RoleArn = output["RoleArn"]; + } + if (output["Status"] !== undefined) { + contents.Status = output["Status"]; + } + if (output["StatusUpdateReason"] !== undefined) { + contents.StatusUpdateReason = output["StatusUpdateReason"]; + } + if (output["SuspendedCause"] !== undefined) { + contents.SuspendedCause = output["SuspendedCause"]; + } + if (output["SuspendedDate"] !== undefined) { + contents.SuspendedDate = new Date(output["SuspendedDate"]); + } + if (output["TerminationDate"] !== undefined) { + contents.TerminationDate = new Date(output["TerminationDate"]); + } + return contents; +}; + +const deserializeAws_restXmlJobFailure = ( + output: any, + context: __SerdeContext +): JobFailure => { + let contents: any = { + __type: "JobFailure", + FailureCode: undefined, + FailureReason: undefined + }; + if (output["FailureCode"] !== undefined) { + contents.FailureCode = output["FailureCode"]; + } + if (output["FailureReason"] !== undefined) { + contents.FailureReason = output["FailureReason"]; + } + return contents; +}; + +const deserializeAws_restXmlJobFailureList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restXmlJobFailure(entry, context) + ); +}; + +const deserializeAws_restXmlJobListDescriptor = ( + output: any, + context: __SerdeContext +): JobListDescriptor => { + let contents: any = { + __type: "JobListDescriptor", + CreationTime: undefined, + Description: undefined, + JobId: undefined, + Operation: undefined, + Priority: undefined, + ProgressSummary: undefined, + Status: undefined, + TerminationDate: undefined + }; + if (output["CreationTime"] !== undefined) { + contents.CreationTime = new Date(output["CreationTime"]); + } + if (output["Description"] !== undefined) { + contents.Description = output["Description"]; + } + if (output["JobId"] !== undefined) { + contents.JobId = output["JobId"]; + } + if (output["Operation"] !== undefined) { + contents.Operation = output["Operation"]; + } + if (output["Priority"] !== undefined) { + contents.Priority = parseInt(output["Priority"]); + } + if (output["ProgressSummary"] !== undefined) { + contents.ProgressSummary = deserializeAws_restXmlJobProgressSummary( + output["ProgressSummary"], + context + ); + } + if (output["Status"] !== undefined) { + contents.Status = output["Status"]; + } + if (output["TerminationDate"] !== undefined) { + contents.TerminationDate = new Date(output["TerminationDate"]); + } + return contents; +}; + +const deserializeAws_restXmlJobListDescriptorList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restXmlJobListDescriptor(entry, context) + ); +}; + +const deserializeAws_restXmlJobManifest = ( + output: any, + context: __SerdeContext +): JobManifest => { + let contents: any = { + __type: "JobManifest", + Location: undefined, + Spec: undefined + }; + if (output["Location"] !== undefined) { + contents.Location = deserializeAws_restXmlJobManifestLocation( + output["Location"], + context + ); + } + if (output["Spec"] !== undefined) { + contents.Spec = deserializeAws_restXmlJobManifestSpec( + output["Spec"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlJobManifestFieldList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => entry); +}; + +const deserializeAws_restXmlJobManifestLocation = ( + output: any, + context: __SerdeContext +): JobManifestLocation => { + let contents: any = { + __type: "JobManifestLocation", + ETag: undefined, + ObjectArn: undefined, + ObjectVersionId: undefined + }; + if (output["ETag"] !== undefined) { + contents.ETag = output["ETag"]; + } + if (output["ObjectArn"] !== undefined) { + contents.ObjectArn = output["ObjectArn"]; + } + if (output["ObjectVersionId"] !== undefined) { + contents.ObjectVersionId = output["ObjectVersionId"]; + } + return contents; +}; + +const deserializeAws_restXmlJobManifestSpec = ( + output: any, + context: __SerdeContext +): JobManifestSpec => { + let contents: any = { + __type: "JobManifestSpec", + Fields: undefined, + Format: undefined + }; + if (output["Fields"]["member"] !== undefined) { + contents.Fields = deserializeAws_restXmlJobManifestFieldList( + output["Fields"]["member"], + context + ); + } + if (output["Format"] !== undefined) { + contents.Format = output["Format"]; + } + return contents; +}; + +const deserializeAws_restXmlJobOperation = ( + output: any, + context: __SerdeContext +): JobOperation => { + let contents: any = { + __type: "JobOperation", + LambdaInvoke: undefined, + S3InitiateRestoreObject: undefined, + S3PutObjectAcl: undefined, + S3PutObjectCopy: undefined, + S3PutObjectTagging: undefined + }; + if (output["LambdaInvoke"] !== undefined) { + contents.LambdaInvoke = deserializeAws_restXmlLambdaInvokeOperation( + output["LambdaInvoke"], + context + ); + } + if (output["S3InitiateRestoreObject"] !== undefined) { + contents.S3InitiateRestoreObject = deserializeAws_restXmlS3InitiateRestoreObjectOperation( + output["S3InitiateRestoreObject"], + context + ); + } + if (output["S3PutObjectAcl"] !== undefined) { + contents.S3PutObjectAcl = deserializeAws_restXmlS3SetObjectAclOperation( + output["S3PutObjectAcl"], + context + ); + } + if (output["S3PutObjectCopy"] !== undefined) { + contents.S3PutObjectCopy = deserializeAws_restXmlS3CopyObjectOperation( + output["S3PutObjectCopy"], + context + ); + } + if (output["S3PutObjectTagging"] !== undefined) { + contents.S3PutObjectTagging = deserializeAws_restXmlS3SetObjectTaggingOperation( + output["S3PutObjectTagging"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlJobProgressSummary = ( + output: any, + context: __SerdeContext +): JobProgressSummary => { + let contents: any = { + __type: "JobProgressSummary", + NumberOfTasksFailed: undefined, + NumberOfTasksSucceeded: undefined, + TotalNumberOfTasks: undefined + }; + if (output["NumberOfTasksFailed"] !== undefined) { + contents.NumberOfTasksFailed = parseInt(output["NumberOfTasksFailed"]); + } + if (output["NumberOfTasksSucceeded"] !== undefined) { + contents.NumberOfTasksSucceeded = parseInt( + output["NumberOfTasksSucceeded"] + ); + } + if (output["TotalNumberOfTasks"] !== undefined) { + contents.TotalNumberOfTasks = parseInt(output["TotalNumberOfTasks"]); + } + return contents; +}; + +const deserializeAws_restXmlJobReport = ( + output: any, + context: __SerdeContext +): JobReport => { + let contents: any = { + __type: "JobReport", + Bucket: undefined, + Enabled: undefined, + Format: undefined, + Prefix: undefined, + ReportScope: undefined + }; + if (output["Bucket"] !== undefined) { + contents.Bucket = output["Bucket"]; + } + if (output["Enabled"] !== undefined) { + contents.Enabled = output["Enabled"] == "true"; + } + if (output["Format"] !== undefined) { + contents.Format = output["Format"]; + } + if (output["Prefix"] !== undefined) { + contents.Prefix = output["Prefix"]; + } + if (output["ReportScope"] !== undefined) { + contents.ReportScope = output["ReportScope"]; + } + return contents; +}; + +const deserializeAws_restXmlLambdaInvokeOperation = ( + output: any, + context: __SerdeContext +): LambdaInvokeOperation => { + let contents: any = { + __type: "LambdaInvokeOperation", + FunctionArn: undefined + }; + if (output["FunctionArn"] !== undefined) { + contents.FunctionArn = output["FunctionArn"]; + } + return contents; +}; + +const deserializeAws_restXmlPolicyStatus = ( + output: any, + context: __SerdeContext +): PolicyStatus => { + let contents: any = { + __type: "PolicyStatus", + IsPublic: undefined + }; + if (output["IsPublic"] !== undefined) { + contents.IsPublic = output["IsPublic"] == "true"; + } + return contents; +}; + +const deserializeAws_restXmlPublicAccessBlockConfiguration = ( + output: any, + context: __SerdeContext +): PublicAccessBlockConfiguration => { + let contents: any = { + __type: "PublicAccessBlockConfiguration", + BlockPublicAcls: undefined, + BlockPublicPolicy: undefined, + IgnorePublicAcls: undefined, + RestrictPublicBuckets: undefined + }; + if (output["BlockPublicAcls"] !== undefined) { + contents.BlockPublicAcls = output["BlockPublicAcls"] == "true"; + } + if (output["BlockPublicPolicy"] !== undefined) { + contents.BlockPublicPolicy = output["BlockPublicPolicy"] == "true"; + } + if (output["IgnorePublicAcls"] !== undefined) { + contents.IgnorePublicAcls = output["IgnorePublicAcls"] == "true"; + } + if (output["RestrictPublicBuckets"] !== undefined) { + contents.RestrictPublicBuckets = output["RestrictPublicBuckets"] == "true"; + } + return contents; +}; + +const deserializeAws_restXmlS3AccessControlList = ( + output: any, + context: __SerdeContext +): S3AccessControlList => { + let contents: any = { + __type: "S3AccessControlList", + Grants: undefined, + Owner: undefined + }; + if (output["Grants"]["member"] !== undefined) { + contents.Grants = deserializeAws_restXmlS3GrantList( + output["Grants"]["member"], + context + ); + } + if (output["Owner"] !== undefined) { + contents.Owner = deserializeAws_restXmlS3ObjectOwner( + output["Owner"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlS3AccessControlPolicy = ( + output: any, + context: __SerdeContext +): S3AccessControlPolicy => { + let contents: any = { + __type: "S3AccessControlPolicy", + AccessControlList: undefined, + CannedAccessControlList: undefined + }; + if (output["AccessControlList"] !== undefined) { + contents.AccessControlList = deserializeAws_restXmlS3AccessControlList( + output["AccessControlList"], + context + ); + } + if (output["CannedAccessControlList"] !== undefined) { + contents.CannedAccessControlList = output["CannedAccessControlList"]; + } + return contents; +}; + +const deserializeAws_restXmlS3CopyObjectOperation = ( + output: any, + context: __SerdeContext +): S3CopyObjectOperation => { + let contents: any = { + __type: "S3CopyObjectOperation", + AccessControlGrants: undefined, + CannedAccessControlList: undefined, + MetadataDirective: undefined, + ModifiedSinceConstraint: undefined, + NewObjectMetadata: undefined, + NewObjectTagging: undefined, + ObjectLockLegalHoldStatus: undefined, + ObjectLockMode: undefined, + ObjectLockRetainUntilDate: undefined, + RedirectLocation: undefined, + RequesterPays: undefined, + SSEAwsKmsKeyId: undefined, + StorageClass: undefined, + TargetKeyPrefix: undefined, + TargetResource: undefined, + UnModifiedSinceConstraint: undefined + }; + if (output["AccessControlGrants"]["member"] !== undefined) { + contents.AccessControlGrants = deserializeAws_restXmlS3GrantList( + output["AccessControlGrants"]["member"], + context + ); + } + if (output["CannedAccessControlList"] !== undefined) { + contents.CannedAccessControlList = output["CannedAccessControlList"]; + } + if (output["MetadataDirective"] !== undefined) { + contents.MetadataDirective = output["MetadataDirective"]; + } + if (output["ModifiedSinceConstraint"] !== undefined) { + contents.ModifiedSinceConstraint = new Date( + output["ModifiedSinceConstraint"] + ); + } + if (output["NewObjectMetadata"] !== undefined) { + contents.NewObjectMetadata = deserializeAws_restXmlS3ObjectMetadata( + output["NewObjectMetadata"], + context + ); + } + if (output["NewObjectTagging"]["member"] !== undefined) { + contents.NewObjectTagging = deserializeAws_restXmlS3TagSet( + output["NewObjectTagging"]["member"], + context + ); + } + if (output["ObjectLockLegalHoldStatus"] !== undefined) { + contents.ObjectLockLegalHoldStatus = output["ObjectLockLegalHoldStatus"]; + } + if (output["ObjectLockMode"] !== undefined) { + contents.ObjectLockMode = output["ObjectLockMode"]; + } + if (output["ObjectLockRetainUntilDate"] !== undefined) { + contents.ObjectLockRetainUntilDate = new Date( + output["ObjectLockRetainUntilDate"] + ); + } + if (output["RedirectLocation"] !== undefined) { + contents.RedirectLocation = output["RedirectLocation"]; + } + if (output["RequesterPays"] !== undefined) { + contents.RequesterPays = output["RequesterPays"] == "true"; + } + if (output["SSEAwsKmsKeyId"] !== undefined) { + contents.SSEAwsKmsKeyId = output["SSEAwsKmsKeyId"]; + } + if (output["StorageClass"] !== undefined) { + contents.StorageClass = output["StorageClass"]; + } + if (output["TargetKeyPrefix"] !== undefined) { + contents.TargetKeyPrefix = output["TargetKeyPrefix"]; + } + if (output["TargetResource"] !== undefined) { + contents.TargetResource = output["TargetResource"]; + } + if (output["UnModifiedSinceConstraint"] !== undefined) { + contents.UnModifiedSinceConstraint = new Date( + output["UnModifiedSinceConstraint"] + ); + } + return contents; +}; + +const deserializeAws_restXmlS3Grant = ( + output: any, + context: __SerdeContext +): S3Grant => { + let contents: any = { + __type: "S3Grant", + Grantee: undefined, + Permission: undefined + }; + if (output["Grantee"] !== undefined) { + contents.Grantee = deserializeAws_restXmlS3Grantee( + output["Grantee"], + context + ); + } + if (output["Permission"] !== undefined) { + contents.Permission = output["Permission"]; + } + return contents; +}; + +const deserializeAws_restXmlS3GrantList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restXmlS3Grant(entry, context) + ); +}; + +const deserializeAws_restXmlS3Grantee = ( + output: any, + context: __SerdeContext +): S3Grantee => { + let contents: any = { + __type: "S3Grantee", + DisplayName: undefined, + Identifier: undefined, + TypeIdentifier: undefined + }; + if (output["DisplayName"] !== undefined) { + contents.DisplayName = output["DisplayName"]; + } + if (output["Identifier"] !== undefined) { + contents.Identifier = output["Identifier"]; + } + if (output["TypeIdentifier"] !== undefined) { + contents.TypeIdentifier = output["TypeIdentifier"]; + } + return contents; +}; + +const deserializeAws_restXmlS3InitiateRestoreObjectOperation = ( + output: any, + context: __SerdeContext +): S3InitiateRestoreObjectOperation => { + let contents: any = { + __type: "S3InitiateRestoreObjectOperation", + ExpirationInDays: undefined, + GlacierJobTier: undefined + }; + if (output["ExpirationInDays"] !== undefined) { + contents.ExpirationInDays = parseInt(output["ExpirationInDays"]); + } + if (output["GlacierJobTier"] !== undefined) { + contents.GlacierJobTier = output["GlacierJobTier"]; + } + return contents; +}; + +const deserializeAws_restXmlS3ObjectMetadata = ( + output: any, + context: __SerdeContext +): S3ObjectMetadata => { + let contents: any = { + __type: "S3ObjectMetadata", + CacheControl: undefined, + ContentDisposition: undefined, + ContentEncoding: undefined, + ContentLanguage: undefined, + ContentLength: undefined, + ContentMD5: undefined, + ContentType: undefined, + HttpExpiresDate: undefined, + RequesterCharged: undefined, + SSEAlgorithm: undefined, + UserMetadata: undefined + }; + if (output["CacheControl"] !== undefined) { + contents.CacheControl = output["CacheControl"]; + } + if (output["ContentDisposition"] !== undefined) { + contents.ContentDisposition = output["ContentDisposition"]; + } + if (output["ContentEncoding"] !== undefined) { + contents.ContentEncoding = output["ContentEncoding"]; + } + if (output["ContentLanguage"] !== undefined) { + contents.ContentLanguage = output["ContentLanguage"]; + } + if (output["ContentLength"] !== undefined) { + contents.ContentLength = parseInt(output["ContentLength"]); + } + if (output["ContentMD5"] !== undefined) { + contents.ContentMD5 = output["ContentMD5"]; + } + if (output["ContentType"] !== undefined) { + contents.ContentType = output["ContentType"]; + } + if (output["HttpExpiresDate"] !== undefined) { + contents.HttpExpiresDate = new Date(output["HttpExpiresDate"]); + } + if (output["RequesterCharged"] !== undefined) { + contents.RequesterCharged = output["RequesterCharged"] == "true"; + } + if (output["SSEAlgorithm"] !== undefined) { + contents.SSEAlgorithm = output["SSEAlgorithm"]; + } + if (output["UserMetadata"]["entry"] !== undefined) { + contents.UserMetadata = deserializeAws_restXmlS3UserMetadata( + output["UserMetadata"]["entry"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlS3ObjectOwner = ( + output: any, + context: __SerdeContext +): S3ObjectOwner => { + let contents: any = { + __type: "S3ObjectOwner", + DisplayName: undefined, + ID: undefined + }; + if (output["DisplayName"] !== undefined) { + contents.DisplayName = output["DisplayName"]; + } + if (output["ID"] !== undefined) { + contents.ID = output["ID"]; + } + return contents; +}; + +const deserializeAws_restXmlS3SetObjectAclOperation = ( + output: any, + context: __SerdeContext +): S3SetObjectAclOperation => { + let contents: any = { + __type: "S3SetObjectAclOperation", + AccessControlPolicy: undefined + }; + if (output["AccessControlPolicy"] !== undefined) { + contents.AccessControlPolicy = deserializeAws_restXmlS3AccessControlPolicy( + output["AccessControlPolicy"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlS3SetObjectTaggingOperation = ( + output: any, + context: __SerdeContext +): S3SetObjectTaggingOperation => { + let contents: any = { + __type: "S3SetObjectTaggingOperation", + TagSet: undefined + }; + if (output["TagSet"]["member"] !== undefined) { + contents.TagSet = deserializeAws_restXmlS3TagSet( + output["TagSet"]["member"], + context + ); + } + return contents; +}; + +const deserializeAws_restXmlS3Tag = ( + output: any, + context: __SerdeContext +): S3Tag => { + let contents: any = { + __type: "S3Tag", + Key: undefined, + Value: undefined + }; + if (output["Key"] !== undefined) { + contents.Key = output["Key"]; + } + if (output["Value"] !== undefined) { + contents.Value = output["Value"]; + } + return contents; +}; + +const deserializeAws_restXmlS3TagSet = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_restXmlS3Tag(entry, context) + ); +}; + +const deserializeAws_restXmlS3UserMetadata = ( + output: any, + context: __SerdeContext +): { [key: string]: string } => { + let mapParams: any = {}; + Object.keys(output).forEach(key => { + mapParams[key] = output[key]; + }); + return mapParams; +}; + +const deserializeAws_restXmlVpcConfiguration = ( + output: any, + context: __SerdeContext +): VpcConfiguration => { + let contents: any = { + __type: "VpcConfiguration", + VpcId: undefined + }; + if (output["VpcId"] !== undefined) { + contents.VpcId = output["VpcId"]; + } + return contents; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + httpHeaders: output.headers, + requestId: output.headers["x-amzn-requestid"] +}); + +// Collect low-level response body stream to Uint8Array. +const collectBody = ( + streamBody: any, + context: __SerdeContext +): Promise => { + return context.streamCollector(streamBody) || new Uint8Array(); +}; + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = ( + streamBody: any, + context: __SerdeContext +): Promise => { + return collectBody(streamBody, context).then(body => + context.utf8Encoder(body) + ); +}; + +const parseBody = (streamBody: any, context: __SerdeContext): any => { + return collectBodyString(streamBody, context).then(encoded => { + if (encoded.length) { + return pixlParse(encoded); + } + return {}; + }); +}; + +const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string => { + if (data.Error.Code !== undefined) { + return data.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } + return "UnknownError"; +}; diff --git a/clients/client-s3-control/runtimeConfig.browser.ts b/clients/client-s3-control/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6678f047708a --- /dev/null +++ b/clients/client-s3-control/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 "./S3ControlClient"; +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: "s3", + credentialDefaultProvider: invalidFunction("Credential is missing") as any, + regionDefaultProvider: invalidFunction("Region is missing") as any +}; diff --git a/clients/client-s3-control/runtimeConfig.shared.ts b/clients/client-s3-control/runtimeConfig.shared.ts new file mode 100644 index 000000000000..41a9d04a852f --- /dev/null +++ b/clients/client-s3-control/runtimeConfig.shared.ts @@ -0,0 +1,7 @@ +import { defaultRegionInfoProvider } from "./endpoints"; + +export const ClientSharedValues = { + apiVersion: "2018-08-20", + signingName: "s3", + regionInfoProvider: defaultRegionInfoProvider +}; diff --git a/clients/client-s3-control/runtimeConfig.ts b/clients/client-s3-control/runtimeConfig.ts new file mode 100644 index 000000000000..92aef41e8541 --- /dev/null +++ b/clients/client-s3-control/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 "./S3ControlClient"; +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: "s3", + credentialDefaultProvider, + regionDefaultProvider +}; diff --git a/clients/client-s3-control/tsconfig.es.json b/clients/client-s3-control/tsconfig.es.json new file mode 100644 index 000000000000..9add6a7c2445 --- /dev/null +++ b/clients/client-s3-control/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-s3-control/tsconfig.json b/clients/client-s3-control/tsconfig.json new file mode 100644 index 000000000000..ca2fadc08187 --- /dev/null +++ b/clients/client-s3-control/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" + } +}