@aws-sdk/client-accessanalyzer 3.489.0 → 3.495.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 (56) hide show
  1. package/dist-cjs/AccessAnalyzer.js +1 -75
  2. package/dist-cjs/AccessAnalyzerClient.js +1 -43
  3. package/dist-cjs/commands/ApplyArchiveRuleCommand.js +1 -28
  4. package/dist-cjs/commands/CancelPolicyGenerationCommand.js +1 -28
  5. package/dist-cjs/commands/CheckAccessNotGrantedCommand.js +1 -29
  6. package/dist-cjs/commands/CheckNoNewAccessCommand.js +1 -29
  7. package/dist-cjs/commands/CreateAccessPreviewCommand.js +1 -28
  8. package/dist-cjs/commands/CreateAnalyzerCommand.js +1 -28
  9. package/dist-cjs/commands/CreateArchiveRuleCommand.js +1 -28
  10. package/dist-cjs/commands/DeleteAnalyzerCommand.js +1 -28
  11. package/dist-cjs/commands/DeleteArchiveRuleCommand.js +1 -28
  12. package/dist-cjs/commands/GetAccessPreviewCommand.js +1 -28
  13. package/dist-cjs/commands/GetAnalyzedResourceCommand.js +1 -28
  14. package/dist-cjs/commands/GetAnalyzerCommand.js +1 -28
  15. package/dist-cjs/commands/GetArchiveRuleCommand.js +1 -28
  16. package/dist-cjs/commands/GetFindingCommand.js +1 -28
  17. package/dist-cjs/commands/GetFindingV2Command.js +1 -28
  18. package/dist-cjs/commands/GetGeneratedPolicyCommand.js +1 -28
  19. package/dist-cjs/commands/ListAccessPreviewFindingsCommand.js +1 -28
  20. package/dist-cjs/commands/ListAccessPreviewsCommand.js +1 -28
  21. package/dist-cjs/commands/ListAnalyzedResourcesCommand.js +1 -28
  22. package/dist-cjs/commands/ListAnalyzersCommand.js +1 -28
  23. package/dist-cjs/commands/ListArchiveRulesCommand.js +1 -28
  24. package/dist-cjs/commands/ListFindingsCommand.js +1 -28
  25. package/dist-cjs/commands/ListFindingsV2Command.js +1 -28
  26. package/dist-cjs/commands/ListPolicyGenerationsCommand.js +1 -28
  27. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  28. package/dist-cjs/commands/StartPolicyGenerationCommand.js +1 -28
  29. package/dist-cjs/commands/StartResourceScanCommand.js +1 -28
  30. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  31. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  32. package/dist-cjs/commands/UpdateArchiveRuleCommand.js +1 -28
  33. package/dist-cjs/commands/UpdateFindingsCommand.js +1 -28
  34. package/dist-cjs/commands/ValidatePolicyCommand.js +1 -28
  35. package/dist-cjs/commands/index.js +1 -35
  36. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  37. package/dist-cjs/extensionConfiguration.js +1 -2
  38. package/dist-cjs/index.js +3704 -11
  39. package/dist-cjs/models/AccessAnalyzerServiceException.js +1 -12
  40. package/dist-cjs/models/index.js +1 -4
  41. package/dist-cjs/models/models_0.js +1 -356
  42. package/dist-cjs/pagination/GetFindingV2Paginator.js +1 -7
  43. package/dist-cjs/pagination/Interfaces.js +1 -2
  44. package/dist-cjs/pagination/ListAccessPreviewFindingsPaginator.js +1 -7
  45. package/dist-cjs/pagination/ListAccessPreviewsPaginator.js +1 -7
  46. package/dist-cjs/pagination/ListAnalyzedResourcesPaginator.js +1 -7
  47. package/dist-cjs/pagination/ListAnalyzersPaginator.js +1 -7
  48. package/dist-cjs/pagination/ListArchiveRulesPaginator.js +1 -7
  49. package/dist-cjs/pagination/ListFindingsPaginator.js +1 -7
  50. package/dist-cjs/pagination/ListFindingsV2Paginator.js +1 -7
  51. package/dist-cjs/pagination/ListPolicyGenerationsPaginator.js +1 -7
  52. package/dist-cjs/pagination/ValidatePolicyPaginator.js +1 -7
  53. package/dist-cjs/pagination/index.js +1 -14
  54. package/dist-cjs/protocols/Aws_restJson1.js +1 -2452
  55. package/dist-cjs/runtimeExtensions.js +1 -22
  56. package/package.json +40 -40
