@aws-sdk/client-controltower 3.163.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 (84) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +275 -0
  4. package/dist-cjs/ControlTower.js +67 -0
  5. package/dist-cjs/ControlTowerClient.js +37 -0
  6. package/dist-cjs/commands/DisableControlCommand.js +36 -0
  7. package/dist-cjs/commands/EnableControlCommand.js +36 -0
  8. package/dist-cjs/commands/GetControlOperationCommand.js +36 -0
  9. package/dist-cjs/commands/ListEnabledControlsCommand.js +36 -0
  10. package/dist-cjs/commands/index.js +7 -0
  11. package/dist-cjs/endpoints.js +169 -0
  12. package/dist-cjs/index.js +11 -0
  13. package/dist-cjs/models/ControlTowerServiceException.js +11 -0
  14. package/dist-cjs/models/index.js +4 -0
  15. package/dist-cjs/models/models_0.js +153 -0
  16. package/dist-cjs/pagination/Interfaces.js +2 -0
  17. package/dist-cjs/pagination/ListEnabledControlsPaginator.js +36 -0
  18. package/dist-cjs/pagination/index.js +5 -0
  19. package/dist-cjs/protocols/Aws_restJson1.js +468 -0
  20. package/dist-cjs/runtimeConfig.browser.js +45 -0
  21. package/dist-cjs/runtimeConfig.js +52 -0
  22. package/dist-cjs/runtimeConfig.native.js +16 -0
  23. package/dist-cjs/runtimeConfig.shared.js +17 -0
  24. package/dist-es/ControlTower.js +70 -0
  25. package/dist-es/ControlTowerClient.js +39 -0
  26. package/dist-es/commands/DisableControlCommand.js +39 -0
  27. package/dist-es/commands/EnableControlCommand.js +39 -0
  28. package/dist-es/commands/GetControlOperationCommand.js +39 -0
  29. package/dist-es/commands/ListEnabledControlsCommand.js +39 -0
  30. package/dist-es/commands/index.js +4 -0
  31. package/dist-es/endpoints.js +165 -0
  32. package/dist-es/index.js +6 -0
  33. package/dist-es/models/ControlTowerServiceException.js +12 -0
  34. package/dist-es/models/index.js +1 -0
  35. package/dist-es/models/models_0.js +114 -0
  36. package/dist-es/pagination/Interfaces.js +1 -0
  37. package/dist-es/pagination/ListEnabledControlsPaginator.js +75 -0
  38. package/dist-es/pagination/index.js +2 -0
  39. package/dist-es/protocols/Aws_restJson1.js +589 -0
  40. package/dist-es/runtimeConfig.browser.js +26 -0
  41. package/dist-es/runtimeConfig.js +30 -0
  42. package/dist-es/runtimeConfig.native.js +8 -0
  43. package/dist-es/runtimeConfig.shared.js +13 -0
  44. package/dist-types/ControlTower.d.ts +112 -0
  45. package/dist-types/ControlTowerClient.d.ts +218 -0
  46. package/dist-types/commands/DisableControlCommand.d.ts +37 -0
  47. package/dist-types/commands/EnableControlCommand.d.ts +37 -0
  48. package/dist-types/commands/GetControlOperationCommand.d.ts +37 -0
  49. package/dist-types/commands/ListEnabledControlsCommand.d.ts +36 -0
  50. package/dist-types/commands/index.d.ts +4 -0
  51. package/dist-types/endpoints.d.ts +2 -0
  52. package/dist-types/index.d.ts +6 -0
  53. package/dist-types/models/ControlTowerServiceException.d.ts +10 -0
  54. package/dist-types/models/index.d.ts +1 -0
  55. package/dist-types/models/models_0.d.ts +255 -0
  56. package/dist-types/pagination/Interfaces.d.ts +6 -0
  57. package/dist-types/pagination/ListEnabledControlsPaginator.d.ts +4 -0
  58. package/dist-types/pagination/index.d.ts +2 -0
  59. package/dist-types/protocols/Aws_restJson1.d.ts +14 -0
  60. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  61. package/dist-types/runtimeConfig.d.ts +40 -0
  62. package/dist-types/runtimeConfig.native.d.ts +39 -0
  63. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  64. package/dist-types/ts3.4/ControlTower.d.ts +25 -0
  65. package/dist-types/ts3.4/ControlTowerClient.d.ts +77 -0
  66. package/dist-types/ts3.4/commands/DisableControlCommand.d.ts +17 -0
  67. package/dist-types/ts3.4/commands/EnableControlCommand.d.ts +17 -0
  68. package/dist-types/ts3.4/commands/GetControlOperationCommand.d.ts +17 -0
  69. package/dist-types/ts3.4/commands/ListEnabledControlsCommand.d.ts +17 -0
  70. package/dist-types/ts3.4/commands/index.d.ts +4 -0
  71. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  72. package/dist-types/ts3.4/index.d.ts +6 -0
  73. package/dist-types/ts3.4/models/ControlTowerServiceException.d.ts +6 -0
  74. package/dist-types/ts3.4/models/index.d.ts +1 -0
  75. package/dist-types/ts3.4/models/models_0.d.ts +150 -0
  76. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  77. package/dist-types/ts3.4/pagination/ListEnabledControlsPaginator.d.ts +4 -0
  78. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  79. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +14 -0
  80. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  81. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  82. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  83. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  84. package/package.json +99 -0
