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 + ): PromiseCreates an Amazon S3 batch operations job.
+ * + */ + public createJob( + args: CreateJobCommandInput, + options?: __HttpHandlerOptions + ): PromiseDeletes the specified access point.
+ * + */ + public deleteAccessPoint( + args: DeleteAccessPointCommandInput, + options?: __HttpHandlerOptions + ): PromiseDeletes the access point policy for the specified access point.
+ * + */ + public deleteAccessPointPolicy( + args: DeleteAccessPointPolicyCommandInput, + options?: __HttpHandlerOptions + ): PromiseRemoves the PublicAccessBlock
configuration for an Amazon Web Services
+ * account.
Retrieves the configuration parameters and status for a batch operations job.
+ * + */ + public describeJob( + args: DescribeJobCommandInput, + options?: __HttpHandlerOptions + ): PromiseReturns configuration information about the specified access point.
+ * + */ + public getAccessPoint( + args: GetAccessPointCommandInput, + options?: __HttpHandlerOptions + ): PromiseReturns the access point policy associated with the specified access point.
+ * + */ + public getAccessPointPolicy( + args: GetAccessPointPolicyCommandInput, + options?: __HttpHandlerOptions + ): PromiseIndicates 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 + ): PromiseRetrieves the PublicAccessBlock
configuration for an Amazon Web Services account.
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.
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 + ): PromiseAssociates 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 + ): PromiseCreates or modifies the PublicAccessBlock
configuration for an Amazon Web Services
+ * account.
Updates an existing job's priority.
+ * + */ + public updateJobPriority( + args: UpdateJobPriorityCommandInput, + options?: __HttpHandlerOptions + ): PromiseUpdates 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+ * 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: MiddlewareStackAn 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.
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.
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.
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.
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.
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.
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.
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.
The account ID for the Amazon Web Services account whose PublicAccessBlock
+ * configuration you want to retrieve.
A container element for the job configuration and status information returned by a Describe Job
request.
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.
If the specified job failed, this field contains information describing the failure.
+ * + */ + FailureReasons?: ArrayThe 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.
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.
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.
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.
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
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.
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.
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.
Contains identification and configuration information for one or more access points associated with the specified bucket.
+ * + */ + AccessPointList?: ArrayIf 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.
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.
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.
The list of current jobs and jobs that have ended within the last 30 days.
+ * + */ + Jobs?: ArrayIf 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.
Amazon S3 throws this exception if you make a GetPublicAccessBlock
request
+ * against an account that doesn't have a PublicAccessBlockConfiguration
set.
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.
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.
The PublicAccessBlock
configuration that you want to apply to the specified
+ * Amazon Web Services account.
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?: ArrayContains 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?: ArrayThe 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