@@ -1,2452 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListAccessPreviewsCommand = exports.de_ListAccessPreviewFindingsCommand = exports.de_GetGeneratedPolicyCommand = exports.de_GetFindingV2Command = exports.de_GetFindingCommand = exports.de_GetArchiveRuleCommand = exports.de_GetAnalyzerCommand = exports.de_GetAnalyzedResourceCommand = exports.de_GetAccessPreviewCommand = exports.de_DeleteArchiveRuleCommand = exports.de_DeleteAnalyzerCommand = exports.de_CreateArchiveRuleCommand = exports.de_CreateAnalyzerCommand = exports.de_CreateAccessPreviewCommand = exports.de_CheckNoNewAccessCommand = exports.de_CheckAccessNotGrantedCommand = exports.de_CancelPolicyGenerationCommand = exports.de_ApplyArchiveRuleCommand = exports.se_ValidatePolicyCommand = exports.se_UpdateFindingsCommand = exports.se_UpdateArchiveRuleCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartResourceScanCommand = exports.se_StartPolicyGenerationCommand = exports.se_ListTagsForResourceCommand = exports.se_ListPolicyGenerationsCommand = exports.se_ListFindingsV2Command = exports.se_ListFindingsCommand = exports.se_ListArchiveRulesCommand = exports.se_ListAnalyzersCommand = exports.se_ListAnalyzedResourcesCommand = exports.se_ListAccessPreviewsCommand = exports.se_ListAccessPreviewFindingsCommand = exports.se_GetGeneratedPolicyCommand = exports.se_GetFindingV2Command = exports.se_GetFindingCommand = exports.se_GetArchiveRuleCommand = exports.se_GetAnalyzerCommand = exports.se_GetAnalyzedResourceCommand = exports.se_GetAccessPreviewCommand = exports.se_DeleteArchiveRuleCommand = exports.se_DeleteAnalyzerCommand = exports.se_CreateArchiveRuleCommand = exports.se_CreateAnalyzerCommand = exports.se_CreateAccessPreviewCommand = exports.se_CheckNoNewAccessCommand = exports.se_CheckAccessNotGrantedCommand = exports.se_CancelPolicyGenerationCommand = exports.se_ApplyArchiveRuleCommand = void 0;
4
- exports.de_ValidatePolicyCommand = exports.de_UpdateFindingsCommand = exports.de_UpdateArchiveRuleCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartResourceScanCommand = exports.de_StartPolicyGenerationCommand = exports.de_ListTagsForResourceCommand = exports.de_ListPolicyGenerationsCommand = exports.de_ListFindingsV2Command = exports.de_ListFindingsCommand = exports.de_ListArchiveRulesCommand = exports.de_ListAnalyzersCommand = exports.de_ListAnalyzedResourcesCommand = void 0;
5
- const core_1 = require("@aws-sdk/core");
6
- const core_2 = require("@smithy/core");
7
- const smithy_client_1 = require("@smithy/smithy-client");
8
- const uuid_1 = require("uuid");
9
- const AccessAnalyzerServiceException_1 = require("../models/AccessAnalyzerServiceException");
10
- const models_0_1 = require("../models/models_0");
11
- const se_ApplyArchiveRuleCommand = async (input, context) => {
12
- const b = (0, core_2.requestBuilder)(input, context);
13
- const headers = {
14
- "content-type": "application/json",
15
- };
16
- b.bp("/archive-rule");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1.take)(input, {
19
- analyzerArn: [],
20
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
21
- ruleName: [],
22
- }));
23
- b.m("PUT").h(headers).b(body);
24
- return b.build();
25
- };
26
- exports.se_ApplyArchiveRuleCommand = se_ApplyArchiveRuleCommand;
27
- const se_CancelPolicyGenerationCommand = async (input, context) => {
28
- const b = (0, core_2.requestBuilder)(input, context);
29
- const headers = {};
30
- b.bp("/policy/generation/{jobId}");
31
- b.p("jobId", () => input.jobId, "{jobId}", false);
32
- let body;
33
- b.m("PUT").h(headers).b(body);
34
- return b.build();
35
- };
36
- exports.se_CancelPolicyGenerationCommand = se_CancelPolicyGenerationCommand;
37
- const se_CheckAccessNotGrantedCommand = async (input, context) => {
38
- const b = (0, core_2.requestBuilder)(input, context);
39
- const headers = {
40
- "content-type": "application/json",
41
- };
42
- b.bp("/policy/check-access-not-granted");
43
- let body;
44
- body = JSON.stringify((0, smithy_client_1.take)(input, {
45
- access: (_) => (0, smithy_client_1._json)(_),
46
- policyDocument: [],
47
- policyType: [],
48
- }));
49
- b.m("POST").h(headers).b(body);
50
- return b.build();
51
- };
52
- exports.se_CheckAccessNotGrantedCommand = se_CheckAccessNotGrantedCommand;
53
- const se_CheckNoNewAccessCommand = async (input, context) => {
54
- const b = (0, core_2.requestBuilder)(input, context);
55
- const headers = {
56
- "content-type": "application/json",
57
- };
58
- b.bp("/policy/check-no-new-access");
59
- let body;
60
- body = JSON.stringify((0, smithy_client_1.take)(input, {
61
- existingPolicyDocument: [],
62
- newPolicyDocument: [],
63
- policyType: [],
64
- }));
65
- b.m("POST").h(headers).b(body);
66
- return b.build();
67
- };
68
- exports.se_CheckNoNewAccessCommand = se_CheckNoNewAccessCommand;
69
- const se_CreateAccessPreviewCommand = async (input, context) => {
70
- const b = (0, core_2.requestBuilder)(input, context);
71
- const headers = {
72
- "content-type": "application/json",
73
- };
74
- b.bp("/access-preview");
75
- let body;
76
- body = JSON.stringify((0, smithy_client_1.take)(input, {
77
- analyzerArn: [],
78
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
79
- configurations: (_) => (0, smithy_client_1._json)(_),
80
- }));
81
- b.m("PUT").h(headers).b(body);
82
- return b.build();
83
- };
84
- exports.se_CreateAccessPreviewCommand = se_CreateAccessPreviewCommand;
85
- const se_CreateAnalyzerCommand = async (input, context) => {
86
- const b = (0, core_2.requestBuilder)(input, context);
87
- const headers = {
88
- "content-type": "application/json",
89
- };
90
- b.bp("/analyzer");
91
- let body;
92
- body = JSON.stringify((0, smithy_client_1.take)(input, {
93
- analyzerName: [],
94
- archiveRules: (_) => (0, smithy_client_1._json)(_),
95
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
96
- configuration: (_) => (0, smithy_client_1._json)(_),
97
- tags: (_) => (0, smithy_client_1._json)(_),
98
- type: [],
99
- }));
100
- b.m("PUT").h(headers).b(body);
101
- return b.build();
102
- };
103
- exports.se_CreateAnalyzerCommand = se_CreateAnalyzerCommand;
104
- const se_CreateArchiveRuleCommand = async (input, context) => {
105
- const b = (0, core_2.requestBuilder)(input, context);
106
- const headers = {
107
- "content-type": "application/json",
108
- };
109
- b.bp("/analyzer/{analyzerName}/archive-rule");
110
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
111
- let body;
112
- body = JSON.stringify((0, smithy_client_1.take)(input, {
113
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
114
- filter: (_) => (0, smithy_client_1._json)(_),
115
- ruleName: [],
116
- }));
117
- b.m("PUT").h(headers).b(body);
118
- return b.build();
119
- };
120
- exports.se_CreateArchiveRuleCommand = se_CreateArchiveRuleCommand;
121
- const se_DeleteAnalyzerCommand = async (input, context) => {
122
- const b = (0, core_2.requestBuilder)(input, context);
123
- const headers = {};
124
- b.bp("/analyzer/{analyzerName}");
125
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
126
- const query = (0, smithy_client_1.map)({
127
- [_cT]: [, input[_cT] ?? (0, uuid_1.v4)()],
128
- });
129
- let body;
130
- b.m("DELETE").h(headers).q(query).b(body);
131
- return b.build();
132
- };
133
- exports.se_DeleteAnalyzerCommand = se_DeleteAnalyzerCommand;
134
- const se_DeleteArchiveRuleCommand = async (input, context) => {
135
- const b = (0, core_2.requestBuilder)(input, context);
136
- const headers = {};
137
- b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
138
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
139
- b.p("ruleName", () => input.ruleName, "{ruleName}", false);
140
- const query = (0, smithy_client_1.map)({
141
- [_cT]: [, input[_cT] ?? (0, uuid_1.v4)()],
142
- });
143
- let body;
144
- b.m("DELETE").h(headers).q(query).b(body);
145
- return b.build();
146
- };
147
- exports.se_DeleteArchiveRuleCommand = se_DeleteArchiveRuleCommand;
148
- const se_GetAccessPreviewCommand = async (input, context) => {
149
- const b = (0, core_2.requestBuilder)(input, context);
150
- const headers = {};
151
- b.bp("/access-preview/{accessPreviewId}");
152
- b.p("accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
153
- const query = (0, smithy_client_1.map)({
154
- [_aA]: [, (0, smithy_client_1.expectNonNull)(input[_aA], `analyzerArn`)],
155
- });
156
- let body;
157
- b.m("GET").h(headers).q(query).b(body);
158
- return b.build();
159
- };
160
- exports.se_GetAccessPreviewCommand = se_GetAccessPreviewCommand;
161
- const se_GetAnalyzedResourceCommand = async (input, context) => {
162
- const b = (0, core_2.requestBuilder)(input, context);
163
- const headers = {};
164
- b.bp("/analyzed-resource");
165
- const query = (0, smithy_client_1.map)({
166
- [_aA]: [, (0, smithy_client_1.expectNonNull)(input[_aA], `analyzerArn`)],
167
- [_rA]: [, (0, smithy_client_1.expectNonNull)(input[_rA], `resourceArn`)],
168
- });
169
- let body;
170
- b.m("GET").h(headers).q(query).b(body);
171
- return b.build();
172
- };
173
- exports.se_GetAnalyzedResourceCommand = se_GetAnalyzedResourceCommand;
174
- const se_GetAnalyzerCommand = async (input, context) => {
175
- const b = (0, core_2.requestBuilder)(input, context);
176
- const headers = {};
177
- b.bp("/analyzer/{analyzerName}");
178
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
179
- let body;
180
- b.m("GET").h(headers).b(body);
181
- return b.build();
182
- };
183
- exports.se_GetAnalyzerCommand = se_GetAnalyzerCommand;
184
- const se_GetArchiveRuleCommand = async (input, context) => {
185
- const b = (0, core_2.requestBuilder)(input, context);
186
- const headers = {};
187
- b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
188
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
189
- b.p("ruleName", () => input.ruleName, "{ruleName}", false);
190
- let body;
191
- b.m("GET").h(headers).b(body);
192
- return b.build();
193
- };
194
- exports.se_GetArchiveRuleCommand = se_GetArchiveRuleCommand;
195
- const se_GetFindingCommand = async (input, context) => {
196
- const b = (0, core_2.requestBuilder)(input, context);
197
- const headers = {};
198
- b.bp("/finding/{id}");
199
- b.p("id", () => input.id, "{id}", false);
200
- const query = (0, smithy_client_1.map)({
201
- [_aA]: [, (0, smithy_client_1.expectNonNull)(input[_aA], `analyzerArn`)],
202
- });
203
- let body;
204
- b.m("GET").h(headers).q(query).b(body);
205
- return b.build();
206
- };
207
- exports.se_GetFindingCommand = se_GetFindingCommand;
208
- const se_GetFindingV2Command = async (input, context) => {
209
- const b = (0, core_2.requestBuilder)(input, context);
210
- const headers = {};
211
- b.bp("/findingv2/{id}");
212
- b.p("id", () => input.id, "{id}", false);
213
- const query = (0, smithy_client_1.map)({
214
- [_aA]: [, (0, smithy_client_1.expectNonNull)(input[_aA], `analyzerArn`)],
215
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
216
- [_nT]: [, input[_nT]],
217
- });
218
- let body;
219
- b.m("GET").h(headers).q(query).b(body);
220
- return b.build();
221
- };
222
- exports.se_GetFindingV2Command = se_GetFindingV2Command;
223
- const se_GetGeneratedPolicyCommand = async (input, context) => {
224
- const b = (0, core_2.requestBuilder)(input, context);
225
- const headers = {};
226
- b.bp("/policy/generation/{jobId}");
227
- b.p("jobId", () => input.jobId, "{jobId}", false);
228
- const query = (0, smithy_client_1.map)({
229
- [_iRP]: [() => input.includeResourcePlaceholders !== void 0, () => input[_iRP].toString()],
230
- [_iSLT]: [() => input.includeServiceLevelTemplate !== void 0, () => input[_iSLT].toString()],
231
- });
232
- let body;
233
- b.m("GET").h(headers).q(query).b(body);
234
- return b.build();
235
- };
236
- exports.se_GetGeneratedPolicyCommand = se_GetGeneratedPolicyCommand;
237
- const se_ListAccessPreviewFindingsCommand = async (input, context) => {
238
- const b = (0, core_2.requestBuilder)(input, context);
239
- const headers = {
240
- "content-type": "application/json",
241
- };
242
- b.bp("/access-preview/{accessPreviewId}");
243
- b.p("accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
244
- let body;
245
- body = JSON.stringify((0, smithy_client_1.take)(input, {
246
- analyzerArn: [],
247
- filter: (_) => (0, smithy_client_1._json)(_),
248
- maxResults: [],
249
- nextToken: [],
250
- }));
251
- b.m("POST").h(headers).b(body);
252
- return b.build();
253
- };
254
- exports.se_ListAccessPreviewFindingsCommand = se_ListAccessPreviewFindingsCommand;
255
- const se_ListAccessPreviewsCommand = async (input, context) => {
256
- const b = (0, core_2.requestBuilder)(input, context);
257
- const headers = {};
258
- b.bp("/access-preview");
259
- const query = (0, smithy_client_1.map)({
260
- [_aA]: [, (0, smithy_client_1.expectNonNull)(input[_aA], `analyzerArn`)],
261
- [_nT]: [, input[_nT]],
262
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
263
- });
264
- let body;
265
- b.m("GET").h(headers).q(query).b(body);
266
- return b.build();
267
- };
268
- exports.se_ListAccessPreviewsCommand = se_ListAccessPreviewsCommand;
269
- const se_ListAnalyzedResourcesCommand = async (input, context) => {
270
- const b = (0, core_2.requestBuilder)(input, context);
271
- const headers = {
272
- "content-type": "application/json",
273
- };
274
- b.bp("/analyzed-resource");
275
- let body;
276
- body = JSON.stringify((0, smithy_client_1.take)(input, {
277
- analyzerArn: [],
278
- maxResults: [],
279
- nextToken: [],
280
- resourceType: [],
281
- }));
282
- b.m("POST").h(headers).b(body);
283
- return b.build();
284
- };
285
- exports.se_ListAnalyzedResourcesCommand = se_ListAnalyzedResourcesCommand;
286
- const se_ListAnalyzersCommand = async (input, context) => {
287
- const b = (0, core_2.requestBuilder)(input, context);
288
- const headers = {};
289
- b.bp("/analyzer");
290
- const query = (0, smithy_client_1.map)({
291
- [_nT]: [, input[_nT]],
292
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
293
- [_t]: [, input[_t]],
294
- });
295
- let body;
296
- b.m("GET").h(headers).q(query).b(body);
297
- return b.build();
298
- };
299
- exports.se_ListAnalyzersCommand = se_ListAnalyzersCommand;
300
- const se_ListArchiveRulesCommand = async (input, context) => {
301
- const b = (0, core_2.requestBuilder)(input, context);
302
- const headers = {};
303
- b.bp("/analyzer/{analyzerName}/archive-rule");
304
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
305
- const query = (0, smithy_client_1.map)({
306
- [_nT]: [, input[_nT]],
307
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
308
- });
309
- let body;
310
- b.m("GET").h(headers).q(query).b(body);
311
- return b.build();
312
- };
313
- exports.se_ListArchiveRulesCommand = se_ListArchiveRulesCommand;
314
- const se_ListFindingsCommand = async (input, context) => {
315
- const b = (0, core_2.requestBuilder)(input, context);
316
- const headers = {
317
- "content-type": "application/json",
318
- };
319
- b.bp("/finding");
320
- let body;
321
- body = JSON.stringify((0, smithy_client_1.take)(input, {
322
- analyzerArn: [],
323
- filter: (_) => (0, smithy_client_1._json)(_),
324
- maxResults: [],
325
- nextToken: [],
326
- sort: (_) => (0, smithy_client_1._json)(_),
327
- }));
328
- b.m("POST").h(headers).b(body);
329
- return b.build();
330
- };
331
- exports.se_ListFindingsCommand = se_ListFindingsCommand;
332
- const se_ListFindingsV2Command = async (input, context) => {
333
- const b = (0, core_2.requestBuilder)(input, context);
334
- const headers = {
335
- "content-type": "application/json",
336
- };
337
- b.bp("/findingv2");
338
- let body;
339
- body = JSON.stringify((0, smithy_client_1.take)(input, {
340
- analyzerArn: [],
341
- filter: (_) => (0, smithy_client_1._json)(_),
342
- maxResults: [],
343
- nextToken: [],
344
- sort: (_) => (0, smithy_client_1._json)(_),
345
- }));
346
- b.m("POST").h(headers).b(body);
347
- return b.build();
348
- };
349
- exports.se_ListFindingsV2Command = se_ListFindingsV2Command;
350
- const se_ListPolicyGenerationsCommand = async (input, context) => {
351
- const b = (0, core_2.requestBuilder)(input, context);
352
- const headers = {};
353
- b.bp("/policy/generation");
354
- const query = (0, smithy_client_1.map)({
355
- [_pA]: [, input[_pA]],
356
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
357
- [_nT]: [, input[_nT]],
358
- });
359
- let body;
360
- b.m("GET").h(headers).q(query).b(body);
361
- return b.build();
362
- };
363
- exports.se_ListPolicyGenerationsCommand = se_ListPolicyGenerationsCommand;
364
- const se_ListTagsForResourceCommand = async (input, context) => {
365
- const b = (0, core_2.requestBuilder)(input, context);
366
- const headers = {};
367
- b.bp("/tags/{resourceArn}");
368
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
369
- let body;
370
- b.m("GET").h(headers).b(body);
371
- return b.build();
372
- };
373
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
374
- const se_StartPolicyGenerationCommand = async (input, context) => {
375
- const b = (0, core_2.requestBuilder)(input, context);
376
- const headers = {
377
- "content-type": "application/json",
378
- };
379
- b.bp("/policy/generation");
380
- let body;
381
- body = JSON.stringify((0, smithy_client_1.take)(input, {
382
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
383
- cloudTrailDetails: (_) => se_CloudTrailDetails(_, context),
384
- policyGenerationDetails: (_) => (0, smithy_client_1._json)(_),
385
- }));
386
- b.m("PUT").h(headers).b(body);
387
- return b.build();
388
- };
389
- exports.se_StartPolicyGenerationCommand = se_StartPolicyGenerationCommand;
390
- const se_StartResourceScanCommand = async (input, context) => {
391
- const b = (0, core_2.requestBuilder)(input, context);
392
- const headers = {
393
- "content-type": "application/json",
394
- };
395
- b.bp("/resource/scan");
396
- let body;
397
- body = JSON.stringify((0, smithy_client_1.take)(input, {
398
- analyzerArn: [],
399
- resourceArn: [],
400
- resourceOwnerAccount: [],
401
- }));
402
- b.m("POST").h(headers).b(body);
403
- return b.build();
404
- };
405
- exports.se_StartResourceScanCommand = se_StartResourceScanCommand;
406
- const se_TagResourceCommand = async (input, context) => {
407
- const b = (0, core_2.requestBuilder)(input, context);
408
- const headers = {
409
- "content-type": "application/json",
410
- };
411
- b.bp("/tags/{resourceArn}");
412
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
413
- let body;
414
- body = JSON.stringify((0, smithy_client_1.take)(input, {
415
- tags: (_) => (0, smithy_client_1._json)(_),
416
- }));
417
- b.m("POST").h(headers).b(body);
418
- return b.build();
419
- };
420
- exports.se_TagResourceCommand = se_TagResourceCommand;
421
- const se_UntagResourceCommand = async (input, context) => {
422
- const b = (0, core_2.requestBuilder)(input, context);
423
- const headers = {};
424
- b.bp("/tags/{resourceArn}");
425
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
426
- const query = (0, smithy_client_1.map)({
427
- [_tK]: [
428
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
429
- () => (input[_tK] || []).map((_entry) => _entry),
430
- ],
431
- });
432
- let body;
433
- b.m("DELETE").h(headers).q(query).b(body);
434
- return b.build();
435
- };
436
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
437
- const se_UpdateArchiveRuleCommand = async (input, context) => {
438
- const b = (0, core_2.requestBuilder)(input, context);
439
- const headers = {
440
- "content-type": "application/json",
441
- };
442
- b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
443
- b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
444
- b.p("ruleName", () => input.ruleName, "{ruleName}", false);
445
- let body;
446
- body = JSON.stringify((0, smithy_client_1.take)(input, {
447
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
448
- filter: (_) => (0, smithy_client_1._json)(_),
449
- }));
450
- b.m("PUT").h(headers).b(body);
451
- return b.build();
452
- };
453
- exports.se_UpdateArchiveRuleCommand = se_UpdateArchiveRuleCommand;
454
- const se_UpdateFindingsCommand = async (input, context) => {
455
- const b = (0, core_2.requestBuilder)(input, context);
456
- const headers = {
457
- "content-type": "application/json",
458
- };
459
- b.bp("/finding");
460
- let body;
461
- body = JSON.stringify((0, smithy_client_1.take)(input, {
462
- analyzerArn: [],
463
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
464
- ids: (_) => (0, smithy_client_1._json)(_),
465
- resourceArn: [],
466
- status: [],
467
- }));
468
- b.m("PUT").h(headers).b(body);
469
- return b.build();
470
- };
471
- exports.se_UpdateFindingsCommand = se_UpdateFindingsCommand;
472
- const se_ValidatePolicyCommand = async (input, context) => {
473
- const b = (0, core_2.requestBuilder)(input, context);
474
- const headers = {
475
- "content-type": "application/json",
476
- };
477
- b.bp("/policy/validation");
478
- const query = (0, smithy_client_1.map)({
479
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
480
- [_nT]: [, input[_nT]],
481
- });
482
- let body;
483
- body = JSON.stringify((0, smithy_client_1.take)(input, {
484
- locale: [],
485
- policyDocument: [],
486
- policyType: [],
487
- validatePolicyResourceType: [],
488
- }));
489
- b.m("POST").h(headers).q(query).b(body);
490
- return b.build();
491
- };
492
- exports.se_ValidatePolicyCommand = se_ValidatePolicyCommand;
493
- const de_ApplyArchiveRuleCommand = async (output, context) => {
494
- if (output.statusCode !== 200 && output.statusCode >= 300) {
495
- return de_ApplyArchiveRuleCommandError(output, context);
496
- }
497
- const contents = (0, smithy_client_1.map)({
498
- $metadata: deserializeMetadata(output),
499
- });
500
- await (0, smithy_client_1.collectBody)(output.body, context);
501
- return contents;
502
- };
503
- exports.de_ApplyArchiveRuleCommand = de_ApplyArchiveRuleCommand;
504
- const de_ApplyArchiveRuleCommandError = async (output, context) => {
505
- const parsedOutput = {
506
- ...output,
507
- body: await parseErrorBody(output.body, context),
508
- };
509
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
- switch (errorCode) {
511
- case "AccessDeniedException":
512
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
513
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
514
- case "InternalServerException":
515
- case "com.amazonaws.accessanalyzer#InternalServerException":
516
- throw await de_InternalServerExceptionRes(parsedOutput, context);
517
- case "ResourceNotFoundException":
518
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
519
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
520
- case "ThrottlingException":
521
- case "com.amazonaws.accessanalyzer#ThrottlingException":
522
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
523
- case "ValidationException":
524
- case "com.amazonaws.accessanalyzer#ValidationException":
525
- throw await de_ValidationExceptionRes(parsedOutput, context);
526
- default:
527
- const parsedBody = parsedOutput.body;
528
- return throwDefaultError({
529
- output,
530
- parsedBody,
531
- errorCode,
532
- });
533
- }
534
- };
535
- const de_CancelPolicyGenerationCommand = async (output, context) => {
536
- if (output.statusCode !== 200 && output.statusCode >= 300) {
537
- return de_CancelPolicyGenerationCommandError(output, context);
538
- }
539
- const contents = (0, smithy_client_1.map)({
540
- $metadata: deserializeMetadata(output),
541
- });
542
- await (0, smithy_client_1.collectBody)(output.body, context);
543
- return contents;
544
- };
545
- exports.de_CancelPolicyGenerationCommand = de_CancelPolicyGenerationCommand;
546
- const de_CancelPolicyGenerationCommandError = async (output, context) => {
547
- const parsedOutput = {
548
- ...output,
549
- body: await parseErrorBody(output.body, context),
550
- };
551
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
552
- switch (errorCode) {
553
- case "AccessDeniedException":
554
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
555
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
556
- case "InternalServerException":
557
- case "com.amazonaws.accessanalyzer#InternalServerException":
558
- throw await de_InternalServerExceptionRes(parsedOutput, context);
559
- case "ThrottlingException":
560
- case "com.amazonaws.accessanalyzer#ThrottlingException":
561
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
562
- case "ValidationException":
563
- case "com.amazonaws.accessanalyzer#ValidationException":
564
- throw await de_ValidationExceptionRes(parsedOutput, context);
565
- default:
566
- const parsedBody = parsedOutput.body;
567
- return throwDefaultError({
568
- output,
569
- parsedBody,
570
- errorCode,
571
- });
572
- }
573
- };
574
- const de_CheckAccessNotGrantedCommand = async (output, context) => {
575
- if (output.statusCode !== 200 && output.statusCode >= 300) {
576
- return de_CheckAccessNotGrantedCommandError(output, context);
577
- }
578
- const contents = (0, smithy_client_1.map)({
579
- $metadata: deserializeMetadata(output),
580
- });
581
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
582
- const doc = (0, smithy_client_1.take)(data, {
583
- message: smithy_client_1.expectString,
584
- reasons: smithy_client_1._json,
585
- result: smithy_client_1.expectString,
586
- });
587
- Object.assign(contents, doc);
588
- return contents;
589
- };
590
- exports.de_CheckAccessNotGrantedCommand = de_CheckAccessNotGrantedCommand;
591
- const de_CheckAccessNotGrantedCommandError = async (output, context) => {
592
- const parsedOutput = {
593
- ...output,
594
- body: await parseErrorBody(output.body, context),
595
- };
596
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
597
- switch (errorCode) {
598
- case "AccessDeniedException":
599
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
600
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
601
- case "InternalServerException":
602
- case "com.amazonaws.accessanalyzer#InternalServerException":
603
- throw await de_InternalServerExceptionRes(parsedOutput, context);
604
- case "InvalidParameterException":
605
- case "com.amazonaws.accessanalyzer#InvalidParameterException":
606
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
607
- case "ThrottlingException":
608
- case "com.amazonaws.accessanalyzer#ThrottlingException":
609
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
610
- case "UnprocessableEntityException":
611
- case "com.amazonaws.accessanalyzer#UnprocessableEntityException":
612
- throw await de_UnprocessableEntityExceptionRes(parsedOutput, context);
613
- case "ValidationException":
614
- case "com.amazonaws.accessanalyzer#ValidationException":
615
- throw await de_ValidationExceptionRes(parsedOutput, context);
616
- default:
617
- const parsedBody = parsedOutput.body;
618
- return throwDefaultError({
619
- output,
620
- parsedBody,
621
- errorCode,
622
- });
623
- }
624
- };
625
- const de_CheckNoNewAccessCommand = async (output, context) => {
626
- if (output.statusCode !== 200 && output.statusCode >= 300) {
627
- return de_CheckNoNewAccessCommandError(output, context);
628
- }
629
- const contents = (0, smithy_client_1.map)({
630
- $metadata: deserializeMetadata(output),
631
- });
632
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
633
- const doc = (0, smithy_client_1.take)(data, {
634
- message: smithy_client_1.expectString,
635
- reasons: smithy_client_1._json,
636
- result: smithy_client_1.expectString,
637
- });
638
- Object.assign(contents, doc);
639
- return contents;
640
- };
641
- exports.de_CheckNoNewAccessCommand = de_CheckNoNewAccessCommand;
642
- const de_CheckNoNewAccessCommandError = async (output, context) => {
643
- const parsedOutput = {
644
- ...output,
645
- body: await parseErrorBody(output.body, context),
646
- };
647
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
648
- switch (errorCode) {
649
- case "AccessDeniedException":
650
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
651
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
652
- case "InternalServerException":
653
- case "com.amazonaws.accessanalyzer#InternalServerException":
654
- throw await de_InternalServerExceptionRes(parsedOutput, context);
655
- case "InvalidParameterException":
656
- case "com.amazonaws.accessanalyzer#InvalidParameterException":
657
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
658
- case "ThrottlingException":
659
- case "com.amazonaws.accessanalyzer#ThrottlingException":
660
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
661
- case "UnprocessableEntityException":
662
- case "com.amazonaws.accessanalyzer#UnprocessableEntityException":
663
- throw await de_UnprocessableEntityExceptionRes(parsedOutput, context);
664
- case "ValidationException":
665
- case "com.amazonaws.accessanalyzer#ValidationException":
666
- throw await de_ValidationExceptionRes(parsedOutput, context);
667
- default:
668
- const parsedBody = parsedOutput.body;
669
- return throwDefaultError({
670
- output,
671
- parsedBody,
672
- errorCode,
673
- });
674
- }
675
- };
676
- const de_CreateAccessPreviewCommand = async (output, context) => {
677
- if (output.statusCode !== 200 && output.statusCode >= 300) {
678
- return de_CreateAccessPreviewCommandError(output, context);
679
- }
680
- const contents = (0, smithy_client_1.map)({
681
- $metadata: deserializeMetadata(output),
682
- });
683
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
684
- const doc = (0, smithy_client_1.take)(data, {
685
- id: smithy_client_1.expectString,
686
- });
687
- Object.assign(contents, doc);
688
- return contents;
689
- };
690
- exports.de_CreateAccessPreviewCommand = de_CreateAccessPreviewCommand;
691
- const de_CreateAccessPreviewCommandError = async (output, context) => {
692
- const parsedOutput = {
693
- ...output,
694
- body: await parseErrorBody(output.body, context),
695
- };
696
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
697
- switch (errorCode) {
698
- case "AccessDeniedException":
699
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
700
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
701
- case "ConflictException":
702
- case "com.amazonaws.accessanalyzer#ConflictException":
703
- throw await de_ConflictExceptionRes(parsedOutput, context);
704
- case "InternalServerException":
705
- case "com.amazonaws.accessanalyzer#InternalServerException":
706
- throw await de_InternalServerExceptionRes(parsedOutput, context);
707
- case "ResourceNotFoundException":
708
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
709
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
710
- case "ServiceQuotaExceededException":
711
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
712
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
713
- case "ThrottlingException":
714
- case "com.amazonaws.accessanalyzer#ThrottlingException":
715
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
716
- case "ValidationException":
717
- case "com.amazonaws.accessanalyzer#ValidationException":
718
- throw await de_ValidationExceptionRes(parsedOutput, context);
719
- default:
720
- const parsedBody = parsedOutput.body;
721
- return throwDefaultError({
722
- output,
723
- parsedBody,
724
- errorCode,
725
- });
726
- }
727
- };
728
- const de_CreateAnalyzerCommand = async (output, context) => {
729
- if (output.statusCode !== 200 && output.statusCode >= 300) {
730
- return de_CreateAnalyzerCommandError(output, context);
731
- }
732
- const contents = (0, smithy_client_1.map)({
733
- $metadata: deserializeMetadata(output),
734
- });
735
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
736
- const doc = (0, smithy_client_1.take)(data, {
737
- arn: smithy_client_1.expectString,
738
- });
739
- Object.assign(contents, doc);
740
- return contents;
741
- };
742
- exports.de_CreateAnalyzerCommand = de_CreateAnalyzerCommand;
743
- const de_CreateAnalyzerCommandError = async (output, context) => {
744
- const parsedOutput = {
745
- ...output,
746
- body: await parseErrorBody(output.body, context),
747
- };
748
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
749
- switch (errorCode) {
750
- case "AccessDeniedException":
751
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
752
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
753
- case "ConflictException":
754
- case "com.amazonaws.accessanalyzer#ConflictException":
755
- throw await de_ConflictExceptionRes(parsedOutput, context);
756
- case "InternalServerException":
757
- case "com.amazonaws.accessanalyzer#InternalServerException":
758
- throw await de_InternalServerExceptionRes(parsedOutput, context);
759
- case "ServiceQuotaExceededException":
760
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
761
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
762
- case "ThrottlingException":
763
- case "com.amazonaws.accessanalyzer#ThrottlingException":
764
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
765
- case "ValidationException":
766
- case "com.amazonaws.accessanalyzer#ValidationException":
767
- throw await de_ValidationExceptionRes(parsedOutput, context);
768
- default:
769
- const parsedBody = parsedOutput.body;
770
- return throwDefaultError({
771
- output,
772
- parsedBody,
773
- errorCode,
774
- });
775
- }
776
- };
777
- const de_CreateArchiveRuleCommand = async (output, context) => {
778
- if (output.statusCode !== 200 && output.statusCode >= 300) {
779
- return de_CreateArchiveRuleCommandError(output, context);
780
- }
781
- const contents = (0, smithy_client_1.map)({
782
- $metadata: deserializeMetadata(output),
783
- });
784
- await (0, smithy_client_1.collectBody)(output.body, context);
785
- return contents;
786
- };
787
- exports.de_CreateArchiveRuleCommand = de_CreateArchiveRuleCommand;
788
- const de_CreateArchiveRuleCommandError = async (output, context) => {
789
- const parsedOutput = {
790
- ...output,
791
- body: await parseErrorBody(output.body, context),
792
- };
793
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
794
- switch (errorCode) {
795
- case "AccessDeniedException":
796
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
797
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
798
- case "ConflictException":
799
- case "com.amazonaws.accessanalyzer#ConflictException":
800
- throw await de_ConflictExceptionRes(parsedOutput, context);
801
- case "InternalServerException":
802
- case "com.amazonaws.accessanalyzer#InternalServerException":
803
- throw await de_InternalServerExceptionRes(parsedOutput, context);
804
- case "ResourceNotFoundException":
805
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
806
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
807
- case "ServiceQuotaExceededException":
808
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
809
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
810
- case "ThrottlingException":
811
- case "com.amazonaws.accessanalyzer#ThrottlingException":
812
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
813
- case "ValidationException":
814
- case "com.amazonaws.accessanalyzer#ValidationException":
815
- throw await de_ValidationExceptionRes(parsedOutput, context);
816
- default:
817
- const parsedBody = parsedOutput.body;
818
- return throwDefaultError({
819
- output,
820
- parsedBody,
821
- errorCode,
822
- });
823
- }
824
- };
825
- const de_DeleteAnalyzerCommand = async (output, context) => {
826
- if (output.statusCode !== 200 && output.statusCode >= 300) {
827
- return de_DeleteAnalyzerCommandError(output, context);
828
- }
829
- const contents = (0, smithy_client_1.map)({
830
- $metadata: deserializeMetadata(output),
831
- });
832
- await (0, smithy_client_1.collectBody)(output.body, context);
833
- return contents;
834
- };
835
- exports.de_DeleteAnalyzerCommand = de_DeleteAnalyzerCommand;
836
- const de_DeleteAnalyzerCommandError = async (output, context) => {
837
- const parsedOutput = {
838
- ...output,
839
- body: await parseErrorBody(output.body, context),
840
- };
841
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
- switch (errorCode) {
843
- case "AccessDeniedException":
844
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
845
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
846
- case "InternalServerException":
847
- case "com.amazonaws.accessanalyzer#InternalServerException":
848
- throw await de_InternalServerExceptionRes(parsedOutput, context);
849
- case "ResourceNotFoundException":
850
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
851
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
852
- case "ThrottlingException":
853
- case "com.amazonaws.accessanalyzer#ThrottlingException":
854
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
855
- case "ValidationException":
856
- case "com.amazonaws.accessanalyzer#ValidationException":
857
- throw await de_ValidationExceptionRes(parsedOutput, context);
858
- default:
859
- const parsedBody = parsedOutput.body;
860
- return throwDefaultError({
861
- output,
862
- parsedBody,
863
- errorCode,
864
- });
865
- }
866
- };
867
- const de_DeleteArchiveRuleCommand = async (output, context) => {
868
- if (output.statusCode !== 200 && output.statusCode >= 300) {
869
- return de_DeleteArchiveRuleCommandError(output, context);
870
- }
871
- const contents = (0, smithy_client_1.map)({
872
- $metadata: deserializeMetadata(output),
873
- });
874
- await (0, smithy_client_1.collectBody)(output.body, context);
875
- return contents;
876
- };
877
- exports.de_DeleteArchiveRuleCommand = de_DeleteArchiveRuleCommand;
878
- const de_DeleteArchiveRuleCommandError = async (output, context) => {
879
- const parsedOutput = {
880
- ...output,
881
- body: await parseErrorBody(output.body, context),
882
- };
883
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
884
- switch (errorCode) {
885
- case "AccessDeniedException":
886
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
887
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
888
- case "InternalServerException":
889
- case "com.amazonaws.accessanalyzer#InternalServerException":
890
- throw await de_InternalServerExceptionRes(parsedOutput, context);
891
- case "ResourceNotFoundException":
892
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
893
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
894
- case "ThrottlingException":
895
- case "com.amazonaws.accessanalyzer#ThrottlingException":
896
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
897
- case "ValidationException":
898
- case "com.amazonaws.accessanalyzer#ValidationException":
899
- throw await de_ValidationExceptionRes(parsedOutput, context);
900
- default:
901
- const parsedBody = parsedOutput.body;
902
- return throwDefaultError({
903
- output,
904
- parsedBody,
905
- errorCode,
906
- });
907
- }
908
- };
909
- const de_GetAccessPreviewCommand = async (output, context) => {
910
- if (output.statusCode !== 200 && output.statusCode >= 300) {
911
- return de_GetAccessPreviewCommandError(output, context);
912
- }
913
- const contents = (0, smithy_client_1.map)({
914
- $metadata: deserializeMetadata(output),
915
- });
916
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
917
- const doc = (0, smithy_client_1.take)(data, {
918
- accessPreview: (_) => de_AccessPreview(_, context),
919
- });
920
- Object.assign(contents, doc);
921
- return contents;
922
- };
923
- exports.de_GetAccessPreviewCommand = de_GetAccessPreviewCommand;
924
- const de_GetAccessPreviewCommandError = async (output, context) => {
925
- const parsedOutput = {
926
- ...output,
927
- body: await parseErrorBody(output.body, context),
928
- };
929
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
930
- switch (errorCode) {
931
- case "AccessDeniedException":
932
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
933
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
934
- case "InternalServerException":
935
- case "com.amazonaws.accessanalyzer#InternalServerException":
936
- throw await de_InternalServerExceptionRes(parsedOutput, context);
937
- case "ResourceNotFoundException":
938
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
939
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
940
- case "ThrottlingException":
941
- case "com.amazonaws.accessanalyzer#ThrottlingException":
942
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
943
- case "ValidationException":
944
- case "com.amazonaws.accessanalyzer#ValidationException":
945
- throw await de_ValidationExceptionRes(parsedOutput, context);
946
- default:
947
- const parsedBody = parsedOutput.body;
948
- return throwDefaultError({
949
- output,
950
- parsedBody,
951
- errorCode,
952
- });
953
- }
954
- };
955
- const de_GetAnalyzedResourceCommand = async (output, context) => {
956
- if (output.statusCode !== 200 && output.statusCode >= 300) {
957
- return de_GetAnalyzedResourceCommandError(output, context);
958
- }
959
- const contents = (0, smithy_client_1.map)({
960
- $metadata: deserializeMetadata(output),
961
- });
962
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
963
- const doc = (0, smithy_client_1.take)(data, {
964
- resource: (_) => de_AnalyzedResource(_, context),
965
- });
966
- Object.assign(contents, doc);
967
- return contents;
968
- };
969
- exports.de_GetAnalyzedResourceCommand = de_GetAnalyzedResourceCommand;
970
- const de_GetAnalyzedResourceCommandError = async (output, context) => {
971
- const parsedOutput = {
972
- ...output,
973
- body: await parseErrorBody(output.body, context),
974
- };
975
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
976
- switch (errorCode) {
977
- case "AccessDeniedException":
978
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
979
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
980
- case "InternalServerException":
981
- case "com.amazonaws.accessanalyzer#InternalServerException":
982
- throw await de_InternalServerExceptionRes(parsedOutput, context);
983
- case "ResourceNotFoundException":
984
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
985
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
986
- case "ThrottlingException":
987
- case "com.amazonaws.accessanalyzer#ThrottlingException":
988
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
989
- case "ValidationException":
990
- case "com.amazonaws.accessanalyzer#ValidationException":
991
- throw await de_ValidationExceptionRes(parsedOutput, context);
992
- default:
993
- const parsedBody = parsedOutput.body;
994
- return throwDefaultError({
995
- output,
996
- parsedBody,
997
- errorCode,
998
- });
999
- }
1000
- };
1001
- const de_GetAnalyzerCommand = async (output, context) => {
1002
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1003
- return de_GetAnalyzerCommandError(output, context);
1004
- }
1005
- const contents = (0, smithy_client_1.map)({
1006
- $metadata: deserializeMetadata(output),
1007
- });
1008
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1009
- const doc = (0, smithy_client_1.take)(data, {
1010
- analyzer: (_) => de_AnalyzerSummary(_, context),
1011
- });
1012
- Object.assign(contents, doc);
1013
- return contents;
1014
- };
1015
- exports.de_GetAnalyzerCommand = de_GetAnalyzerCommand;
1016
- const de_GetAnalyzerCommandError = async (output, context) => {
1017
- const parsedOutput = {
1018
- ...output,
1019
- body: await parseErrorBody(output.body, context),
1020
- };
1021
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1022
- switch (errorCode) {
1023
- case "AccessDeniedException":
1024
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1025
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1026
- case "InternalServerException":
1027
- case "com.amazonaws.accessanalyzer#InternalServerException":
1028
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1029
- case "ResourceNotFoundException":
1030
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1031
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1032
- case "ThrottlingException":
1033
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1034
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1035
- case "ValidationException":
1036
- case "com.amazonaws.accessanalyzer#ValidationException":
1037
- throw await de_ValidationExceptionRes(parsedOutput, context);
1038
- default:
1039
- const parsedBody = parsedOutput.body;
1040
- return throwDefaultError({
1041
- output,
1042
- parsedBody,
1043
- errorCode,
1044
- });
1045
- }
1046
- };
1047
- const de_GetArchiveRuleCommand = async (output, context) => {
1048
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1049
- return de_GetArchiveRuleCommandError(output, context);
1050
- }
1051
- const contents = (0, smithy_client_1.map)({
1052
- $metadata: deserializeMetadata(output),
1053
- });
1054
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1055
- const doc = (0, smithy_client_1.take)(data, {
1056
- archiveRule: (_) => de_ArchiveRuleSummary(_, context),
1057
- });
1058
- Object.assign(contents, doc);
1059
- return contents;
1060
- };
1061
- exports.de_GetArchiveRuleCommand = de_GetArchiveRuleCommand;
1062
- const de_GetArchiveRuleCommandError = async (output, context) => {
1063
- const parsedOutput = {
1064
- ...output,
1065
- body: await parseErrorBody(output.body, context),
1066
- };
1067
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1068
- switch (errorCode) {
1069
- case "AccessDeniedException":
1070
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1071
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1072
- case "InternalServerException":
1073
- case "com.amazonaws.accessanalyzer#InternalServerException":
1074
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1075
- case "ResourceNotFoundException":
1076
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1077
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1078
- case "ThrottlingException":
1079
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1080
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1081
- case "ValidationException":
1082
- case "com.amazonaws.accessanalyzer#ValidationException":
1083
- throw await de_ValidationExceptionRes(parsedOutput, context);
1084
- default:
1085
- const parsedBody = parsedOutput.body;
1086
- return throwDefaultError({
1087
- output,
1088
- parsedBody,
1089
- errorCode,
1090
- });
1091
- }
1092
- };
1093
- const de_GetFindingCommand = async (output, context) => {
1094
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1095
- return de_GetFindingCommandError(output, context);
1096
- }
1097
- const contents = (0, smithy_client_1.map)({
1098
- $metadata: deserializeMetadata(output),
1099
- });
1100
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1101
- const doc = (0, smithy_client_1.take)(data, {
1102
- finding: (_) => de_Finding(_, context),
1103
- });
1104
- Object.assign(contents, doc);
1105
- return contents;
1106
- };
1107
- exports.de_GetFindingCommand = de_GetFindingCommand;
1108
- const de_GetFindingCommandError = async (output, context) => {
1109
- const parsedOutput = {
1110
- ...output,
1111
- body: await parseErrorBody(output.body, context),
1112
- };
1113
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1114
- switch (errorCode) {
1115
- case "AccessDeniedException":
1116
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1117
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1118
- case "InternalServerException":
1119
- case "com.amazonaws.accessanalyzer#InternalServerException":
1120
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1121
- case "ResourceNotFoundException":
1122
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1123
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1124
- case "ThrottlingException":
1125
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1126
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1127
- case "ValidationException":
1128
- case "com.amazonaws.accessanalyzer#ValidationException":
1129
- throw await de_ValidationExceptionRes(parsedOutput, context);
1130
- default:
1131
- const parsedBody = parsedOutput.body;
1132
- return throwDefaultError({
1133
- output,
1134
- parsedBody,
1135
- errorCode,
1136
- });
1137
- }
1138
- };
1139
- const de_GetFindingV2Command = async (output, context) => {
1140
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1141
- return de_GetFindingV2CommandError(output, context);
1142
- }
1143
- const contents = (0, smithy_client_1.map)({
1144
- $metadata: deserializeMetadata(output),
1145
- });
1146
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1147
- const doc = (0, smithy_client_1.take)(data, {
1148
- analyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1149
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1150
- error: smithy_client_1.expectString,
1151
- findingDetails: (_) => de_FindingDetailsList(_, context),
1152
- findingType: smithy_client_1.expectString,
1153
- id: smithy_client_1.expectString,
1154
- nextToken: smithy_client_1.expectString,
1155
- resource: smithy_client_1.expectString,
1156
- resourceOwnerAccount: smithy_client_1.expectString,
1157
- resourceType: smithy_client_1.expectString,
1158
- status: smithy_client_1.expectString,
1159
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1160
- });
1161
- Object.assign(contents, doc);
1162
- return contents;
1163
- };
1164
- exports.de_GetFindingV2Command = de_GetFindingV2Command;
1165
- const de_GetFindingV2CommandError = async (output, context) => {
1166
- const parsedOutput = {
1167
- ...output,
1168
- body: await parseErrorBody(output.body, context),
1169
- };
1170
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1171
- switch (errorCode) {
1172
- case "AccessDeniedException":
1173
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1174
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1175
- case "InternalServerException":
1176
- case "com.amazonaws.accessanalyzer#InternalServerException":
1177
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1178
- case "ResourceNotFoundException":
1179
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1180
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1181
- case "ThrottlingException":
1182
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1183
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1184
- case "ValidationException":
1185
- case "com.amazonaws.accessanalyzer#ValidationException":
1186
- throw await de_ValidationExceptionRes(parsedOutput, context);
1187
- default:
1188
- const parsedBody = parsedOutput.body;
1189
- return throwDefaultError({
1190
- output,
1191
- parsedBody,
1192
- errorCode,
1193
- });
1194
- }
1195
- };
1196
- const de_GetGeneratedPolicyCommand = async (output, context) => {
1197
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1198
- return de_GetGeneratedPolicyCommandError(output, context);
1199
- }
1200
- const contents = (0, smithy_client_1.map)({
1201
- $metadata: deserializeMetadata(output),
1202
- });
1203
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1204
- const doc = (0, smithy_client_1.take)(data, {
1205
- generatedPolicyResult: (_) => de_GeneratedPolicyResult(_, context),
1206
- jobDetails: (_) => de_JobDetails(_, context),
1207
- });
1208
- Object.assign(contents, doc);
1209
- return contents;
1210
- };
1211
- exports.de_GetGeneratedPolicyCommand = de_GetGeneratedPolicyCommand;
1212
- const de_GetGeneratedPolicyCommandError = async (output, context) => {
1213
- const parsedOutput = {
1214
- ...output,
1215
- body: await parseErrorBody(output.body, context),
1216
- };
1217
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1218
- switch (errorCode) {
1219
- case "AccessDeniedException":
1220
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1221
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1222
- case "InternalServerException":
1223
- case "com.amazonaws.accessanalyzer#InternalServerException":
1224
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1225
- case "ThrottlingException":
1226
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1227
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1228
- case "ValidationException":
1229
- case "com.amazonaws.accessanalyzer#ValidationException":
1230
- throw await de_ValidationExceptionRes(parsedOutput, context);
1231
- default:
1232
- const parsedBody = parsedOutput.body;
1233
- return throwDefaultError({
1234
- output,
1235
- parsedBody,
1236
- errorCode,
1237
- });
1238
- }
1239
- };
1240
- const de_ListAccessPreviewFindingsCommand = async (output, context) => {
1241
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1242
- return de_ListAccessPreviewFindingsCommandError(output, context);
1243
- }
1244
- const contents = (0, smithy_client_1.map)({
1245
- $metadata: deserializeMetadata(output),
1246
- });
1247
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1248
- const doc = (0, smithy_client_1.take)(data, {
1249
- findings: (_) => de_AccessPreviewFindingsList(_, context),
1250
- nextToken: smithy_client_1.expectString,
1251
- });
1252
- Object.assign(contents, doc);
1253
- return contents;
1254
- };
1255
- exports.de_ListAccessPreviewFindingsCommand = de_ListAccessPreviewFindingsCommand;
1256
- const de_ListAccessPreviewFindingsCommandError = async (output, context) => {
1257
- const parsedOutput = {
1258
- ...output,
1259
- body: await parseErrorBody(output.body, context),
1260
- };
1261
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1262
- switch (errorCode) {
1263
- case "AccessDeniedException":
1264
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1265
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1266
- case "ConflictException":
1267
- case "com.amazonaws.accessanalyzer#ConflictException":
1268
- throw await de_ConflictExceptionRes(parsedOutput, context);
1269
- case "InternalServerException":
1270
- case "com.amazonaws.accessanalyzer#InternalServerException":
1271
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1272
- case "ResourceNotFoundException":
1273
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1274
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1275
- case "ThrottlingException":
1276
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1277
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1278
- case "ValidationException":
1279
- case "com.amazonaws.accessanalyzer#ValidationException":
1280
- throw await de_ValidationExceptionRes(parsedOutput, context);
1281
- default:
1282
- const parsedBody = parsedOutput.body;
1283
- return throwDefaultError({
1284
- output,
1285
- parsedBody,
1286
- errorCode,
1287
- });
1288
- }
1289
- };
1290
- const de_ListAccessPreviewsCommand = async (output, context) => {
1291
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1292
- return de_ListAccessPreviewsCommandError(output, context);
1293
- }
1294
- const contents = (0, smithy_client_1.map)({
1295
- $metadata: deserializeMetadata(output),
1296
- });
1297
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1298
- const doc = (0, smithy_client_1.take)(data, {
1299
- accessPreviews: (_) => de_AccessPreviewsList(_, context),
1300
- nextToken: smithy_client_1.expectString,
1301
- });
1302
- Object.assign(contents, doc);
1303
- return contents;
1304
- };
1305
- exports.de_ListAccessPreviewsCommand = de_ListAccessPreviewsCommand;
1306
- const de_ListAccessPreviewsCommandError = async (output, context) => {
1307
- const parsedOutput = {
1308
- ...output,
1309
- body: await parseErrorBody(output.body, context),
1310
- };
1311
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1312
- switch (errorCode) {
1313
- case "AccessDeniedException":
1314
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1315
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1316
- case "InternalServerException":
1317
- case "com.amazonaws.accessanalyzer#InternalServerException":
1318
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1319
- case "ResourceNotFoundException":
1320
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1321
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1322
- case "ThrottlingException":
1323
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1324
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1325
- case "ValidationException":
1326
- case "com.amazonaws.accessanalyzer#ValidationException":
1327
- throw await de_ValidationExceptionRes(parsedOutput, context);
1328
- default:
1329
- const parsedBody = parsedOutput.body;
1330
- return throwDefaultError({
1331
- output,
1332
- parsedBody,
1333
- errorCode,
1334
- });
1335
- }
1336
- };
1337
- const de_ListAnalyzedResourcesCommand = async (output, context) => {
1338
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1339
- return de_ListAnalyzedResourcesCommandError(output, context);
1340
- }
1341
- const contents = (0, smithy_client_1.map)({
1342
- $metadata: deserializeMetadata(output),
1343
- });
1344
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1345
- const doc = (0, smithy_client_1.take)(data, {
1346
- analyzedResources: smithy_client_1._json,
1347
- nextToken: smithy_client_1.expectString,
1348
- });
1349
- Object.assign(contents, doc);
1350
- return contents;
1351
- };
1352
- exports.de_ListAnalyzedResourcesCommand = de_ListAnalyzedResourcesCommand;
1353
- const de_ListAnalyzedResourcesCommandError = async (output, context) => {
1354
- const parsedOutput = {
1355
- ...output,
1356
- body: await parseErrorBody(output.body, context),
1357
- };
1358
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1359
- switch (errorCode) {
1360
- case "AccessDeniedException":
1361
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1362
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1363
- case "InternalServerException":
1364
- case "com.amazonaws.accessanalyzer#InternalServerException":
1365
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1366
- case "ResourceNotFoundException":
1367
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1368
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1369
- case "ThrottlingException":
1370
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1371
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1372
- case "ValidationException":
1373
- case "com.amazonaws.accessanalyzer#ValidationException":
1374
- throw await de_ValidationExceptionRes(parsedOutput, context);
1375
- default:
1376
- const parsedBody = parsedOutput.body;
1377
- return throwDefaultError({
1378
- output,
1379
- parsedBody,
1380
- errorCode,
1381
- });
1382
- }
1383
- };
1384
- const de_ListAnalyzersCommand = async (output, context) => {
1385
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1386
- return de_ListAnalyzersCommandError(output, context);
1387
- }
1388
- const contents = (0, smithy_client_1.map)({
1389
- $metadata: deserializeMetadata(output),
1390
- });
1391
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1392
- const doc = (0, smithy_client_1.take)(data, {
1393
- analyzers: (_) => de_AnalyzersList(_, context),
1394
- nextToken: smithy_client_1.expectString,
1395
- });
1396
- Object.assign(contents, doc);
1397
- return contents;
1398
- };
1399
- exports.de_ListAnalyzersCommand = de_ListAnalyzersCommand;
1400
- const de_ListAnalyzersCommandError = async (output, context) => {
1401
- const parsedOutput = {
1402
- ...output,
1403
- body: await parseErrorBody(output.body, context),
1404
- };
1405
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1406
- switch (errorCode) {
1407
- case "AccessDeniedException":
1408
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1409
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1410
- case "InternalServerException":
1411
- case "com.amazonaws.accessanalyzer#InternalServerException":
1412
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1413
- case "ThrottlingException":
1414
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1415
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1416
- case "ValidationException":
1417
- case "com.amazonaws.accessanalyzer#ValidationException":
1418
- throw await de_ValidationExceptionRes(parsedOutput, context);
1419
- default:
1420
- const parsedBody = parsedOutput.body;
1421
- return throwDefaultError({
1422
- output,
1423
- parsedBody,
1424
- errorCode,
1425
- });
1426
- }
1427
- };
1428
- const de_ListArchiveRulesCommand = async (output, context) => {
1429
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1430
- return de_ListArchiveRulesCommandError(output, context);
1431
- }
1432
- const contents = (0, smithy_client_1.map)({
1433
- $metadata: deserializeMetadata(output),
1434
- });
1435
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1436
- const doc = (0, smithy_client_1.take)(data, {
1437
- archiveRules: (_) => de_ArchiveRulesList(_, context),
1438
- nextToken: smithy_client_1.expectString,
1439
- });
1440
- Object.assign(contents, doc);
1441
- return contents;
1442
- };
1443
- exports.de_ListArchiveRulesCommand = de_ListArchiveRulesCommand;
1444
- const de_ListArchiveRulesCommandError = async (output, context) => {
1445
- const parsedOutput = {
1446
- ...output,
1447
- body: await parseErrorBody(output.body, context),
1448
- };
1449
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1450
- switch (errorCode) {
1451
- case "AccessDeniedException":
1452
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1453
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1454
- case "InternalServerException":
1455
- case "com.amazonaws.accessanalyzer#InternalServerException":
1456
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1457
- case "ThrottlingException":
1458
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1459
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1460
- case "ValidationException":
1461
- case "com.amazonaws.accessanalyzer#ValidationException":
1462
- throw await de_ValidationExceptionRes(parsedOutput, context);
1463
- default:
1464
- const parsedBody = parsedOutput.body;
1465
- return throwDefaultError({
1466
- output,
1467
- parsedBody,
1468
- errorCode,
1469
- });
1470
- }
1471
- };
1472
- const de_ListFindingsCommand = async (output, context) => {
1473
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1474
- return de_ListFindingsCommandError(output, context);
1475
- }
1476
- const contents = (0, smithy_client_1.map)({
1477
- $metadata: deserializeMetadata(output),
1478
- });
1479
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1480
- const doc = (0, smithy_client_1.take)(data, {
1481
- findings: (_) => de_FindingsList(_, context),
1482
- nextToken: smithy_client_1.expectString,
1483
- });
1484
- Object.assign(contents, doc);
1485
- return contents;
1486
- };
1487
- exports.de_ListFindingsCommand = de_ListFindingsCommand;
1488
- const de_ListFindingsCommandError = async (output, context) => {
1489
- const parsedOutput = {
1490
- ...output,
1491
- body: await parseErrorBody(output.body, context),
1492
- };
1493
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1494
- switch (errorCode) {
1495
- case "AccessDeniedException":
1496
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1497
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1498
- case "InternalServerException":
1499
- case "com.amazonaws.accessanalyzer#InternalServerException":
1500
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1501
- case "ResourceNotFoundException":
1502
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1503
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1504
- case "ThrottlingException":
1505
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1506
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1507
- case "ValidationException":
1508
- case "com.amazonaws.accessanalyzer#ValidationException":
1509
- throw await de_ValidationExceptionRes(parsedOutput, context);
1510
- default:
1511
- const parsedBody = parsedOutput.body;
1512
- return throwDefaultError({
1513
- output,
1514
- parsedBody,
1515
- errorCode,
1516
- });
1517
- }
1518
- };
1519
- const de_ListFindingsV2Command = async (output, context) => {
1520
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1521
- return de_ListFindingsV2CommandError(output, context);
1522
- }
1523
- const contents = (0, smithy_client_1.map)({
1524
- $metadata: deserializeMetadata(output),
1525
- });
1526
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1527
- const doc = (0, smithy_client_1.take)(data, {
1528
- findings: (_) => de_FindingsListV2(_, context),
1529
- nextToken: smithy_client_1.expectString,
1530
- });
1531
- Object.assign(contents, doc);
1532
- return contents;
1533
- };
1534
- exports.de_ListFindingsV2Command = de_ListFindingsV2Command;
1535
- const de_ListFindingsV2CommandError = async (output, context) => {
1536
- const parsedOutput = {
1537
- ...output,
1538
- body: await parseErrorBody(output.body, context),
1539
- };
1540
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1541
- switch (errorCode) {
1542
- case "AccessDeniedException":
1543
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1544
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1545
- case "InternalServerException":
1546
- case "com.amazonaws.accessanalyzer#InternalServerException":
1547
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1548
- case "ResourceNotFoundException":
1549
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1550
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1551
- case "ThrottlingException":
1552
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1553
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1554
- case "ValidationException":
1555
- case "com.amazonaws.accessanalyzer#ValidationException":
1556
- throw await de_ValidationExceptionRes(parsedOutput, context);
1557
- default:
1558
- const parsedBody = parsedOutput.body;
1559
- return throwDefaultError({
1560
- output,
1561
- parsedBody,
1562
- errorCode,
1563
- });
1564
- }
1565
- };
1566
- const de_ListPolicyGenerationsCommand = async (output, context) => {
1567
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1568
- return de_ListPolicyGenerationsCommandError(output, context);
1569
- }
1570
- const contents = (0, smithy_client_1.map)({
1571
- $metadata: deserializeMetadata(output),
1572
- });
1573
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1574
- const doc = (0, smithy_client_1.take)(data, {
1575
- nextToken: smithy_client_1.expectString,
1576
- policyGenerations: (_) => de_PolicyGenerationList(_, context),
1577
- });
1578
- Object.assign(contents, doc);
1579
- return contents;
1580
- };
1581
- exports.de_ListPolicyGenerationsCommand = de_ListPolicyGenerationsCommand;
1582
- const de_ListPolicyGenerationsCommandError = async (output, context) => {
1583
- const parsedOutput = {
1584
- ...output,
1585
- body: await parseErrorBody(output.body, context),
1586
- };
1587
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1588
- switch (errorCode) {
1589
- case "AccessDeniedException":
1590
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1591
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1592
- case "InternalServerException":
1593
- case "com.amazonaws.accessanalyzer#InternalServerException":
1594
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1595
- case "ThrottlingException":
1596
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1597
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1598
- case "ValidationException":
1599
- case "com.amazonaws.accessanalyzer#ValidationException":
1600
- throw await de_ValidationExceptionRes(parsedOutput, context);
1601
- default:
1602
- const parsedBody = parsedOutput.body;
1603
- return throwDefaultError({
1604
- output,
1605
- parsedBody,
1606
- errorCode,
1607
- });
1608
- }
1609
- };
1610
- const de_ListTagsForResourceCommand = async (output, context) => {
1611
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1612
- return de_ListTagsForResourceCommandError(output, context);
1613
- }
1614
- const contents = (0, smithy_client_1.map)({
1615
- $metadata: deserializeMetadata(output),
1616
- });
1617
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1618
- const doc = (0, smithy_client_1.take)(data, {
1619
- tags: smithy_client_1._json,
1620
- });
1621
- Object.assign(contents, doc);
1622
- return contents;
1623
- };
1624
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
1625
- const de_ListTagsForResourceCommandError = async (output, context) => {
1626
- const parsedOutput = {
1627
- ...output,
1628
- body: await parseErrorBody(output.body, context),
1629
- };
1630
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1631
- switch (errorCode) {
1632
- case "AccessDeniedException":
1633
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1634
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1635
- case "InternalServerException":
1636
- case "com.amazonaws.accessanalyzer#InternalServerException":
1637
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1638
- case "ResourceNotFoundException":
1639
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1640
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1641
- case "ThrottlingException":
1642
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1643
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1644
- case "ValidationException":
1645
- case "com.amazonaws.accessanalyzer#ValidationException":
1646
- throw await de_ValidationExceptionRes(parsedOutput, context);
1647
- default:
1648
- const parsedBody = parsedOutput.body;
1649
- return throwDefaultError({
1650
- output,
1651
- parsedBody,
1652
- errorCode,
1653
- });
1654
- }
1655
- };
1656
- const de_StartPolicyGenerationCommand = async (output, context) => {
1657
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1658
- return de_StartPolicyGenerationCommandError(output, context);
1659
- }
1660
- const contents = (0, smithy_client_1.map)({
1661
- $metadata: deserializeMetadata(output),
1662
- });
1663
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1664
- const doc = (0, smithy_client_1.take)(data, {
1665
- jobId: smithy_client_1.expectString,
1666
- });
1667
- Object.assign(contents, doc);
1668
- return contents;
1669
- };
1670
- exports.de_StartPolicyGenerationCommand = de_StartPolicyGenerationCommand;
1671
- const de_StartPolicyGenerationCommandError = async (output, context) => {
1672
- const parsedOutput = {
1673
- ...output,
1674
- body: await parseErrorBody(output.body, context),
1675
- };
1676
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1677
- switch (errorCode) {
1678
- case "AccessDeniedException":
1679
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1680
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1681
- case "ConflictException":
1682
- case "com.amazonaws.accessanalyzer#ConflictException":
1683
- throw await de_ConflictExceptionRes(parsedOutput, context);
1684
- case "InternalServerException":
1685
- case "com.amazonaws.accessanalyzer#InternalServerException":
1686
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1687
- case "ServiceQuotaExceededException":
1688
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
1689
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1690
- case "ThrottlingException":
1691
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1692
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1693
- case "ValidationException":
1694
- case "com.amazonaws.accessanalyzer#ValidationException":
1695
- throw await de_ValidationExceptionRes(parsedOutput, context);
1696
- default:
1697
- const parsedBody = parsedOutput.body;
1698
- return throwDefaultError({
1699
- output,
1700
- parsedBody,
1701
- errorCode,
1702
- });
1703
- }
1704
- };
1705
- const de_StartResourceScanCommand = async (output, context) => {
1706
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1707
- return de_StartResourceScanCommandError(output, context);
1708
- }
1709
- const contents = (0, smithy_client_1.map)({
1710
- $metadata: deserializeMetadata(output),
1711
- });
1712
- await (0, smithy_client_1.collectBody)(output.body, context);
1713
- return contents;
1714
- };
1715
- exports.de_StartResourceScanCommand = de_StartResourceScanCommand;
1716
- const de_StartResourceScanCommandError = async (output, context) => {
1717
- const parsedOutput = {
1718
- ...output,
1719
- body: await parseErrorBody(output.body, context),
1720
- };
1721
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1722
- switch (errorCode) {
1723
- case "AccessDeniedException":
1724
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1725
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1726
- case "InternalServerException":
1727
- case "com.amazonaws.accessanalyzer#InternalServerException":
1728
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1729
- case "ResourceNotFoundException":
1730
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1731
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1732
- case "ThrottlingException":
1733
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1734
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1735
- case "ValidationException":
1736
- case "com.amazonaws.accessanalyzer#ValidationException":
1737
- throw await de_ValidationExceptionRes(parsedOutput, context);
1738
- default:
1739
- const parsedBody = parsedOutput.body;
1740
- return throwDefaultError({
1741
- output,
1742
- parsedBody,
1743
- errorCode,
1744
- });
1745
- }
1746
- };
1747
- const de_TagResourceCommand = async (output, context) => {
1748
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1749
- return de_TagResourceCommandError(output, context);
1750
- }
1751
- const contents = (0, smithy_client_1.map)({
1752
- $metadata: deserializeMetadata(output),
1753
- });
1754
- await (0, smithy_client_1.collectBody)(output.body, context);
1755
- return contents;
1756
- };
1757
- exports.de_TagResourceCommand = de_TagResourceCommand;
1758
- const de_TagResourceCommandError = async (output, context) => {
1759
- const parsedOutput = {
1760
- ...output,
1761
- body: await parseErrorBody(output.body, context),
1762
- };
1763
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1764
- switch (errorCode) {
1765
- case "AccessDeniedException":
1766
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1767
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1768
- case "InternalServerException":
1769
- case "com.amazonaws.accessanalyzer#InternalServerException":
1770
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1771
- case "ResourceNotFoundException":
1772
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1773
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1774
- case "ThrottlingException":
1775
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1776
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1777
- case "ValidationException":
1778
- case "com.amazonaws.accessanalyzer#ValidationException":
1779
- throw await de_ValidationExceptionRes(parsedOutput, context);
1780
- default:
1781
- const parsedBody = parsedOutput.body;
1782
- return throwDefaultError({
1783
- output,
1784
- parsedBody,
1785
- errorCode,
1786
- });
1787
- }
1788
- };
1789
- const de_UntagResourceCommand = async (output, context) => {
1790
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1791
- return de_UntagResourceCommandError(output, context);
1792
- }
1793
- const contents = (0, smithy_client_1.map)({
1794
- $metadata: deserializeMetadata(output),
1795
- });
1796
- await (0, smithy_client_1.collectBody)(output.body, context);
1797
- return contents;
1798
- };
1799
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1800
- const de_UntagResourceCommandError = async (output, context) => {
1801
- const parsedOutput = {
1802
- ...output,
1803
- body: await parseErrorBody(output.body, context),
1804
- };
1805
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1806
- switch (errorCode) {
1807
- case "AccessDeniedException":
1808
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1809
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1810
- case "InternalServerException":
1811
- case "com.amazonaws.accessanalyzer#InternalServerException":
1812
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1813
- case "ResourceNotFoundException":
1814
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1815
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1816
- case "ThrottlingException":
1817
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1818
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1819
- case "ValidationException":
1820
- case "com.amazonaws.accessanalyzer#ValidationException":
1821
- throw await de_ValidationExceptionRes(parsedOutput, context);
1822
- default:
1823
- const parsedBody = parsedOutput.body;
1824
- return throwDefaultError({
1825
- output,
1826
- parsedBody,
1827
- errorCode,
1828
- });
1829
- }
1830
- };
1831
- const de_UpdateArchiveRuleCommand = async (output, context) => {
1832
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1833
- return de_UpdateArchiveRuleCommandError(output, context);
1834
- }
1835
- const contents = (0, smithy_client_1.map)({
1836
- $metadata: deserializeMetadata(output),
1837
- });
1838
- await (0, smithy_client_1.collectBody)(output.body, context);
1839
- return contents;
1840
- };
1841
- exports.de_UpdateArchiveRuleCommand = de_UpdateArchiveRuleCommand;
1842
- const de_UpdateArchiveRuleCommandError = async (output, context) => {
1843
- const parsedOutput = {
1844
- ...output,
1845
- body: await parseErrorBody(output.body, context),
1846
- };
1847
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1848
- switch (errorCode) {
1849
- case "AccessDeniedException":
1850
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1851
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1852
- case "InternalServerException":
1853
- case "com.amazonaws.accessanalyzer#InternalServerException":
1854
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1855
- case "ResourceNotFoundException":
1856
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1857
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1858
- case "ThrottlingException":
1859
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1860
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1861
- case "ValidationException":
1862
- case "com.amazonaws.accessanalyzer#ValidationException":
1863
- throw await de_ValidationExceptionRes(parsedOutput, context);
1864
- default:
1865
- const parsedBody = parsedOutput.body;
1866
- return throwDefaultError({
1867
- output,
1868
- parsedBody,
1869
- errorCode,
1870
- });
1871
- }
1872
- };
1873
- const de_UpdateFindingsCommand = async (output, context) => {
1874
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1875
- return de_UpdateFindingsCommandError(output, context);
1876
- }
1877
- const contents = (0, smithy_client_1.map)({
1878
- $metadata: deserializeMetadata(output),
1879
- });
1880
- await (0, smithy_client_1.collectBody)(output.body, context);
1881
- return contents;
1882
- };
1883
- exports.de_UpdateFindingsCommand = de_UpdateFindingsCommand;
1884
- const de_UpdateFindingsCommandError = async (output, context) => {
1885
- const parsedOutput = {
1886
- ...output,
1887
- body: await parseErrorBody(output.body, context),
1888
- };
1889
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1890
- switch (errorCode) {
1891
- case "AccessDeniedException":
1892
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1893
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1894
- case "InternalServerException":
1895
- case "com.amazonaws.accessanalyzer#InternalServerException":
1896
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1897
- case "ResourceNotFoundException":
1898
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1899
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1900
- case "ThrottlingException":
1901
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1902
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1903
- case "ValidationException":
1904
- case "com.amazonaws.accessanalyzer#ValidationException":
1905
- throw await de_ValidationExceptionRes(parsedOutput, context);
1906
- default:
1907
- const parsedBody = parsedOutput.body;
1908
- return throwDefaultError({
1909
- output,
1910
- parsedBody,
1911
- errorCode,
1912
- });
1913
- }
1914
- };
1915
- const de_ValidatePolicyCommand = async (output, context) => {
1916
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1917
- return de_ValidatePolicyCommandError(output, context);
1918
- }
1919
- const contents = (0, smithy_client_1.map)({
1920
- $metadata: deserializeMetadata(output),
1921
- });
1922
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1923
- const doc = (0, smithy_client_1.take)(data, {
1924
- findings: smithy_client_1._json,
1925
- nextToken: smithy_client_1.expectString,
1926
- });
1927
- Object.assign(contents, doc);
1928
- return contents;
1929
- };
1930
- exports.de_ValidatePolicyCommand = de_ValidatePolicyCommand;
1931
- const de_ValidatePolicyCommandError = async (output, context) => {
1932
- const parsedOutput = {
1933
- ...output,
1934
- body: await parseErrorBody(output.body, context),
1935
- };
1936
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1937
- switch (errorCode) {
1938
- case "AccessDeniedException":
1939
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1940
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1941
- case "InternalServerException":
1942
- case "com.amazonaws.accessanalyzer#InternalServerException":
1943
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1944
- case "ThrottlingException":
1945
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1946
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1947
- case "ValidationException":
1948
- case "com.amazonaws.accessanalyzer#ValidationException":
1949
- throw await de_ValidationExceptionRes(parsedOutput, context);
1950
- default:
1951
- const parsedBody = parsedOutput.body;
1952
- return throwDefaultError({
1953
- output,
1954
- parsedBody,
1955
- errorCode,
1956
- });
1957
- }
1958
- };
1959
- const throwDefaultError = (0, smithy_client_1.withBaseException)(AccessAnalyzerServiceException_1.AccessAnalyzerServiceException);
1960
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1961
- const contents = (0, smithy_client_1.map)({});
1962
- const data = parsedOutput.body;
1963
- const doc = (0, smithy_client_1.take)(data, {
1964
- message: smithy_client_1.expectString,
1965
- });
1966
- Object.assign(contents, doc);
1967
- const exception = new models_0_1.AccessDeniedException({
1968
- $metadata: deserializeMetadata(parsedOutput),
1969
- ...contents,
1970
- });
1971
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1972
- };
1973
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1974
- const contents = (0, smithy_client_1.map)({});
1975
- const data = parsedOutput.body;
1976
- const doc = (0, smithy_client_1.take)(data, {
1977
- message: smithy_client_1.expectString,
1978
- resourceId: smithy_client_1.expectString,
1979
- resourceType: smithy_client_1.expectString,
1980
- });
1981
- Object.assign(contents, doc);
1982
- const exception = new models_0_1.ConflictException({
1983
- $metadata: deserializeMetadata(parsedOutput),
1984
- ...contents,
1985
- });
1986
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1987
- };
1988
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1989
- const contents = (0, smithy_client_1.map)({
1990
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
1991
- });
1992
- const data = parsedOutput.body;
1993
- const doc = (0, smithy_client_1.take)(data, {
1994
- message: smithy_client_1.expectString,
1995
- });
1996
- Object.assign(contents, doc);
1997
- const exception = new models_0_1.InternalServerException({
1998
- $metadata: deserializeMetadata(parsedOutput),
1999
- ...contents,
2000
- });
2001
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2002
- };
2003
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
2004
- const contents = (0, smithy_client_1.map)({});
2005
- const data = parsedOutput.body;
2006
- const doc = (0, smithy_client_1.take)(data, {
2007
- message: smithy_client_1.expectString,
2008
- });
2009
- Object.assign(contents, doc);
2010
- const exception = new models_0_1.InvalidParameterException({
2011
- $metadata: deserializeMetadata(parsedOutput),
2012
- ...contents,
2013
- });
2014
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2015
- };
2016
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
2017
- const contents = (0, smithy_client_1.map)({});
2018
- const data = parsedOutput.body;
2019
- const doc = (0, smithy_client_1.take)(data, {
2020
- message: smithy_client_1.expectString,
2021
- resourceId: smithy_client_1.expectString,
2022
- resourceType: smithy_client_1.expectString,
2023
- });
2024
- Object.assign(contents, doc);
2025
- const exception = new models_0_1.ResourceNotFoundException({
2026
- $metadata: deserializeMetadata(parsedOutput),
2027
- ...contents,
2028
- });
2029
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2030
- };
2031
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
2032
- const contents = (0, smithy_client_1.map)({});
2033
- const data = parsedOutput.body;
2034
- const doc = (0, smithy_client_1.take)(data, {
2035
- message: smithy_client_1.expectString,
2036
- resourceId: smithy_client_1.expectString,
2037
- resourceType: smithy_client_1.expectString,
2038
- });
2039
- Object.assign(contents, doc);
2040
- const exception = new models_0_1.ServiceQuotaExceededException({
2041
- $metadata: deserializeMetadata(parsedOutput),
2042
- ...contents,
2043
- });
2044
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2045
- };
2046
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2047
- const contents = (0, smithy_client_1.map)({
2048
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
2049
- });
2050
- const data = parsedOutput.body;
2051
- const doc = (0, smithy_client_1.take)(data, {
2052
- message: smithy_client_1.expectString,
2053
- });
2054
- Object.assign(contents, doc);
2055
- const exception = new models_0_1.ThrottlingException({
2056
- $metadata: deserializeMetadata(parsedOutput),
2057
- ...contents,
2058
- });
2059
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2060
- };
2061
- const de_UnprocessableEntityExceptionRes = async (parsedOutput, context) => {
2062
- const contents = (0, smithy_client_1.map)({});
2063
- const data = parsedOutput.body;
2064
- const doc = (0, smithy_client_1.take)(data, {
2065
- message: smithy_client_1.expectString,
2066
- });
2067
- Object.assign(contents, doc);
2068
- const exception = new models_0_1.UnprocessableEntityException({
2069
- $metadata: deserializeMetadata(parsedOutput),
2070
- ...contents,
2071
- });
2072
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2073
- };
2074
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
2075
- const contents = (0, smithy_client_1.map)({});
2076
- const data = parsedOutput.body;
2077
- const doc = (0, smithy_client_1.take)(data, {
2078
- fieldList: smithy_client_1._json,
2079
- message: smithy_client_1.expectString,
2080
- reason: smithy_client_1.expectString,
2081
- });
2082
- Object.assign(contents, doc);
2083
- const exception = new models_0_1.ValidationException({
2084
- $metadata: deserializeMetadata(parsedOutput),
2085
- ...contents,
2086
- });
2087
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2088
- };
2089
- const se_CloudTrailDetails = (input, context) => {
2090
- return (0, smithy_client_1.take)(input, {
2091
- accessRole: [],
2092
- endTime: (_) => _.toISOString().split(".")[0] + "Z",
2093
- startTime: (_) => _.toISOString().split(".")[0] + "Z",
2094
- trails: smithy_client_1._json,
2095
- });
2096
- };
2097
- const de_AccessPreview = (output, context) => {
2098
- return (0, smithy_client_1.take)(output, {
2099
- analyzerArn: smithy_client_1.expectString,
2100
- configurations: smithy_client_1._json,
2101
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2102
- id: smithy_client_1.expectString,
2103
- status: smithy_client_1.expectString,
2104
- statusReason: smithy_client_1._json,
2105
- });
2106
- };
2107
- const de_AccessPreviewFinding = (output, context) => {
2108
- return (0, smithy_client_1.take)(output, {
2109
- action: smithy_client_1._json,
2110
- changeType: smithy_client_1.expectString,
2111
- condition: smithy_client_1._json,
2112
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2113
- error: smithy_client_1.expectString,
2114
- existingFindingId: smithy_client_1.expectString,
2115
- existingFindingStatus: smithy_client_1.expectString,
2116
- id: smithy_client_1.expectString,
2117
- isPublic: smithy_client_1.expectBoolean,
2118
- principal: smithy_client_1._json,
2119
- resource: smithy_client_1.expectString,
2120
- resourceOwnerAccount: smithy_client_1.expectString,
2121
- resourceType: smithy_client_1.expectString,
2122
- sources: smithy_client_1._json,
2123
- status: smithy_client_1.expectString,
2124
- });
2125
- };
2126
- const de_AccessPreviewFindingsList = (output, context) => {
2127
- const retVal = (output || [])
2128
- .filter((e) => e != null)
2129
- .map((entry) => {
2130
- return de_AccessPreviewFinding(entry, context);
2131
- });
2132
- return retVal;
2133
- };
2134
- const de_AccessPreviewsList = (output, context) => {
2135
- const retVal = (output || [])
2136
- .filter((e) => e != null)
2137
- .map((entry) => {
2138
- return de_AccessPreviewSummary(entry, context);
2139
- });
2140
- return retVal;
2141
- };
2142
- const de_AccessPreviewSummary = (output, context) => {
2143
- return (0, smithy_client_1.take)(output, {
2144
- analyzerArn: smithy_client_1.expectString,
2145
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2146
- id: smithy_client_1.expectString,
2147
- status: smithy_client_1.expectString,
2148
- statusReason: smithy_client_1._json,
2149
- });
2150
- };
2151
- const de_AnalyzedResource = (output, context) => {
2152
- return (0, smithy_client_1.take)(output, {
2153
- actions: smithy_client_1._json,
2154
- analyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2155
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2156
- error: smithy_client_1.expectString,
2157
- isPublic: smithy_client_1.expectBoolean,
2158
- resourceArn: smithy_client_1.expectString,
2159
- resourceOwnerAccount: smithy_client_1.expectString,
2160
- resourceType: smithy_client_1.expectString,
2161
- sharedVia: smithy_client_1._json,
2162
- status: smithy_client_1.expectString,
2163
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2164
- });
2165
- };
2166
- const de_AnalyzersList = (output, context) => {
2167
- const retVal = (output || [])
2168
- .filter((e) => e != null)
2169
- .map((entry) => {
2170
- return de_AnalyzerSummary(entry, context);
2171
- });
2172
- return retVal;
2173
- };
2174
- const de_AnalyzerSummary = (output, context) => {
2175
- return (0, smithy_client_1.take)(output, {
2176
- arn: smithy_client_1.expectString,
2177
- configuration: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
2178
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2179
- lastResourceAnalyzed: smithy_client_1.expectString,
2180
- lastResourceAnalyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2181
- name: smithy_client_1.expectString,
2182
- status: smithy_client_1.expectString,
2183
- statusReason: smithy_client_1._json,
2184
- tags: smithy_client_1._json,
2185
- type: smithy_client_1.expectString,
2186
- });
2187
- };
2188
- const de_ArchiveRulesList = (output, context) => {
2189
- const retVal = (output || [])
2190
- .filter((e) => e != null)
2191
- .map((entry) => {
2192
- return de_ArchiveRuleSummary(entry, context);
2193
- });
2194
- return retVal;
2195
- };
2196
- const de_ArchiveRuleSummary = (output, context) => {
2197
- return (0, smithy_client_1.take)(output, {
2198
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2199
- filter: smithy_client_1._json,
2200
- ruleName: smithy_client_1.expectString,
2201
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2202
- });
2203
- };
2204
- const de_CloudTrailProperties = (output, context) => {
2205
- return (0, smithy_client_1.take)(output, {
2206
- endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2207
- startTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2208
- trailProperties: smithy_client_1._json,
2209
- });
2210
- };
2211
- const de_Finding = (output, context) => {
2212
- return (0, smithy_client_1.take)(output, {
2213
- action: smithy_client_1._json,
2214
- analyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2215
- condition: smithy_client_1._json,
2216
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2217
- error: smithy_client_1.expectString,
2218
- id: smithy_client_1.expectString,
2219
- isPublic: smithy_client_1.expectBoolean,
2220
- principal: smithy_client_1._json,
2221
- resource: smithy_client_1.expectString,
2222
- resourceOwnerAccount: smithy_client_1.expectString,
2223
- resourceType: smithy_client_1.expectString,
2224
- sources: smithy_client_1._json,
2225
- status: smithy_client_1.expectString,
2226
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2227
- });
2228
- };
2229
- const de_FindingDetails = (output, context) => {
2230
- if (output.externalAccessDetails != null) {
2231
- return {
2232
- externalAccessDetails: (0, smithy_client_1._json)(output.externalAccessDetails),
2233
- };
2234
- }
2235
- if (output.unusedIamRoleDetails != null) {
2236
- return {
2237
- unusedIamRoleDetails: de_UnusedIamRoleDetails(output.unusedIamRoleDetails, context),
2238
- };
2239
- }
2240
- if (output.unusedIamUserAccessKeyDetails != null) {
2241
- return {
2242
- unusedIamUserAccessKeyDetails: de_UnusedIamUserAccessKeyDetails(output.unusedIamUserAccessKeyDetails, context),
2243
- };
2244
- }
2245
- if (output.unusedIamUserPasswordDetails != null) {
2246
- return {
2247
- unusedIamUserPasswordDetails: de_UnusedIamUserPasswordDetails(output.unusedIamUserPasswordDetails, context),
2248
- };
2249
- }
2250
- if (output.unusedPermissionDetails != null) {
2251
- return {
2252
- unusedPermissionDetails: de_UnusedPermissionDetails(output.unusedPermissionDetails, context),
2253
- };
2254
- }
2255
- return { $unknown: Object.entries(output)[0] };
2256
- };
2257
- const de_FindingDetailsList = (output, context) => {
2258
- const retVal = (output || [])
2259
- .filter((e) => e != null)
2260
- .map((entry) => {
2261
- return de_FindingDetails((0, core_1.awsExpectUnion)(entry), context);
2262
- });
2263
- return retVal;
2264
- };
2265
- const de_FindingsList = (output, context) => {
2266
- const retVal = (output || [])
2267
- .filter((e) => e != null)
2268
- .map((entry) => {
2269
- return de_FindingSummary(entry, context);
2270
- });
2271
- return retVal;
2272
- };
2273
- const de_FindingsListV2 = (output, context) => {
2274
- const retVal = (output || [])
2275
- .filter((e) => e != null)
2276
- .map((entry) => {
2277
- return de_FindingSummaryV2(entry, context);
2278
- });
2279
- return retVal;
2280
- };
2281
- const de_FindingSummary = (output, context) => {
2282
- return (0, smithy_client_1.take)(output, {
2283
- action: smithy_client_1._json,
2284
- analyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2285
- condition: smithy_client_1._json,
2286
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2287
- error: smithy_client_1.expectString,
2288
- id: smithy_client_1.expectString,
2289
- isPublic: smithy_client_1.expectBoolean,
2290
- principal: smithy_client_1._json,
2291
- resource: smithy_client_1.expectString,
2292
- resourceOwnerAccount: smithy_client_1.expectString,
2293
- resourceType: smithy_client_1.expectString,
2294
- sources: smithy_client_1._json,
2295
- status: smithy_client_1.expectString,
2296
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2297
- });
2298
- };
2299
- const de_FindingSummaryV2 = (output, context) => {
2300
- return (0, smithy_client_1.take)(output, {
2301
- analyzedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2302
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2303
- error: smithy_client_1.expectString,
2304
- findingType: smithy_client_1.expectString,
2305
- id: smithy_client_1.expectString,
2306
- resource: smithy_client_1.expectString,
2307
- resourceOwnerAccount: smithy_client_1.expectString,
2308
- resourceType: smithy_client_1.expectString,
2309
- status: smithy_client_1.expectString,
2310
- updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2311
- });
2312
- };
2313
- const de_GeneratedPolicyProperties = (output, context) => {
2314
- return (0, smithy_client_1.take)(output, {
2315
- cloudTrailProperties: (_) => de_CloudTrailProperties(_, context),
2316
- isComplete: smithy_client_1.expectBoolean,
2317
- principalArn: smithy_client_1.expectString,
2318
- });
2319
- };
2320
- const de_GeneratedPolicyResult = (output, context) => {
2321
- return (0, smithy_client_1.take)(output, {
2322
- generatedPolicies: smithy_client_1._json,
2323
- properties: (_) => de_GeneratedPolicyProperties(_, context),
2324
- });
2325
- };
2326
- const de_JobDetails = (output, context) => {
2327
- return (0, smithy_client_1.take)(output, {
2328
- completedOn: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2329
- jobError: smithy_client_1._json,
2330
- jobId: smithy_client_1.expectString,
2331
- startedOn: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2332
- status: smithy_client_1.expectString,
2333
- });
2334
- };
2335
- const de_PolicyGeneration = (output, context) => {
2336
- return (0, smithy_client_1.take)(output, {
2337
- completedOn: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2338
- jobId: smithy_client_1.expectString,
2339
- principalArn: smithy_client_1.expectString,
2340
- startedOn: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2341
- status: smithy_client_1.expectString,
2342
- });
2343
- };
2344
- const de_PolicyGenerationList = (output, context) => {
2345
- const retVal = (output || [])
2346
- .filter((e) => e != null)
2347
- .map((entry) => {
2348
- return de_PolicyGeneration(entry, context);
2349
- });
2350
- return retVal;
2351
- };
2352
- const de_UnusedAction = (output, context) => {
2353
- return (0, smithy_client_1.take)(output, {
2354
- action: smithy_client_1.expectString,
2355
- lastAccessed: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2356
- });
2357
- };
2358
- const de_UnusedActionList = (output, context) => {
2359
- const retVal = (output || [])
2360
- .filter((e) => e != null)
2361
- .map((entry) => {
2362
- return de_UnusedAction(entry, context);
2363
- });
2364
- return retVal;
2365
- };
2366
- const de_UnusedIamRoleDetails = (output, context) => {
2367
- return (0, smithy_client_1.take)(output, {
2368
- lastAccessed: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2369
- });
2370
- };
2371
- const de_UnusedIamUserAccessKeyDetails = (output, context) => {
2372
- return (0, smithy_client_1.take)(output, {
2373
- accessKeyId: smithy_client_1.expectString,
2374
- lastAccessed: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2375
- });
2376
- };
2377
- const de_UnusedIamUserPasswordDetails = (output, context) => {
2378
- return (0, smithy_client_1.take)(output, {
2379
- lastAccessed: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2380
- });
2381
- };
2382
- const de_UnusedPermissionDetails = (output, context) => {
2383
- return (0, smithy_client_1.take)(output, {
2384
- actions: (_) => de_UnusedActionList(_, context),
2385
- lastAccessed: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2386
- serviceNamespace: smithy_client_1.expectString,
2387
- });
2388
- };
2389
- const deserializeMetadata = (output) => ({
2390
- httpStatusCode: output.statusCode,
2391
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2392
- extendedRequestId: output.headers["x-amz-id-2"],
2393
- cfId: output.headers["x-amz-cf-id"],
2394
- });
2395
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
2396
- const isSerializableHeaderValue = (value) => value !== undefined &&
2397
- value !== null &&
2398
- value !== "" &&
2399
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2400
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2401
- const _aA = "analyzerArn";
2402
- const _cT = "clientToken";
2403
- const _iRP = "includeResourcePlaceholders";
2404
- const _iSLT = "includeServiceLevelTemplate";
2405
- const _mR = "maxResults";
2406
- const _nT = "nextToken";
2407
- const _pA = "principalArn";
2408
- const _rA = "resourceArn";
2409
- const _rAS = "retryAfterSeconds";
2410
- const _ra = "retry-after";
2411
- const _t = "type";
2412
- const _tK = "tagKeys";
2413
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2414
- if (encoded.length) {
2415
- return JSON.parse(encoded);
2416
- }
2417
- return {};
2418
- });
2419
- const parseErrorBody = async (errorBody, context) => {
2420
- const value = await parseBody(errorBody, context);
2421
- value.message = value.message ?? value.Message;
2422
- return value;
2423
- };
2424
- const loadRestJsonErrorCode = (output, data) => {
2425
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2426
- const sanitizeErrorCode = (rawValue) => {
2427
- let cleanValue = rawValue;
2428
- if (typeof cleanValue === "number") {
2429
- cleanValue = cleanValue.toString();
2430
- }
2431
- if (cleanValue.indexOf(",") >= 0) {
2432
- cleanValue = cleanValue.split(",")[0];
2433
- }
2434
- if (cleanValue.indexOf(":") >= 0) {
2435
- cleanValue = cleanValue.split(":")[0];
2436
- }
2437
- if (cleanValue.indexOf("#") >= 0) {
2438
- cleanValue = cleanValue.split("#")[1];
2439
- }
2440
- return cleanValue;
2441
- };
2442
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2443
- if (headerKey !== undefined) {
2444
- return sanitizeErrorCode(output.headers[headerKey]);
2445
- }
2446
- if (data.code !== undefined) {
2447
- return sanitizeErrorCode(data.code);
2448
- }
2449
- if (data["__type"] !== undefined) {
2450
- return sanitizeErrorCode(data["__type"]);
2451
- }
2452
- };
1
+ module.exports = require("../index.js");