@aws-sdk/client-controltower 3.441.0 → 3.449.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +29 -2
  2. package/dist-cjs/ControlTower.js +6 -0
  3. package/dist-cjs/commands/ListTagsForResourceCommand.js +51 -0
  4. package/dist-cjs/commands/TagResourceCommand.js +51 -0
  5. package/dist-cjs/commands/UntagResourceCommand.js +51 -0
  6. package/dist-cjs/commands/index.js +3 -0
  7. package/dist-cjs/protocols/Aws_restJson1.js +178 -1
  8. package/dist-es/ControlTower.js +6 -0
  9. package/dist-es/commands/ListTagsForResourceCommand.js +47 -0
  10. package/dist-es/commands/TagResourceCommand.js +47 -0
  11. package/dist-es/commands/UntagResourceCommand.js +47 -0
  12. package/dist-es/commands/index.js +3 -0
  13. package/dist-es/protocols/Aws_restJson1.js +172 -1
  14. package/dist-types/ControlTower.d.ts +39 -15
  15. package/dist-types/ControlTowerClient.d.ts +23 -17
  16. package/dist-types/commands/DisableControlCommand.d.ts +2 -2
  17. package/dist-types/commands/EnableControlCommand.d.ts +7 -4
  18. package/dist-types/commands/GetControlOperationCommand.d.ts +3 -4
  19. package/dist-types/commands/GetEnabledControlCommand.d.ts +1 -16
  20. package/dist-types/commands/ListEnabledControlsCommand.d.ts +2 -3
  21. package/dist-types/commands/ListTagsForResourceCommand.d.ts +86 -0
  22. package/dist-types/commands/TagResourceCommand.d.ts +85 -0
  23. package/dist-types/commands/UntagResourceCommand.d.ts +85 -0
  24. package/dist-types/commands/index.d.ts +3 -0
  25. package/dist-types/index.d.ts +20 -15
  26. package/dist-types/models/models_0.d.ts +106 -66
  27. package/dist-types/protocols/Aws_restJson1.d.ts +27 -0
  28. package/dist-types/ts3.4/ControlTower.d.ts +51 -0
  29. package/dist-types/ts3.4/ControlTowerClient.d.ts +20 -2
  30. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
  31. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
  32. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +35 -0
  33. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  34. package/dist-types/ts3.4/index.d.ts +2 -0
  35. package/dist-types/ts3.4/models/models_0.d.ts +18 -0
  36. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +36 -0
  37. package/package.json +13 -13
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  AWS SDK for JavaScript ControlTower Client for Node.js, Browser and React Native.
8
8
 
9
9
  <p>These interfaces allow you to apply the AWS library of pre-defined
10
- <i>controls</i> to your organizational units, programmatically. In AWS Control Tower, the terms "control" and "guardrail" are synonyms. .</p>
10
+ <i>controls</i> to your organizational units, programmatically. In AWS Control Tower, the terms "control" and "guardrail" are synonyms.</p>
11
11
  <p>To call these APIs, you'll need to know:</p>
12
12
  <ul>
13
13
  <li>
@@ -16,6 +16,9 @@ AWS SDK for JavaScript ControlTower Client for Node.js, Browser and React Native
16
16
  <li>
17
17
  <p>the ARN associated with the target organizational unit (OU), which we call the <code>targetIdentifier</code>.</p>
18
18
  </li>
19
+ <li>
20
+ <p>the ARN associated with a resource that you wish to tag or untag.</p>
21
+ </li>
19
22
  </ul>
20
23
  <p>
21
24
  <b>To get the <code>controlIdentifier</code> for your AWS Control Tower
@@ -28,7 +31,7 @@ find the <code>controlIdentifier</code> for each Region and control in the <a hr
28
31
  </p>
29
32
  <p>A quick-reference list of control identifers for the AWS Control Tower legacy <i>Strongly recommended</i> and
30
33
  <i>Elective</i> controls is given in <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html">Resource identifiers for
31
- APIs and guardrails</a> in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">Controls reference guide section</a>
34
+ APIs and controls</a> in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">Controls reference guide section</a>
32
35
  of the <i>AWS Control Tower User Guide</i>. Remember that <i>Mandatory</i> controls
33
36
  cannot be added or removed.</p>
34
37
  <note>
@@ -345,3 +348,27 @@ ListEnabledControls
345
348
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/listenabledcontrolscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/listenabledcontrolscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/listenabledcontrolscommandoutput.html)
346
349
 
347
350
  </details>
