@aws-sdk/client-controlcatalog 3.891.0 → 3.894.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.
@@ -1,395 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListObjectivesCommand = exports.de_ListDomainsCommand = exports.de_ListControlsCommand = exports.de_ListControlMappingsCommand = exports.de_ListCommonControlsCommand = exports.de_GetControlCommand = exports.se_ListObjectivesCommand = exports.se_ListDomainsCommand = exports.se_ListControlsCommand = exports.se_ListControlMappingsCommand = exports.se_ListCommonControlsCommand = exports.se_GetControlCommand = void 0;
4
- const core_1 = require("@aws-sdk/core");
5
- const core_2 = require("@smithy/core");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const ControlCatalogServiceException_1 = require("../models/ControlCatalogServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_GetControlCommand = async (input, context) => {
10
- const b = (0, core_2.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/get-control");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- ControlArn: [],
18
- }));
19
- b.m("POST").h(headers).b(body);
20
- return b.build();
21
- };
22
- exports.se_GetControlCommand = se_GetControlCommand;
23
- const se_ListCommonControlsCommand = async (input, context) => {
24
- const b = (0, core_2.requestBuilder)(input, context);
25
- const headers = {
26
- "content-type": "application/json",
27
- };
28
- b.bp("/common-controls");
29
- const query = (0, smithy_client_1.map)({
30
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
31
- [_nT]: [, input[_NT]],
32
- });
33
- let body;
34
- body = JSON.stringify((0, smithy_client_1.take)(input, {
35
- CommonControlFilter: (_) => (0, smithy_client_1._json)(_),
36
- }));
37
- b.m("POST").h(headers).q(query).b(body);
38
- return b.build();
39
- };
40
- exports.se_ListCommonControlsCommand = se_ListCommonControlsCommand;
41
- const se_ListControlMappingsCommand = async (input, context) => {
42
- const b = (0, core_2.requestBuilder)(input, context);
43
- const headers = {
44
- "content-type": "application/json",
45
- };
46
- b.bp("/list-control-mappings");
47
- const query = (0, smithy_client_1.map)({
48
- [_nT]: [, input[_NT]],
49
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
50
- });
51
- let body;
52
- body = JSON.stringify((0, smithy_client_1.take)(input, {
53
- Filter: (_) => (0, smithy_client_1._json)(_),
54
- }));
55
- b.m("POST").h(headers).q(query).b(body);
56
- return b.build();
57
- };
58
- exports.se_ListControlMappingsCommand = se_ListControlMappingsCommand;
59
- const se_ListControlsCommand = async (input, context) => {
60
- const b = (0, core_2.requestBuilder)(input, context);
61
- const headers = {
62
- "content-type": "application/json",
63
- };
64
- b.bp("/list-controls");
65
- const query = (0, smithy_client_1.map)({
66
- [_nT]: [, input[_NT]],
67
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
68
- });
69
- let body;
70
- body = JSON.stringify((0, smithy_client_1.take)(input, {
71
- Filter: (_) => (0, smithy_client_1._json)(_),
72
- }));
73
- b.m("POST").h(headers).q(query).b(body);
74
- return b.build();
75
- };
76
- exports.se_ListControlsCommand = se_ListControlsCommand;
77
- const se_ListDomainsCommand = async (input, context) => {
78
- const b = (0, core_2.requestBuilder)(input, context);
79
- const headers = {};
80
- b.bp("/domains");
81
- const query = (0, smithy_client_1.map)({
82
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
83
- [_nT]: [, input[_NT]],
84
- });
85
- let body;
86
- b.m("POST").h(headers).q(query).b(body);
87
- return b.build();
88
- };
89
- exports.se_ListDomainsCommand = se_ListDomainsCommand;
90
- const se_ListObjectivesCommand = async (input, context) => {
91
- const b = (0, core_2.requestBuilder)(input, context);
92
- const headers = {
93
- "content-type": "application/json",
94
- };
95
- b.bp("/objectives");
96
- const query = (0, smithy_client_1.map)({
97
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
98
- [_nT]: [, input[_NT]],
99
- });
100
- let body;
101
- body = JSON.stringify((0, smithy_client_1.take)(input, {
102
- ObjectiveFilter: (_) => (0, smithy_client_1._json)(_),
103
- }));
104
- b.m("POST").h(headers).q(query).b(body);
105
- return b.build();
106
- };
107
- exports.se_ListObjectivesCommand = se_ListObjectivesCommand;
108
- const de_GetControlCommand = async (output, context) => {
109
- if (output.statusCode !== 200 && output.statusCode >= 300) {
110
- return de_CommandError(output, context);
111
- }
112
- const contents = (0, smithy_client_1.map)({
113
- $metadata: deserializeMetadata(output),
114
- });
115
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
116
- const doc = (0, smithy_client_1.take)(data, {
117
- Aliases: smithy_client_1._json,
118
- Arn: smithy_client_1.expectString,
119
- Behavior: smithy_client_1.expectString,
120
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
121
- Description: smithy_client_1.expectString,
122
- GovernedResources: smithy_client_1._json,
123
- Implementation: smithy_client_1._json,
124
- Name: smithy_client_1.expectString,
125
- Parameters: smithy_client_1._json,
126
- RegionConfiguration: smithy_client_1._json,
127
- Severity: smithy_client_1.expectString,
128
- });
129
- Object.assign(contents, doc);
130
- return contents;
131
- };
132
- exports.de_GetControlCommand = de_GetControlCommand;
133
- const de_ListCommonControlsCommand = async (output, context) => {
134
- if (output.statusCode !== 200 && output.statusCode >= 300) {
135
- return de_CommandError(output, context);
136
- }
137
- const contents = (0, smithy_client_1.map)({
138
- $metadata: deserializeMetadata(output),
139
- });
140
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
141
- const doc = (0, smithy_client_1.take)(data, {
142
- CommonControls: (_) => de_CommonControlSummaryList(_, context),
143
- NextToken: smithy_client_1.expectString,
144
- });
145
- Object.assign(contents, doc);
146
- return contents;
147
- };
148
- exports.de_ListCommonControlsCommand = de_ListCommonControlsCommand;
149
- const de_ListControlMappingsCommand = async (output, context) => {
150
- if (output.statusCode !== 200 && output.statusCode >= 300) {
151
- return de_CommandError(output, context);
152
- }
153
- const contents = (0, smithy_client_1.map)({
154
- $metadata: deserializeMetadata(output),
155
- });
156
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
157
- const doc = (0, smithy_client_1.take)(data, {
158
- ControlMappings: smithy_client_1._json,
159
- NextToken: smithy_client_1.expectString,
160
- });
161
- Object.assign(contents, doc);
162
- return contents;
163
- };
164
- exports.de_ListControlMappingsCommand = de_ListControlMappingsCommand;
165
- const de_ListControlsCommand = async (output, context) => {
166
- if (output.statusCode !== 200 && output.statusCode >= 300) {
167
- return de_CommandError(output, context);
168
- }
169
- const contents = (0, smithy_client_1.map)({
170
- $metadata: deserializeMetadata(output),
171
- });
172
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
173
- const doc = (0, smithy_client_1.take)(data, {
174
- Controls: (_) => de_Controls(_, context),
175
- NextToken: smithy_client_1.expectString,
176
- });
177
- Object.assign(contents, doc);
178
- return contents;
179
- };
180
- exports.de_ListControlsCommand = de_ListControlsCommand;
181
- const de_ListDomainsCommand = async (output, context) => {
182
- if (output.statusCode !== 200 && output.statusCode >= 300) {
183
- return de_CommandError(output, context);
184
- }
185
- const contents = (0, smithy_client_1.map)({
186
- $metadata: deserializeMetadata(output),
187
- });
188
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
189
- const doc = (0, smithy_client_1.take)(data, {
190
- Domains: (_) => de_DomainSummaryList(_, context),
191
- NextToken: smithy_client_1.expectString,
192
- });
193
- Object.assign(contents, doc);
194
- return contents;
195
- };
196
- exports.de_ListDomainsCommand = de_ListDomainsCommand;
197
- const de_ListObjectivesCommand = async (output, context) => {
198
- if (output.statusCode !== 200 && output.statusCode >= 300) {
199
- return de_CommandError(output, context);
200
- }
201
- const contents = (0, smithy_client_1.map)({
202
- $metadata: deserializeMetadata(output),
203
- });
204
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
205
- const doc = (0, smithy_client_1.take)(data, {
206
- NextToken: smithy_client_1.expectString,
207
- Objectives: (_) => de_ObjectiveSummaryList(_, context),
208
- });
209
- Object.assign(contents, doc);
210
- return contents;
211
- };
212
- exports.de_ListObjectivesCommand = de_ListObjectivesCommand;
213
- const de_CommandError = async (output, context) => {
214
- const parsedOutput = {
215
- ...output,
216
- body: await (0, core_1.parseJsonErrorBody)(output.body, context),
217
- };
218
- const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
219
- switch (errorCode) {
220
- case "AccessDeniedException":
221
- case "com.amazonaws.controlcatalog#AccessDeniedException":
222
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
223
- case "InternalServerException":
224
- case "com.amazonaws.controlcatalog#InternalServerException":
225
- throw await de_InternalServerExceptionRes(parsedOutput, context);
226
- case "ResourceNotFoundException":
227
- case "com.amazonaws.controlcatalog#ResourceNotFoundException":
228
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
229
- case "ThrottlingException":
230
- case "com.amazonaws.controlcatalog#ThrottlingException":
231
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
232
- case "ValidationException":
233
- case "com.amazonaws.controlcatalog#ValidationException":
234
- throw await de_ValidationExceptionRes(parsedOutput, context);
235
- default:
236
- const parsedBody = parsedOutput.body;
237
- return throwDefaultError({
238
- output,
239
- parsedBody,
240
- errorCode,
241
- });
242
- }
243
- };
244
- const throwDefaultError = (0, smithy_client_1.withBaseException)(ControlCatalogServiceException_1.ControlCatalogServiceException);
245
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
246
- const contents = (0, smithy_client_1.map)({});
247
- const data = parsedOutput.body;
248
- const doc = (0, smithy_client_1.take)(data, {
249
- Message: smithy_client_1.expectString,
250
- });
251
- Object.assign(contents, doc);
252
- const exception = new models_0_1.AccessDeniedException({
253
- $metadata: deserializeMetadata(parsedOutput),
254
- ...contents,
255
- });
256
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
257
- };
258
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
259
- const contents = (0, smithy_client_1.map)({});
260
- const data = parsedOutput.body;
261
- const doc = (0, smithy_client_1.take)(data, {
262
- Message: smithy_client_1.expectString,
263
- });
264
- Object.assign(contents, doc);
265
- const exception = new models_0_1.InternalServerException({
266
- $metadata: deserializeMetadata(parsedOutput),
267
- ...contents,
268
- });
269
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
270
- };
271
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
272
- const contents = (0, smithy_client_1.map)({});
273
- const data = parsedOutput.body;
274
- const doc = (0, smithy_client_1.take)(data, {
275
- Message: smithy_client_1.expectString,
276
- });
277
- Object.assign(contents, doc);
278
- const exception = new models_0_1.ResourceNotFoundException({
279
- $metadata: deserializeMetadata(parsedOutput),
280
- ...contents,
281
- });
282
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
283
- };
284
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
285
- const contents = (0, smithy_client_1.map)({});
286
- const data = parsedOutput.body;
287
- const doc = (0, smithy_client_1.take)(data, {
288
- Message: smithy_client_1.expectString,
289
- });
290
- Object.assign(contents, doc);
291
- const exception = new models_0_1.ThrottlingException({
292
- $metadata: deserializeMetadata(parsedOutput),
293
- ...contents,
294
- });
295
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
296
- };
297
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
298
- const contents = (0, smithy_client_1.map)({});
299
- const data = parsedOutput.body;
300
- const doc = (0, smithy_client_1.take)(data, {
301
- Message: smithy_client_1.expectString,
302
- });
303
- Object.assign(contents, doc);
304
- const exception = new models_0_1.ValidationException({
305
- $metadata: deserializeMetadata(parsedOutput),
306
- ...contents,
307
- });
308
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
309
- };
310
- const de_CommonControlSummary = (output, context) => {
311
- return (0, smithy_client_1.take)(output, {
312
- Arn: smithy_client_1.expectString,
313
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
314
- Description: smithy_client_1.expectString,
315
- Domain: smithy_client_1._json,
316
- LastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
317
- Name: smithy_client_1.expectString,
318
- Objective: smithy_client_1._json,
319
- });
320
- };
321
- const de_CommonControlSummaryList = (output, context) => {
322
- const retVal = (output || [])
323
- .filter((e) => e != null)
324
- .map((entry) => {
325
- return de_CommonControlSummary(entry, context);
326
- });
327
- return retVal;
328
- };
329
- const de_Controls = (output, context) => {
330
- const retVal = (output || [])
331
- .filter((e) => e != null)
332
- .map((entry) => {
333
- return de_ControlSummary(entry, context);
334
- });
335
- return retVal;
336
- };
337
- const de_ControlSummary = (output, context) => {
338
- return (0, smithy_client_1.take)(output, {
339
- Aliases: smithy_client_1._json,
340
- Arn: smithy_client_1.expectString,
341
- Behavior: smithy_client_1.expectString,
342
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
343
- Description: smithy_client_1.expectString,
344
- GovernedResources: smithy_client_1._json,
345
- Implementation: smithy_client_1._json,
346
- Name: smithy_client_1.expectString,
347
- Severity: smithy_client_1.expectString,
348
- });
349
- };
350
- const de_DomainSummary = (output, context) => {
351
- return (0, smithy_client_1.take)(output, {
352
- Arn: smithy_client_1.expectString,
353
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
354
- Description: smithy_client_1.expectString,
355
- LastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
356
- Name: smithy_client_1.expectString,
357
- });
358
- };
359
- const de_DomainSummaryList = (output, context) => {
360
- const retVal = (output || [])
361
- .filter((e) => e != null)
362
- .map((entry) => {
363
- return de_DomainSummary(entry, context);
364
- });
365
- return retVal;
366
- };
367
- const de_ObjectiveSummary = (output, context) => {
368
- return (0, smithy_client_1.take)(output, {
369
- Arn: smithy_client_1.expectString,
370
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
371
- Description: smithy_client_1.expectString,
372
- Domain: smithy_client_1._json,
373
- LastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
374
- Name: smithy_client_1.expectString,
375
- });
376
- };
377
- const de_ObjectiveSummaryList = (output, context) => {
378
- const retVal = (output || [])
379
- .filter((e) => e != null)
380
- .map((entry) => {
381
- return de_ObjectiveSummary(entry, context);
382
- });
383
- return retVal;
384
- };
385
- const deserializeMetadata = (output) => ({
386
- httpStatusCode: output.statusCode,
387
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
388
- extendedRequestId: output.headers["x-amz-id-2"],
389
- cfId: output.headers["x-amz-cf-id"],
390
- });
391
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
392
- const _MR = "MaxResults";
393
- const _NT = "NextToken";
394
- const _mR = "maxResults";
395
- const _nT = "nextToken";
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));
10
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
11
- return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));
12
- };
13
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;