Skip to content

Commit 4c26817

Browse files
author
awstools
committed
feat(client-s3tables): Adds support for tagging APIs for S3 Tables
1 parent 7cb1367 commit 4c26817

File tree

14 files changed

+928
-12
lines changed

14 files changed

+928
-12
lines changed

clients/client-s3tables/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ ListTables
386386

387387
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3tables/command/ListTablesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/ListTablesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/ListTablesCommandOutput/)
388388

389+
</details>
390+
<details>
391+
<summary>
392+
ListTagsForResource
393+
</summary>
394+
395+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3tables/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/ListTagsForResourceCommandOutput/)
396+
389397
</details>
390398
<details>
391399
<summary>
@@ -434,6 +442,22 @@ RenameTable
434442

435443
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3tables/command/RenameTableCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/RenameTableCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/RenameTableCommandOutput/)
436444

445+
</details>
446+
<details>
447+
<summary>
448+
TagResource
449+
</summary>
450+
451+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3tables/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/TagResourceCommandOutput/)
452+
453+
</details>
454+
<details>
455+
<summary>
456+
UntagResource
457+
</summary>
458+
459+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3tables/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3tables/Interface/UntagResourceCommandOutput/)
460+
437461
</details>
438462
<details>
439463
<summary>

clients/client-s3tables/src/S3Tables.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ import {
101101
ListTableBucketsCommandOutput,
102102
} from "./commands/ListTableBucketsCommand";
103103
import { ListTablesCommand, ListTablesCommandInput, ListTablesCommandOutput } from "./commands/ListTablesCommand";
104+
import {
105+
ListTagsForResourceCommand,
106+
ListTagsForResourceCommandInput,
107+
ListTagsForResourceCommandOutput,
108+
} from "./commands/ListTagsForResourceCommand";
104109
import {
105110
PutTableBucketEncryptionCommand,
106111
PutTableBucketEncryptionCommandInput,
@@ -127,6 +132,12 @@ import {
127132
PutTablePolicyCommandOutput,
128133
} from "./commands/PutTablePolicyCommand";
129134
import { RenameTableCommand, RenameTableCommandInput, RenameTableCommandOutput } from "./commands/RenameTableCommand";
135+
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
136+
import {
137+
UntagResourceCommand,
138+
UntagResourceCommandInput,
139+
UntagResourceCommandOutput,
140+
} from "./commands/UntagResourceCommand";
130141
import {
131142
UpdateTableMetadataLocationCommand,
132143
UpdateTableMetadataLocationCommandInput,
@@ -158,12 +169,15 @@ const commands = {
158169
ListNamespacesCommand,
159170
ListTableBucketsCommand,
160171
ListTablesCommand,
172+
ListTagsForResourceCommand,
161173
PutTableBucketEncryptionCommand,
162174
PutTableBucketMaintenanceConfigurationCommand,
163175
PutTableBucketPolicyCommand,
164176
PutTableMaintenanceConfigurationCommand,
165177
PutTablePolicyCommand,
166178
RenameTableCommand,
179+
TagResourceCommand,
180+
UntagResourceCommand,
167181
UpdateTableMetadataLocationCommand,
168182
};
169183

@@ -516,6 +530,23 @@ export interface S3Tables {
516530
cb: (err: any, data?: ListTablesCommandOutput) => void
517531
): void;
518532

533+
/**
534+
* @see {@link ListTagsForResourceCommand}
535+
*/
536+
listTagsForResource(
537+
args: ListTagsForResourceCommandInput,
538+
options?: __HttpHandlerOptions
539+
): Promise<ListTagsForResourceCommandOutput>;
540+
listTagsForResource(
541+
args: ListTagsForResourceCommandInput,
542+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
543+
): void;
544+
listTagsForResource(
545+
args: ListTagsForResourceCommandInput,
546+
options: __HttpHandlerOptions,
547+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
548+
): void;
549+
519550
/**
520551
* @see {@link PutTableBucketEncryptionCommand}
521552
*/
@@ -609,6 +640,28 @@ export interface S3Tables {
609640
cb: (err: any, data?: RenameTableCommandOutput) => void
610641
): void;
611642

643+
/**
644+
* @see {@link TagResourceCommand}
645+
*/
646+
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
647+
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
648+
tagResource(
649+
args: TagResourceCommandInput,
650+
options: __HttpHandlerOptions,
651+
cb: (err: any, data?: TagResourceCommandOutput) => void
652+
): void;
653+
654+
/**
655+
* @see {@link UntagResourceCommand}
656+
*/
657+
untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise<UntagResourceCommandOutput>;
658+
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
659+
untagResource(
660+
args: UntagResourceCommandInput,
661+
options: __HttpHandlerOptions,
662+
cb: (err: any, data?: UntagResourceCommandOutput) => void
663+
): void;
664+
612665
/**
613666
* @see {@link UpdateTableMetadataLocationCommand}
614667
*/

clients/client-s3tables/src/S3TablesClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ import { GetTablePolicyCommandInput, GetTablePolicyCommandOutput } from "./comma
100100
import { ListNamespacesCommandInput, ListNamespacesCommandOutput } from "./commands/ListNamespacesCommand";
101101
import { ListTableBucketsCommandInput, ListTableBucketsCommandOutput } from "./commands/ListTableBucketsCommand";
102102
import { ListTablesCommandInput, ListTablesCommandOutput } from "./commands/ListTablesCommand";
103+
import {
104+
ListTagsForResourceCommandInput,
105+
ListTagsForResourceCommandOutput,
106+
} from "./commands/ListTagsForResourceCommand";
103107
import {
104108
PutTableBucketEncryptionCommandInput,
105109
PutTableBucketEncryptionCommandOutput,
@@ -118,6 +122,8 @@ import {
118122
} from "./commands/PutTableMaintenanceConfigurationCommand";
119123
import { PutTablePolicyCommandInput, PutTablePolicyCommandOutput } from "./commands/PutTablePolicyCommand";
120124
import { RenameTableCommandInput, RenameTableCommandOutput } from "./commands/RenameTableCommand";
125+
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
126+
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
121127
import {
122128
UpdateTableMetadataLocationCommandInput,
123129
UpdateTableMetadataLocationCommandOutput,
@@ -160,12 +166,15 @@ export type ServiceInputTypes =
160166
| ListNamespacesCommandInput
161167
| ListTableBucketsCommandInput
162168
| ListTablesCommandInput
169+
| ListTagsForResourceCommandInput
163170
| PutTableBucketEncryptionCommandInput
164171
| PutTableBucketMaintenanceConfigurationCommandInput
165172
| PutTableBucketPolicyCommandInput
166173
| PutTableMaintenanceConfigurationCommandInput
167174
| PutTablePolicyCommandInput
168175
| RenameTableCommandInput
176+
| TagResourceCommandInput
177+
| UntagResourceCommandInput
169178
| UpdateTableMetadataLocationCommandInput;
170179

171180
/**
@@ -195,12 +204,15 @@ export type ServiceOutputTypes =
195204
| ListNamespacesCommandOutput
196205
| ListTableBucketsCommandOutput
197206
| ListTablesCommandOutput
207+
| ListTagsForResourceCommandOutput
198208
| PutTableBucketEncryptionCommandOutput
199209
| PutTableBucketMaintenanceConfigurationCommandOutput
200210
| PutTableBucketPolicyCommandOutput
201211
| PutTableMaintenanceConfigurationCommandOutput
202212
| PutTablePolicyCommandOutput
203213
| RenameTableCommandOutput
214+
| TagResourceCommandOutput
215+
| UntagResourceCommandOutput
204216
| UpdateTableMetadataLocationCommandOutput;
205217

206218
/**

clients/client-s3tables/src/commands/CreateTableBucketCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface CreateTableBucketCommandInput extends CreateTableBucketRequest
2828
export interface CreateTableBucketCommandOutput extends CreateTableBucketResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Creates a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-create.html">Creating a table bucket</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:CreateTableBucket</code> permission to use this operation. </p> </li> <li> <p>If you use this operation with the optional <code>encryptionConfiguration</code> parameter you must have the <code>s3tables:PutTableBucketEncryption</code> permission.</p> </li> </ul> </dd> </dl>
31+
* <p>Creates a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-create.html">Creating a table bucket</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:CreateTableBucket</code> permission to use this operation. </p> </li> <li> <p>If you use this operation with the optional <code>encryptionConfiguration</code> parameter you must have the <code>s3tables:PutTableBucketEncryption</code> permission.</p> </li> <li> <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTableBucket</code> permission to create a table bucket with tags.</p> </li> </ul> </dd> </dl>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -43,6 +43,9 @@ export interface CreateTableBucketCommandOutput extends CreateTableBucketRespons
4343
* sseAlgorithm: "AES256" || "aws:kms", // required
4444
* kmsKeyArn: "STRING_VALUE",
4545
* },
46+
* tags: { // Tags
47+
* "<keys>": "STRING_VALUE",
48+
* },
4649
* };
4750
* const command = new CreateTableBucketCommand(input);
4851
* const response = await client.send(command);

clients/client-s3tables/src/commands/CreateTableCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface CreateTableCommandInput extends CreateTableRequest {}
2828
export interface CreateTableCommandOutput extends CreateTableResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Creates a new table associated with the given namespace in a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-create.html">Creating an Amazon S3 table</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:CreateTable</code> permission to use this operation. </p> </li> <li> <p>If you use this operation with the optional <code>metadata</code> request parameter you must have the <code>s3tables:PutTableData</code> permission. </p> </li> <li> <p>If you use this operation with the optional <code>encryptionConfiguration</code> request parameter you must have the <code>s3tables:PutTableEncryption</code> permission. </p> </li> </ul> <note> <p>Additionally, If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>. </p> </note> </dd> </dl>
31+
* <p>Creates a new table associated with the given namespace in a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-create.html">Creating an Amazon S3 table</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:CreateTable</code> permission to use this operation. </p> </li> <li> <p>If you use this operation with the optional <code>metadata</code> request parameter you must have the <code>s3tables:PutTableData</code> permission. </p> </li> <li> <p>If you use this operation with the optional <code>encryptionConfiguration</code> request parameter you must have the <code>s3tables:PutTableEncryption</code> permission. </p> </li> <li> <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p> </li> </ul> <note> <p>Additionally, If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>. </p> </note> </dd> </dl>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript
@@ -59,6 +59,9 @@ export interface CreateTableCommandOutput extends CreateTableResponse, __Metadat
5959
* sseAlgorithm: "AES256" || "aws:kms", // required
6060
* kmsKeyArn: "STRING_VALUE",
6161
* },
62+
* tags: { // Tags
63+
* "<keys>": "STRING_VALUE",
64+
* },
6265
* };
6366
* const command = new CreateTableCommand(input);
6467
* const response = await client.send(command);
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0";
9+
import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1";
10+
import { S3TablesClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3TablesClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ListTagsForResourceCommand}.
21+
*/
22+
export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ListTagsForResourceCommand}.
27+
*/
28+
export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Lists all of the tags applied to a specified Amazon S3 Tables resource. Each tag is a label consisting of a key and value pair. Tags can help you organize, track costs for, and control access to resources. </p> <note> <p>For a list of S3 resources that support tagging, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html#manage-tags">Managing tags for Amazon S3 resources</a>.</p> </note> <dl> <dt>Permissions</dt> <dd> <p>For tables and table buckets, you must have the <code>s3tables:ListTagsForResource</code> permission to use this operation.</p> </dd> </dl>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { S3TablesClient, ListTagsForResourceCommand } from "@aws-sdk/client-s3tables"; // ES Modules import
36+
* // const { S3TablesClient, ListTagsForResourceCommand } = require("@aws-sdk/client-s3tables"); // CommonJS import
37+
* // import type { S3TablesClientConfig } from "@aws-sdk/client-s3tables";
38+
* const config = {}; // type is S3TablesClientConfig
39+
* const client = new S3TablesClient(config);
40+
* const input = { // ListTagsForResourceRequest
41+
* resourceArn: "STRING_VALUE", // required
42+
* };
43+
* const command = new ListTagsForResourceCommand(input);
44+
* const response = await client.send(command);
45+
* // { // ListTagsForResourceResponse
46+
* // tags: { // Tags
47+
* // "<keys>": "STRING_VALUE",
48+
* // },
49+
* // };
50+
*
51+
* ```
52+
*
53+
* @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput}
54+
* @returns {@link ListTagsForResourceCommandOutput}
55+
* @see {@link ListTagsForResourceCommandInput} for command's `input` shape.
56+
* @see {@link ListTagsForResourceCommandOutput} for command's `response` shape.
57+
* @see {@link S3TablesClientResolvedConfig | config} for S3TablesClient's `config` shape.
58+
*
59+
* @throws {@link BadRequestException} (client fault)
60+
* <p>The request is invalid or malformed.</p>
61+
*
62+
* @throws {@link ConflictException} (client fault)
63+
* <p>The request failed because there is a conflict with a previous write. You can retry the request.</p>
64+
*
65+
* @throws {@link ForbiddenException} (client fault)
66+
* <p>The caller isn't authorized to make the request.</p>
67+
*
68+
* @throws {@link InternalServerErrorException} (server fault)
69+
* <p>The request failed due to an internal server error.</p>
70+
*
71+
* @throws {@link NotFoundException} (client fault)
72+
* <p>The request was rejected because the specified resource could not be found.</p>
73+
*
74+
* @throws {@link TooManyRequestsException} (client fault)
75+
* <p>The limit on the number of requests per second was exceeded.</p>
76+
*
77+
* @throws {@link S3TablesServiceException}
78+
* <p>Base exception class for all service exceptions from S3Tables service.</p>
79+
*
80+
*
81+
* @public
82+
*/
83+
export class ListTagsForResourceCommand extends $Command
84+
.classBuilder<
85+
ListTagsForResourceCommandInput,
86+
ListTagsForResourceCommandOutput,
87+
S3TablesClientResolvedConfig,
88+
ServiceInputTypes,
89+
ServiceOutputTypes
90+
>()
91+
.ep(commonParams)
92+
.m(function (this: any, Command: any, cs: any, config: S3TablesClientResolvedConfig, o: any) {
93+
return [
94+
getSerdePlugin(config, this.serialize, this.deserialize),
95+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
96+
];
97+
})
98+
.s("S3TableBuckets", "ListTagsForResource", {})
99+
.n("S3TablesClient", "ListTagsForResourceCommand")
100+
.f(void 0, void 0)
101+
.ser(se_ListTagsForResourceCommand)
102+
.de(de_ListTagsForResourceCommand)
103+
.build() {
104+
/** @internal type navigation helper, not in runtime. */
105+
protected declare static __types: {
106+
api: {
107+
input: ListTagsForResourceRequest;
108+
output: ListTagsForResourceResponse;
109+
};
110+
sdk: {
111+
input: ListTagsForResourceCommandInput;
112+
output: ListTagsForResourceCommandOutput;
113+
};
114+
};
115+
}

clients/client-s3tables/src/commands/PutTableBucketPolicyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface PutTableBucketPolicyCommandInput extends PutTableBucketPolicyRe
2828
export interface PutTableBucketPolicyCommandOutput extends __MetadataBearer {}
2929

3030
/**
31-
* <p>Creates a new maintenance configuration or replaces an existing table bucket policy for a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-bucket-policy.html#table-bucket-policy-add">Adding a table bucket policy</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3tables:PutTableBucketPolicy</code> permission to use this operation. </p> </dd> </dl>
31+
* <p>Creates a new table bucket policy or replaces an existing table bucket policy for a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-bucket-policy.html#table-bucket-policy-add">Adding a table bucket policy</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3tables:PutTableBucketPolicy</code> permission to use this operation. </p> </dd> </dl>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

0 commit comments

Comments
 (0)