351
+ <details>
352
+ <summary>
353
+ ListTagsForResource
354
+ </summary>
355
+
356
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/listtagsforresourcecommandoutput.html)
357
+
358
+ </details>
359
+ <details>
360
+ <summary>
361
+ TagResource
362
+ </summary>
363
+
364
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/tagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/tagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/tagresourcecommandoutput.html)
365
+
366
+ </details>
367
+ <details>
368
+ <summary>
369
+ UntagResource
370
+ </summary>
371
+
372
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/untagresourcecommandoutput.html)
373
+
374
+ </details>
@@ -7,6 +7,9 @@ const EnableControlCommand_1 = require("./commands/EnableControlCommand");
7
7
  const GetControlOperationCommand_1 = require("./commands/GetControlOperationCommand");
8
8
  const GetEnabledControlCommand_1 = require("./commands/GetEnabledControlCommand");
9
9
  const ListEnabledControlsCommand_1 = require("./commands/ListEnabledControlsCommand");
10
+ const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceCommand");
11
+ const TagResourceCommand_1 = require("./commands/TagResourceCommand");
12
+ const UntagResourceCommand_1 = require("./commands/UntagResourceCommand");
10
13
  const ControlTowerClient_1 = require("./ControlTowerClient");
11
14
  const commands = {
12
15
  DisableControlCommand: DisableControlCommand_1.DisableControlCommand,
@@ -14,6 +17,9 @@ const commands = {
14
17
  GetControlOperationCommand: GetControlOperationCommand_1.GetControlOperationCommand,
15
18
  GetEnabledControlCommand: GetEnabledControlCommand_1.GetEnabledControlCommand,
16
19
  ListEnabledControlsCommand: ListEnabledControlsCommand_1.ListEnabledControlsCommand,
20
+ ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand,
21
+ TagResourceCommand: TagResourceCommand_1.TagResourceCommand,
22
+ UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand,
17
23
  };
18
24
  class ControlTower extends ControlTowerClient_1.ControlTowerClient {
19
25
  }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListTagsForResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
+ class ListTagsForResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "ControlTowerClient";
29
+ const commandName = "ListTagsForResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSControlTowerApis",
38
+ operation: "ListTagsForResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_restJson1_1.se_ListTagsForResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_restJson1_1.de_ListTagsForResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.ListTagsForResourceCommand = ListTagsForResourceCommand;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TagResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
+ class TagResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "ControlTowerClient";
29
+ const commandName = "TagResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSControlTowerApis",
38
+ operation: "TagResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_restJson1_1.se_TagResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_restJson1_1.de_TagResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.TagResourceCommand = TagResourceCommand;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UntagResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
+ class UntagResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "ControlTowerClient";
29
+ const commandName = "UntagResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSControlTowerApis",
38
+ operation: "UntagResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_restJson1_1.se_UntagResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_restJson1_1.de_UntagResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.UntagResourceCommand = UntagResourceCommand;
@@ -6,3 +6,6 @@ tslib_1.__exportStar(require("./EnableControlCommand"), exports);
6
6
  tslib_1.__exportStar(require("./GetControlOperationCommand"), exports);
7
7
  tslib_1.__exportStar(require("./GetEnabledControlCommand"), exports);
8
8
  tslib_1.__exportStar(require("./ListEnabledControlsCommand"), exports);
9
+ tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports);
10
+ tslib_1.__exportStar(require("./TagResourceCommand"), exports);
11
+ tslib_1.__exportStar(require("./UntagResourceCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListEnabledControlsCommand = exports.de_GetEnabledControlCommand = exports.de_GetControlOperationCommand = exports.de_EnableControlCommand = exports.de_DisableControlCommand = exports.se_ListEnabledControlsCommand = exports.se_GetEnabledControlCommand = exports.se_GetControlOperationCommand = exports.se_EnableControlCommand = exports.se_DisableControlCommand = void 0;
3
+ exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTagsForResourceCommand = exports.de_ListEnabledControlsCommand = exports.de_GetEnabledControlCommand = exports.de_GetControlOperationCommand = exports.de_EnableControlCommand = exports.de_DisableControlCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTagsForResourceCommand = exports.se_ListEnabledControlsCommand = exports.se_GetEnabledControlCommand = exports.se_GetControlOperationCommand = exports.se_EnableControlCommand = exports.se_DisableControlCommand = void 0;
4
4
  const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const ControlTowerServiceException_1 = require("../models/ControlTowerServiceException");
@@ -36,6 +36,7 @@ const se_EnableControlCommand = async (input, context) => {
36
36
  let body;
37
37
  body = JSON.stringify((0, smithy_client_1.take)(input, {
38
38
  controlIdentifier: [],
39
+ tags: (_) => (0, smithy_client_1._json)(_),
39
40
  targetIdentifier: [],
40
41
  }));
41
42
  return new protocol_http_1.HttpRequest({
@@ -114,6 +115,69 @@ const se_ListEnabledControlsCommand = async (input, context) => {
114
115
  });
115
116
  };
116
117
  exports.se_ListEnabledControlsCommand = se_ListEnabledControlsCommand;
118
+ const se_ListTagsForResourceCommand = async (input, context) => {
119
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
120
+ const headers = {};
121
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
122
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
123
+ let body;
124
+ return new protocol_http_1.HttpRequest({
125
+ protocol,
126
+ hostname,
127
+ port,
128
+ method: "GET",
129
+ headers,
130
+ path: resolvedPath,
131
+ body,
132
+ });
133
+ };
134
+ exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
135
+ const se_TagResourceCommand = async (input, context) => {
136
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
+ const headers = {
138
+ "content-type": "application/json",
139
+ };
140
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
141
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
142
+ let body;
143
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
144
+ tags: (_) => (0, smithy_client_1._json)(_),
145
+ }));
146
+ return new protocol_http_1.HttpRequest({
147
+ protocol,
148
+ hostname,
149
+ port,
150
+ method: "POST",
151
+ headers,
152
+ path: resolvedPath,
153
+ body,
154
+ });
155
+ };
156
+ exports.se_TagResourceCommand = se_TagResourceCommand;
157
+ const se_UntagResourceCommand = async (input, context) => {
158
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
159
+ const headers = {};
160
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
161
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
162
+ const query = (0, smithy_client_1.map)({
163
+ tagKeys: [
164
+ (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
165
+ () => (input.tagKeys || []).map((_entry) => _entry),
166
+ ],
167
+ });
168
+ let body;
169
+ return new protocol_http_1.HttpRequest({
170
+ protocol,
171
+ hostname,
172
+ port,
173
+ method: "DELETE",
174
+ headers,
175
+ path: resolvedPath,
176
+ query,
177
+ body,
178
+ });
179
+ };
180
+ exports.se_UntagResourceCommand = se_UntagResourceCommand;
117
181
  const de_DisableControlCommand = async (output, context) => {
118
182
  if (output.statusCode !== 200 && output.statusCode >= 300) {
119
183
  return de_DisableControlCommandError(output, context);
@@ -175,6 +239,7 @@ const de_EnableControlCommand = async (output, context) => {
175
239
  });
176
240
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
177
241
  const doc = (0, smithy_client_1.take)(data, {
242
+ arn: smithy_client_1.expectString,
178
243
  operationIdentifier: smithy_client_1.expectString,
179
244
  });
180
245
  Object.assign(contents, doc);
@@ -357,6 +422,118 @@ const de_ListEnabledControlsCommandError = async (output, context) => {
357
422
  });
358
423
  }