@@ -0,0 +1,468 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1ListEnabledControlsCommand = exports.deserializeAws_restJson1GetControlOperationCommand = exports.deserializeAws_restJson1EnableControlCommand = exports.deserializeAws_restJson1DisableControlCommand = exports.serializeAws_restJson1ListEnabledControlsCommand = exports.serializeAws_restJson1GetControlOperationCommand = exports.serializeAws_restJson1EnableControlCommand = exports.serializeAws_restJson1DisableControlCommand = void 0;
4
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const ControlTowerServiceException_1 = require("../models/ControlTowerServiceException");
7
+ const models_0_1 = require("../models/models_0");
8
+ const serializeAws_restJson1DisableControlCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/disable-control";
14
+ let body;
15
+ body = JSON.stringify({
16
+ ...(input.controlIdentifier != null && { controlIdentifier: input.controlIdentifier }),
17
+ ...(input.targetIdentifier != null && { targetIdentifier: input.targetIdentifier }),
18
+ });
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ exports.serializeAws_restJson1DisableControlCommand = serializeAws_restJson1DisableControlCommand;
30
+ const serializeAws_restJson1EnableControlCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {
33
+ "content-type": "application/json",
34
+ };
35
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/enable-control";
36
+ let body;
37
+ body = JSON.stringify({
38
+ ...(input.controlIdentifier != null && { controlIdentifier: input.controlIdentifier }),
39
+ ...(input.targetIdentifier != null && { targetIdentifier: input.targetIdentifier }),
40
+ });
41
+ return new protocol_http_1.HttpRequest({
42
+ protocol,
43
+ hostname,
44
+ port,
45
+ method: "POST",
46
+ headers,
47
+ path: resolvedPath,
48
+ body,
49
+ });
50
+ };
51
+ exports.serializeAws_restJson1EnableControlCommand = serializeAws_restJson1EnableControlCommand;
52
+ const serializeAws_restJson1GetControlOperationCommand = async (input, context) => {
53
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const headers = {
55
+ "content-type": "application/json",
56
+ };
57
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/get-control-operation";
58
+ let body;
59
+ body = JSON.stringify({
60
+ ...(input.operationIdentifier != null && { operationIdentifier: input.operationIdentifier }),
61
+ });
62
+ return new protocol_http_1.HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "POST",
67
+ headers,
68
+ path: resolvedPath,
69
+ body,
70
+ });
71
+ };
72
+ exports.serializeAws_restJson1GetControlOperationCommand = serializeAws_restJson1GetControlOperationCommand;
73
+ const serializeAws_restJson1ListEnabledControlsCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {
76
+ "content-type": "application/json",
77
+ };
78
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/list-enabled-controls";
79
+ let body;
80
+ body = JSON.stringify({
81
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
82
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
83
+ ...(input.targetIdentifier != null && { targetIdentifier: input.targetIdentifier }),
84
+ });
85
+ return new protocol_http_1.HttpRequest({
86
+ protocol,
87
+ hostname,
88
+ port,
89
+ method: "POST",
90
+ headers,
91
+ path: resolvedPath,
92
+ body,
93
+ });
94
+ };
95
+ exports.serializeAws_restJson1ListEnabledControlsCommand = serializeAws_restJson1ListEnabledControlsCommand;
96
+ const deserializeAws_restJson1DisableControlCommand = async (output, context) => {
97
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
98
+ return deserializeAws_restJson1DisableControlCommandError(output, context);
99
+ }
100
+ const contents = map({
101
+ $metadata: deserializeMetadata(output),
102
+ });
103
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
104
+ if (data.operationIdentifier != null) {
105
+ contents.operationIdentifier = (0, smithy_client_1.expectString)(data.operationIdentifier);
106
+ }
107
+ return contents;
108
+ };
109
+ exports.deserializeAws_restJson1DisableControlCommand = deserializeAws_restJson1DisableControlCommand;
110
+ const deserializeAws_restJson1DisableControlCommandError = async (output, context) => {
111
+ const parsedOutput = {
112
+ ...output,
113
+ body: await parseBody(output.body, context),
114
+ };
115
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
116
+ switch (errorCode) {
117
+ case "AccessDeniedException":
118
+ case "com.amazonaws.controltower#AccessDeniedException":
119
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
120
+ case "ConflictException":
121
+ case "com.amazonaws.controltower#ConflictException":
122
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
123
+ case "InternalServerException":
124
+ case "com.amazonaws.controltower#InternalServerException":
125
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
126
+ case "ResourceNotFoundException":
127
+ case "com.amazonaws.controltower#ResourceNotFoundException":
128
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
129
+ case "ServiceQuotaExceededException":
130
+ case "com.amazonaws.controltower#ServiceQuotaExceededException":
131
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
132
+ case "ThrottlingException":
133
+ case "com.amazonaws.controltower#ThrottlingException":
134
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
135
+ case "ValidationException":
136
+ case "com.amazonaws.controltower#ValidationException":
137
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
138
+ default:
139
+ const parsedBody = parsedOutput.body;
140
+ (0, smithy_client_1.throwDefaultError)({
141
+ output,
142
+ parsedBody,
143
+ exceptionCtor: ControlTowerServiceException_1.ControlTowerServiceException,
144
+ errorCode,
145
+ });
146
+ }
147
+ };
148
+ const deserializeAws_restJson1EnableControlCommand = async (output, context) => {
149
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
150
+ return deserializeAws_restJson1EnableControlCommandError(output, context);
151
+ }
152
+ const contents = map({
153
+ $metadata: deserializeMetadata(output),
154
+ });
155
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
156
+ if (data.operationIdentifier != null) {
157
+ contents.operationIdentifier = (0, smithy_client_1.expectString)(data.operationIdentifier);
158
+ }
159
+ return contents;
160
+ };
161
+ exports.deserializeAws_restJson1EnableControlCommand = deserializeAws_restJson1EnableControlCommand;
162
+ const deserializeAws_restJson1EnableControlCommandError = async (output, context) => {
163
+ const parsedOutput = {
164
+ ...output,
165
+ body: await parseBody(output.body, context),
166
+ };
167
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
168
+ switch (errorCode) {
169
+ case "AccessDeniedException":
170
+ case "com.amazonaws.controltower#AccessDeniedException":
171
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
172
+ case "ConflictException":
173
+ case "com.amazonaws.controltower#ConflictException":
174
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
175
+ case "InternalServerException":
176
+ case "com.amazonaws.controltower#InternalServerException":
177
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
178
+ case "ResourceNotFoundException":
179
+ case "com.amazonaws.controltower#ResourceNotFoundException":
180
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
181
+ case "ServiceQuotaExceededException":
182
+ case "com.amazonaws.controltower#ServiceQuotaExceededException":
183
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
184
+ case "ThrottlingException":
185
+ case "com.amazonaws.controltower#ThrottlingException":
186
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
187
+ case "ValidationException":
188
+ case "com.amazonaws.controltower#ValidationException":
189
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
190
+ default:
191
+ const parsedBody = parsedOutput.body;
192
+ (0, smithy_client_1.throwDefaultError)({
193
+ output,
194
+ parsedBody,
195
+ exceptionCtor: ControlTowerServiceException_1.ControlTowerServiceException,
196
+ errorCode,
197
+ });
198
+ }
199
+ };
200
+ const deserializeAws_restJson1GetControlOperationCommand = async (output, context) => {
201
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
202
+ return deserializeAws_restJson1GetControlOperationCommandError(output, context);
203
+ }
204
+ const contents = map({
205
+ $metadata: deserializeMetadata(output),
206
+ });
207
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
208
+ if (data.controlOperation != null) {
209
+ contents.controlOperation = deserializeAws_restJson1ControlOperation(data.controlOperation, context);
210
+ }
211
+ return contents;
212
+ };
213
+ exports.deserializeAws_restJson1GetControlOperationCommand = deserializeAws_restJson1GetControlOperationCommand;
214
+ const deserializeAws_restJson1GetControlOperationCommandError = async (output, context) => {
215
+ const parsedOutput = {
216
+ ...output,
217
+ body: await parseBody(output.body, context),
218
+ };
219
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
220
+ switch (errorCode) {
221
+ case "AccessDeniedException":
222
+ case "com.amazonaws.controltower#AccessDeniedException":
223
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
224
+ case "InternalServerException":
225
+ case "com.amazonaws.controltower#InternalServerException":
226
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
227
+ case "ResourceNotFoundException":
228
+ case "com.amazonaws.controltower#ResourceNotFoundException":
229
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
230
+ case "ThrottlingException":
231
+ case "com.amazonaws.controltower#ThrottlingException":
232
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
233
+ case "ValidationException":
234
+ case "com.amazonaws.controltower#ValidationException":
235
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
236
+ default:
237
+ const parsedBody = parsedOutput.body;
238
+ (0, smithy_client_1.throwDefaultError)({
239
+ output,
240
+ parsedBody,
241
+ exceptionCtor: ControlTowerServiceException_1.ControlTowerServiceException,
242
+ errorCode,
243
+ });
244
+ }
245
+ };
246
+ const deserializeAws_restJson1ListEnabledControlsCommand = async (output, context) => {
247
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
248
+ return deserializeAws_restJson1ListEnabledControlsCommandError(output, context);
249
+ }
250
+ const contents = map({
251
+ $metadata: deserializeMetadata(output),
252
+ });
253
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
254
+ if (data.enabledControls != null) {
255
+ contents.enabledControls = deserializeAws_restJson1EnabledControls(data.enabledControls, context);
256
+ }
257
+ if (data.nextToken != null) {
258
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
259
+ }
260
+ return contents;
261
+ };
262
+ exports.deserializeAws_restJson1ListEnabledControlsCommand = deserializeAws_restJson1ListEnabledControlsCommand;
263
+ const deserializeAws_restJson1ListEnabledControlsCommandError = async (output, context) => {
264
+ const parsedOutput = {
265
+ ...output,
266
+ body: await parseBody(output.body, context),
267
+ };
268
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
269
+ switch (errorCode) {
270
+ case "AccessDeniedException":
271
+ case "com.amazonaws.controltower#AccessDeniedException":
272
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
273
+ case "InternalServerException":
274
+ case "com.amazonaws.controltower#InternalServerException":
275
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
276
+ case "ResourceNotFoundException":
277
+ case "com.amazonaws.controltower#ResourceNotFoundException":
278
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
279
+ case "ThrottlingException":
280
+ case "com.amazonaws.controltower#ThrottlingException":
281
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
282
+ case "ValidationException":
283
+ case "com.amazonaws.controltower#ValidationException":
284
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
285
+ default:
286
+ const parsedBody = parsedOutput.body;
287
+ (0, smithy_client_1.throwDefaultError)({
288
+ output,
289
+ parsedBody,
290
+ exceptionCtor: ControlTowerServiceException_1.ControlTowerServiceException,
291
+ errorCode,
292
+ });
293
+ }
294
+ };
295
+ const map = smithy_client_1.map;
296
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
297
+ const contents = map({});
298
+ const data = parsedOutput.body;
299
+ if (data.message != null) {
300
+ contents.message = (0, smithy_client_1.expectString)(data.message);
301
+ }
302
+ const exception = new models_0_1.AccessDeniedException({
303
+ $metadata: deserializeMetadata(parsedOutput),
304
+ ...contents,
305
+ });
306
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
307
+ };
308
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
309
+ const contents = map({});
310
+ const data = parsedOutput.body;
311
+ if (data.message != null) {
312
+ contents.message = (0, smithy_client_1.expectString)(data.message);
313
+ }
314
+ const exception = new models_0_1.ConflictException({
315
+ $metadata: deserializeMetadata(parsedOutput),
316
+ ...contents,
317
+ });
318
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
319
+ };
320
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
321
+ const contents = map({});
322
+ const data = parsedOutput.body;
323
+ if (data.message != null) {
324
+ contents.message = (0, smithy_client_1.expectString)(data.message);
325
+ }
326
+ const exception = new models_0_1.InternalServerException({
327
+ $metadata: deserializeMetadata(parsedOutput),
328
+ ...contents,
329
+ });
330
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
331
+ };
332
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
333
+ const contents = map({});
334
+ const data = parsedOutput.body;
335
+ if (data.message != null) {
336
+ contents.message = (0, smithy_client_1.expectString)(data.message);
337
+ }
338
+ const exception = new models_0_1.ResourceNotFoundException({
339
+ $metadata: deserializeMetadata(parsedOutput),
340
+ ...contents,
341
+ });
342
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
343
+ };
344
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
345
+ const contents = map({});
346
+ const data = parsedOutput.body;
347
+ if (data.message != null) {
348
+ contents.message = (0, smithy_client_1.expectString)(data.message);
349
+ }
350
+ const exception = new models_0_1.ServiceQuotaExceededException({
351
+ $metadata: deserializeMetadata(parsedOutput),
352
+ ...contents,
353
+ });
354
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
355
+ };
356
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
357
+ const contents = map({
358
+ retryAfterSeconds: [
359
+ () => void 0 !== parsedOutput.headers["retry-after"],
360
+ () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
361
+ ],
362
+ });
363
+ const data = parsedOutput.body;
364
+ if (data.message != null) {
365
+ contents.message = (0, smithy_client_1.expectString)(data.message);
366
+ }
367
+ if (data.quotaCode != null) {
368
+ contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
369
+ }
370
+ if (data.serviceCode != null) {
371
+ contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
372
+ }
373
+ const exception = new models_0_1.ThrottlingException({
374
+ $metadata: deserializeMetadata(parsedOutput),
375
+ ...contents,
376
+ });
377
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
378
+ };
379
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
380
+ const contents = map({});
381
+ const data = parsedOutput.body;
382
+ if (data.message != null) {
383
+ contents.message = (0, smithy_client_1.expectString)(data.message);
384
+ }
385
+ const exception = new models_0_1.ValidationException({
386
+ $metadata: deserializeMetadata(parsedOutput),
387
+ ...contents,
388
+ });
389
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
390
+ };
391
+ const deserializeAws_restJson1ControlOperation = (output, context) => {
392
+ return {
393
+ endTime: output.endTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.endTime)) : undefined,
394
+ operationType: (0, smithy_client_1.expectString)(output.operationType),
395
+ startTime: output.startTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.startTime)) : undefined,
396
+ status: (0, smithy_client_1.expectString)(output.status),
397
+ statusMessage: (0, smithy_client_1.expectString)(output.statusMessage),
398
+ };
399
+ };
400
+ const deserializeAws_restJson1EnabledControls = (output, context) => {
401
+ const retVal = (output || [])
402
+ .filter((e) => e != null)
403
+ .map((entry) => {
404
+ if (entry === null) {
405
+ return null;
406
+ }
407
+ return deserializeAws_restJson1EnabledControlSummary(entry, context);
408
+ });
409
+ return retVal;
410
+ };
411
+ const deserializeAws_restJson1EnabledControlSummary = (output, context) => {
412
+ return {
413
+ controlIdentifier: (0, smithy_client_1.expectString)(output.controlIdentifier),
414
+ };
415
+ };
416
+ const deserializeMetadata = (output) => {
417
+ var _a;
418
+ return ({
419
+ httpStatusCode: output.statusCode,
420
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
421
+ extendedRequestId: output.headers["x-amz-id-2"],
422
+ cfId: output.headers["x-amz-cf-id"],
423
+ });
424
+ };
425
+ const collectBody = (streamBody = new Uint8Array(), context) => {
426
+ if (streamBody instanceof Uint8Array) {
427
+ return Promise.resolve(streamBody);
428
+ }
429
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
430
+ };
431
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
432
+ const isSerializableHeaderValue = (value) => value !== undefined &&
433
+ value !== null &&
434
+ value !== "" &&
435
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
436
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
437
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
438
+ if (encoded.length) {
439
+ return JSON.parse(encoded);
440
+ }
441
+ return {};
442
+ });
443
+ const loadRestJsonErrorCode = (output, data) => {
444
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
445
+ const sanitizeErrorCode = (rawValue) => {
446
+ let cleanValue = rawValue;
447
+ if (typeof cleanValue === "number") {
448
+ cleanValue = cleanValue.toString();
449
+ }
450
+ if (cleanValue.indexOf(":") >= 0) {
451
+ cleanValue = cleanValue.split(":")[0];
452
+ }
453
+ if (cleanValue.indexOf("#") >= 0) {
454
+ cleanValue = cleanValue.split("#")[1];
455
+ }
456
+ return cleanValue;
457
+ };
458
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
459
+ if (headerKey !== undefined) {
460
+ return sanitizeErrorCode(output.headers[headerKey]);
461
+ }
462
+ if (data.code !== undefined) {
463
+ return sanitizeErrorCode(data.code);
464
+ }
465
+ if (data["__type"] !== undefined) {
466
+ return sanitizeErrorCode(data["__type"]);
467
+ }
468
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
+ const config_resolver_1 = require("@aws-sdk/config-resolver");
8
+ const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler");
9
+ const invalid_dependency_1 = require("@aws-sdk/invalid-dependency");
10
+ const middleware_retry_1 = require("@aws-sdk/middleware-retry");
11
+ const util_base64_browser_1 = require("@aws-sdk/util-base64-browser");
12
+ const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser");
13
+ const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
14
+ const util_utf8_browser_1 = require("@aws-sdk/util-utf8-browser");
15
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
16
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
17
+ const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser");
18
+ const getRuntimeConfig = (config) => {
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20
+ const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
21
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
22
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
23
+ return {
24
+ ...clientSharedValues,
25
+ ...config,
26
+ runtime: "browser",
27
+ defaultsMode,
28
+ base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_browser_1.fromBase64,
29
+ base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_browser_1.toBase64,
30
+ bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : util_body_length_browser_1.calculateBodyLength,
31
+ credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : ((_) => () => Promise.reject(new Error("Credential is missing"))),
32
+ defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
33
+ maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : middleware_retry_1.DEFAULT_MAX_ATTEMPTS,
34
+ region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : (0, invalid_dependency_1.invalidProvider)("Region is missing"),
35
+ requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
36
+ retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE),
37
+ sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : sha256_browser_1.Sha256,
38
+ streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : fetch_http_handler_1.streamCollector,
39
+ useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
40
+ useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
41
+ utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_browser_1.fromUtf8,
42
+ utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_browser_1.toUtf8,
43
+ };
44
+ };
45
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const client_sts_1 = require("@aws-sdk/client-sts");
7
+ const config_resolver_1 = require("@aws-sdk/config-resolver");
8
+ const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
9
+ const hash_node_1 = require("@aws-sdk/hash-node");
10
+ const middleware_retry_1 = require("@aws-sdk/middleware-retry");
11
+ const node_config_provider_1 = require("@aws-sdk/node-config-provider");
12
+ const node_http_handler_1 = require("@aws-sdk/node-http-handler");
13
+ const util_base64_node_1 = require("@aws-sdk/util-base64-node");
14
+ const util_body_length_node_1 = require("@aws-sdk/util-body-length-node");
15
+ const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
16
+ const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
17
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
18
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
19
+ const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node");
20
+ const smithy_client_2 = require("@aws-sdk/smithy-client");
21
+ const getRuntimeConfig = (config) => {
22
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
23
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
24
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
25
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
26
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
27
+ return {
28
+ ...clientSharedValues,
29
+ ...config,
30
+ runtime: "node",
31
+ defaultsMode,
32
+ base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_node_1.fromBase64,
33
+ base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_node_1.toBase64,
34
+ bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : util_body_length_node_1.calculateBodyLength,
35
+ credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
36
+ defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
37
+ maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
38
+ region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
39
+ requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
40
+ retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (0, node_config_provider_1.loadConfig)({
41
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
42
+ default: async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE,
43
+ }),
44
+ sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : hash_node_1.Hash.bind(null, "sha256"),
45
+ streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : node_http_handler_1.streamCollector,
46
+ useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
47
+ useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
48
+ utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_node_1.fromUtf8,
49
+ utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_node_1.toUtf8,
50
+ };
51
+ };
52
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
+ const getRuntimeConfig = (config) => {
7
+ var _a;
8
+ const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
9
+ return {
10
+ ...browserDefaults,
11
+ ...config,
12
+ runtime: "react-native",
13
+ sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : sha256_js_1.Sha256,
14
+ };
15
+ };
16
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const url_parser_1 = require("@aws-sdk/url-parser");
5
+ const endpoints_1 = require("./endpoints");
6
+ const getRuntimeConfig = (config) => {
7
+ var _a, _b, _c, _d, _e;
8
+ return ({
9
+ apiVersion: "2018-05-10",
10
+ disableHostPrefix: (_a = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _a !== void 0 ? _a : false,
11
+ logger: (_b = config === null || config === void 0 ? void 0 : config.logger) !== null && _b !== void 0 ? _b : {},
12
+ regionInfoProvider: (_c = config === null || config === void 0 ? void 0 : config.regionInfoProvider) !== null && _c !== void 0 ? _c : endpoints_1.defaultRegionInfoProvider,
13
+ serviceId: (_d = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _d !== void 0 ? _d : "ControlTower",
14
+ urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : url_parser_1.parseUrl,
15
+ });
16
+ };
17
+ exports.getRuntimeConfig = getRuntimeConfig;