359
424
  };
425
+ const de_ListTagsForResourceCommand = async (output, context) => {
426
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
427
+ return de_ListTagsForResourceCommandError(output, context);
428
+ }
429
+ const contents = (0, smithy_client_1.map)({
430
+ $metadata: deserializeMetadata(output),
431
+ });
432
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
433
+ const doc = (0, smithy_client_1.take)(data, {
434
+ tags: smithy_client_1._json,
435
+ });
436
+ Object.assign(contents, doc);
437
+ return contents;
438
+ };
439
+ exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
440
+ const de_ListTagsForResourceCommandError = async (output, context) => {
441
+ const parsedOutput = {
442
+ ...output,
443
+ body: await parseErrorBody(output.body, context),
444
+ };
445
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
446
+ switch (errorCode) {
447
+ case "InternalServerException":
448
+ case "com.amazonaws.controltower#InternalServerException":
449
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
450
+ case "ResourceNotFoundException":
451
+ case "com.amazonaws.controltower#ResourceNotFoundException":
452
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
453
+ case "ValidationException":
454
+ case "com.amazonaws.controltower#ValidationException":
455
+ throw await de_ValidationExceptionRes(parsedOutput, context);
456
+ default:
457
+ const parsedBody = parsedOutput.body;
458
+ return throwDefaultError({
459
+ output,
460
+ parsedBody,
461
+ errorCode,
462
+ });
463
+ }
464
+ };
465
+ const de_TagResourceCommand = async (output, context) => {
466
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
467
+ return de_TagResourceCommandError(output, context);
468
+ }
469
+ const contents = (0, smithy_client_1.map)({
470
+ $metadata: deserializeMetadata(output),
471
+ });
472
+ await (0, smithy_client_1.collectBody)(output.body, context);
473
+ return contents;
474
+ };
475
+ exports.de_TagResourceCommand = de_TagResourceCommand;
476
+ const de_TagResourceCommandError = async (output, context) => {
477
+ const parsedOutput = {
478
+ ...output,
479
+ body: await parseErrorBody(output.body, context),
480
+ };
481
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
482
+ switch (errorCode) {
483
+ case "InternalServerException":
484
+ case "com.amazonaws.controltower#InternalServerException":
485
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
486
+ case "ResourceNotFoundException":
487
+ case "com.amazonaws.controltower#ResourceNotFoundException":
488
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
489
+ case "ValidationException":
490
+ case "com.amazonaws.controltower#ValidationException":
491
+ throw await de_ValidationExceptionRes(parsedOutput, context);
492
+ default:
493
+ const parsedBody = parsedOutput.body;
494
+ return throwDefaultError({
495
+ output,
496
+ parsedBody,
497
+ errorCode,
498
+ });
499
+ }
500
+ };
501
+ const de_UntagResourceCommand = async (output, context) => {
502
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
503
+ return de_UntagResourceCommandError(output, context);
504
+ }
505
+ const contents = (0, smithy_client_1.map)({
506
+ $metadata: deserializeMetadata(output),
507
+ });
508
+ await (0, smithy_client_1.collectBody)(output.body, context);
509
+ return contents;
510
+ };
511
+ exports.de_UntagResourceCommand = de_UntagResourceCommand;
512
+ const de_UntagResourceCommandError = async (output, context) => {
513
+ const parsedOutput = {
514
+ ...output,
515
+ body: await parseErrorBody(output.body, context),
516
+ };
517
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
518
+ switch (errorCode) {
519
+ case "InternalServerException":
520
+ case "com.amazonaws.controltower#InternalServerException":
521
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
522
+ case "ResourceNotFoundException":
523
+ case "com.amazonaws.controltower#ResourceNotFoundException":
524
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
525
+ case "ValidationException":
526
+ case "com.amazonaws.controltower#ValidationException":
527
+ throw await de_ValidationExceptionRes(parsedOutput, context);
528
+ default:
529
+ const parsedBody = parsedOutput.body;
530
+ return throwDefaultError({
531
+ output,
532
+ parsedBody,
533
+ errorCode,
534
+ });
535
+ }
536
+ };
360
537
  const throwDefaultError = (0, smithy_client_1.withBaseException)(ControlTowerServiceException_1.ControlTowerServiceException);
361
538
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
362
539
  const contents = (0, smithy_client_1.map)({});
@@ -4,6 +4,9 @@ import { EnableControlCommand, } from "./commands/EnableControlCommand";
4
4
  import { GetControlOperationCommand, } from "./commands/GetControlOperationCommand";
5
5
  import { GetEnabledControlCommand, } from "./commands/GetEnabledControlCommand";
6
6
  import { ListEnabledControlsCommand, } from "./commands/ListEnabledControlsCommand";
7
+ import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
8
+ import { TagResourceCommand } from "./commands/TagResourceCommand";
9
+ import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
7
10
  import { ControlTowerClient } from "./ControlTowerClient";
8
11
  const commands = {
9
12
  DisableControlCommand,
@@ -11,6 +14,9 @@ const commands = {
11
14
  GetControlOperationCommand,
12
15
  GetEnabledControlCommand,
13
16
  ListEnabledControlsCommand,
17
+ ListTagsForResourceCommand,
18
+ TagResourceCommand,
19
+ UntagResourceCommand,
14
20
  };
15
21
  export class ControlTower extends ControlTowerClient {
16
22
  }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListTagsForResourceCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "ControlTowerClient";
26
+ const commandName = "ListTagsForResourceCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AWSControlTowerApis",
35
+ operation: "ListTagsForResource",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_ListTagsForResourceCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_ListTagsForResourceCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class TagResourceCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "ControlTowerClient";
26
+ const commandName = "TagResourceCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AWSControlTowerApis",
35
+ operation: "TagResource",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_TagResourceCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_TagResourceCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class UntagResourceCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "ControlTowerClient";
26
+ const commandName = "UntagResourceCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AWSControlTowerApis",
35
+ operation: "UntagResource",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_UntagResourceCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_UntagResourceCommand(output, context);
46
+ }
47
+ }
@@ -3,3 +3,6 @@ export * from "./EnableControlCommand";
3
3
  export * from "./GetControlOperationCommand";
4
4
  export * from "./GetEnabledControlCommand";
5
5
  export * from "./ListEnabledControlsCommand";
6
+ export * from "./ListTagsForResourceCommand";
7
+ export * from "./TagResourceCommand";
8
+ export * from "./UntagResourceCommand";