@aws-sdk/client-security-ir 3.927.0 → 3.929.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 (53) hide show
  1. package/dist-cjs/index.js +1012 -1228
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/SecurityIRClient.js +2 -0
  4. package/dist-es/commands/BatchGetMemberAccountDetailsCommand.js +3 -9
  5. package/dist-es/commands/CancelMembershipCommand.js +3 -9
  6. package/dist-es/commands/CloseCaseCommand.js +3 -9
  7. package/dist-es/commands/CreateCaseCommand.js +3 -10
  8. package/dist-es/commands/CreateCaseCommentCommand.js +3 -10
  9. package/dist-es/commands/CreateMembershipCommand.js +3 -10
  10. package/dist-es/commands/GetCaseAttachmentDownloadUrlCommand.js +3 -10
  11. package/dist-es/commands/GetCaseAttachmentUploadUrlCommand.js +3 -10
  12. package/dist-es/commands/GetCaseCommand.js +3 -10
  13. package/dist-es/commands/GetMembershipCommand.js +3 -10
  14. package/dist-es/commands/ListCaseEditsCommand.js +3 -9
  15. package/dist-es/commands/ListCasesCommand.js +3 -10
  16. package/dist-es/commands/ListCommentsCommand.js +3 -10
  17. package/dist-es/commands/ListMembershipsCommand.js +3 -9
  18. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  19. package/dist-es/commands/TagResourceCommand.js +3 -9
  20. package/dist-es/commands/UntagResourceCommand.js +3 -9
  21. package/dist-es/commands/UpdateCaseCommand.js +3 -10
  22. package/dist-es/commands/UpdateCaseCommentCommand.js +3 -10
  23. package/dist-es/commands/UpdateCaseStatusCommand.js +3 -9
  24. package/dist-es/commands/UpdateMembershipCommand.js +3 -10
  25. package/dist-es/commands/UpdateResolverTypeCommand.js +3 -9
  26. package/dist-es/models/models_0.js +19 -118
  27. package/dist-es/runtimeConfig.shared.js +2 -0
  28. package/dist-es/schemas/schemas_0.js +929 -0
  29. package/dist-types/SecurityIRClient.d.ts +10 -1
  30. package/dist-types/commands/CreateCaseCommand.d.ts +1 -1
  31. package/dist-types/commands/CreateMembershipCommand.d.ts +3 -0
  32. package/dist-types/commands/GetCaseCommand.d.ts +1 -1
  33. package/dist-types/commands/GetMembershipCommand.d.ts +4 -1
  34. package/dist-types/commands/ListMembershipsCommand.d.ts +1 -1
  35. package/dist-types/commands/UpdateCaseCommand.d.ts +2 -2
  36. package/dist-types/commands/UpdateMembershipCommand.d.ts +3 -0
  37. package/dist-types/models/models_0.d.ts +32 -80
  38. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  39. package/dist-types/runtimeConfig.d.ts +1 -0
  40. package/dist-types/runtimeConfig.native.d.ts +1 -0
  41. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  42. package/dist-types/schemas/schemas_0.d.ts +124 -0
  43. package/dist-types/ts3.4/SecurityIRClient.d.ts +4 -0
  44. package/dist-types/ts3.4/models/models_0.d.ts +22 -58
  45. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  46. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  47. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  48. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  49. package/dist-types/ts3.4/schemas/schemas_0.d.ts +130 -0
  50. package/package.json +5 -6
  51. package/dist-es/protocols/Aws_restJson1.js +0 -913
  52. package/dist-types/protocols/Aws_restJson1.d.ts +0 -200
  53. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -269
@@ -1,913 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
4
- import { v4 as generateIdempotencyToken } from "@smithy/uuid";
5
- import { AccessDeniedException, ConflictException, InternalServerException, InvalidTokenException, ResourceNotFoundException, SecurityIncidentResponseNotActiveException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
- import { SecurityIRServiceException as __BaseException } from "../models/SecurityIRServiceException";
7
- export const se_BatchGetMemberAccountDetailsCommand = async (input, context) => {
8
- const b = rb(input, context);
9
- const headers = {
10
- "content-type": "application/json",
11
- };
12
- b.bp("/v1/membership/{membershipId}/batch-member-details");
13
- b.p("membershipId", () => input.membershipId, "{membershipId}", false);
14
- let body;
15
- body = JSON.stringify(take(input, {
16
- accountIds: (_) => _json(_),
17
- }));
18
- b.m("POST").h(headers).b(body);
19
- return b.build();
20
- };
21
- export const se_CancelMembershipCommand = async (input, context) => {
22
- const b = rb(input, context);
23
- const headers = {};
24
- b.bp("/v1/membership/{membershipId}");
25
- b.p("membershipId", () => input.membershipId, "{membershipId}", false);
26
- let body;
27
- b.m("PUT").h(headers).b(body);
28
- return b.build();
29
- };
30
- export const se_CloseCaseCommand = async (input, context) => {
31
- const b = rb(input, context);
32
- const headers = {};
33
- b.bp("/v1/cases/{caseId}/close-case");
34
- b.p("caseId", () => input.caseId, "{caseId}", false);
35
- let body;
36
- b.m("POST").h(headers).b(body);
37
- return b.build();
38
- };
39
- export const se_CreateCaseCommand = async (input, context) => {
40
- const b = rb(input, context);
41
- const headers = {
42
- "content-type": "application/json",
43
- };
44
- b.bp("/v1/create-case");
45
- let body;
46
- body = JSON.stringify(take(input, {
47
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
48
- description: [],
49
- engagementType: [],
50
- impactedAccounts: (_) => _json(_),
51
- impactedAwsRegions: (_) => _json(_),
52
- impactedServices: (_) => _json(_),
53
- reportedIncidentStartDate: (_) => _.getTime() / 1_000,
54
- resolverType: [],
55
- tags: (_) => _json(_),
56
- threatActorIpAddresses: (_) => _json(_),
57
- title: [],
58
- watchers: (_) => _json(_),
59
- }));
60
- b.m("POST").h(headers).b(body);
61
- return b.build();
62
- };
63
- export const se_CreateCaseCommentCommand = async (input, context) => {
64
- const b = rb(input, context);
65
- const headers = {
66
- "content-type": "application/json",
67
- };
68
- b.bp("/v1/cases/{caseId}/create-comment");
69
- b.p("caseId", () => input.caseId, "{caseId}", false);
70
- let body;
71
- body = JSON.stringify(take(input, {
72
- body: [],
73
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
74
- }));
75
- b.m("POST").h(headers).b(body);
76
- return b.build();
77
- };
78
- export const se_CreateMembershipCommand = async (input, context) => {
79
- const b = rb(input, context);
80
- const headers = {
81
- "content-type": "application/json",
82
- };
83
- b.bp("/v1/membership");
84
- let body;
85
- body = JSON.stringify(take(input, {
86
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
87
- coverEntireOrganization: [],
88
- incidentResponseTeam: (_) => _json(_),
89
- membershipName: [],
90
- optInFeatures: (_) => _json(_),
91
- tags: (_) => _json(_),
92
- }));
93
- b.m("POST").h(headers).b(body);
94
- return b.build();
95
- };
96
- export const se_GetCaseCommand = async (input, context) => {
97
- const b = rb(input, context);
98
- const headers = {};
99
- b.bp("/v1/cases/{caseId}/get-case");
100
- b.p("caseId", () => input.caseId, "{caseId}", false);
101
- let body;
102
- b.m("GET").h(headers).b(body);
103
- return b.build();
104
- };
105
- export const se_GetCaseAttachmentDownloadUrlCommand = async (input, context) => {
106
- const b = rb(input, context);
107
- const headers = {};
108
- b.bp("/v1/cases/{caseId}/get-presigned-url/{attachmentId}");
109
- b.p("caseId", () => input.caseId, "{caseId}", false);
110
- b.p("attachmentId", () => input.attachmentId, "{attachmentId}", false);
111
- let body;
112
- b.m("GET").h(headers).b(body);
113
- return b.build();
114
- };
115
- export const se_GetCaseAttachmentUploadUrlCommand = async (input, context) => {
116
- const b = rb(input, context);
117
- const headers = {
118
- "content-type": "application/json",
119
- };
120
- b.bp("/v1/cases/{caseId}/get-presigned-url");
121
- b.p("caseId", () => input.caseId, "{caseId}", false);
122
- let body;
123
- body = JSON.stringify(take(input, {
124
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
125
- contentLength: [],
126
- fileName: [],
127
- }));
128
- b.m("POST").h(headers).b(body);
129
- return b.build();
130
- };
131
- export const se_GetMembershipCommand = async (input, context) => {
132
- const b = rb(input, context);
133
- const headers = {};
134
- b.bp("/v1/membership/{membershipId}");
135
- b.p("membershipId", () => input.membershipId, "{membershipId}", false);
136
- let body;
137
- b.m("GET").h(headers).b(body);
138
- return b.build();
139
- };
140
- export const se_ListCaseEditsCommand = async (input, context) => {
141
- const b = rb(input, context);
142
- const headers = {
143
- "content-type": "application/json",
144
- };
145
- b.bp("/v1/cases/{caseId}/list-case-edits");
146
- b.p("caseId", () => input.caseId, "{caseId}", false);
147
- let body;
148
- body = JSON.stringify(take(input, {
149
- maxResults: [],
150
- nextToken: [],
151
- }));
152
- b.m("POST").h(headers).b(body);
153
- return b.build();
154
- };
155
- export const se_ListCasesCommand = async (input, context) => {
156
- const b = rb(input, context);
157
- const headers = {
158
- "content-type": "application/json",
159
- };
160
- b.bp("/v1/list-cases");
161
- let body;
162
- body = JSON.stringify(take(input, {
163
- maxResults: [],
164
- nextToken: [],
165
- }));
166
- b.m("POST").h(headers).b(body);
167
- return b.build();
168
- };
169
- export const se_ListCommentsCommand = async (input, context) => {
170
- const b = rb(input, context);
171
- const headers = {
172
- "content-type": "application/json",
173
- };
174
- b.bp("/v1/cases/{caseId}/list-comments");
175
- b.p("caseId", () => input.caseId, "{caseId}", false);
176
- let body;
177
- body = JSON.stringify(take(input, {
178
- maxResults: [],
179
- nextToken: [],
180
- }));
181
- b.m("POST").h(headers).b(body);
182
- return b.build();
183
- };
184
- export const se_ListMembershipsCommand = async (input, context) => {
185
- const b = rb(input, context);
186
- const headers = {
187
- "content-type": "application/json",
188
- };
189
- b.bp("/v1/memberships");
190
- let body;
191
- body = JSON.stringify(take(input, {
192
- maxResults: [],
193
- nextToken: [],
194
- }));
195
- b.m("POST").h(headers).b(body);
196
- return b.build();
197
- };
198
- export const se_ListTagsForResourceCommand = async (input, context) => {
199
- const b = rb(input, context);
200
- const headers = {};
201
- b.bp("/v1/tags/{resourceArn}");
202
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
203
- let body;
204
- b.m("GET").h(headers).b(body);
205
- return b.build();
206
- };
207
- export const se_TagResourceCommand = async (input, context) => {
208
- const b = rb(input, context);
209
- const headers = {
210
- "content-type": "application/json",
211
- };
212
- b.bp("/v1/tags/{resourceArn}");
213
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
214
- let body;
215
- body = JSON.stringify(take(input, {
216
- tags: (_) => _json(_),
217
- }));
218
- b.m("POST").h(headers).b(body);
219
- return b.build();
220
- };
221
- export const se_UntagResourceCommand = async (input, context) => {
222
- const b = rb(input, context);
223
- const headers = {};
224
- b.bp("/v1/tags/{resourceArn}");
225
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
226
- const query = map({
227
- [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK] || []],
228
- });
229
- let body;
230
- b.m("DELETE").h(headers).q(query).b(body);
231
- return b.build();
232
- };
233
- export const se_UpdateCaseCommand = async (input, context) => {
234
- const b = rb(input, context);
235
- const headers = {
236
- "content-type": "application/json",
237
- };
238
- b.bp("/v1/cases/{caseId}/update-case");
239
- b.p("caseId", () => input.caseId, "{caseId}", false);
240
- let body;
241
- body = JSON.stringify(take(input, {
242
- actualIncidentStartDate: (_) => _.getTime() / 1_000,
243
- description: [],
244
- engagementType: [],
245
- impactedAccountsToAdd: (_) => _json(_),
246
- impactedAccountsToDelete: (_) => _json(_),
247
- impactedAwsRegionsToAdd: (_) => _json(_),
248
- impactedAwsRegionsToDelete: (_) => _json(_),
249
- impactedServicesToAdd: (_) => _json(_),
250
- impactedServicesToDelete: (_) => _json(_),
251
- reportedIncidentStartDate: (_) => _.getTime() / 1_000,
252
- threatActorIpAddressesToAdd: (_) => _json(_),
253
- threatActorIpAddressesToDelete: (_) => _json(_),
254
- title: [],
255
- watchersToAdd: (_) => _json(_),
256
- watchersToDelete: (_) => _json(_),
257
- }));
258
- b.m("POST").h(headers).b(body);
259
- return b.build();
260
- };
261
- export const se_UpdateCaseCommentCommand = async (input, context) => {
262
- const b = rb(input, context);
263
- const headers = {
264
- "content-type": "application/json",
265
- };
266
- b.bp("/v1/cases/{caseId}/update-case-comment/{commentId}");
267
- b.p("caseId", () => input.caseId, "{caseId}", false);
268
- b.p("commentId", () => input.commentId, "{commentId}", false);
269
- let body;
270
- body = JSON.stringify(take(input, {
271
- body: [],
272
- }));
273
- b.m("PUT").h(headers).b(body);
274
- return b.build();
275
- };
276
- export const se_UpdateCaseStatusCommand = async (input, context) => {
277
- const b = rb(input, context);
278
- const headers = {
279
- "content-type": "application/json",
280
- };
281
- b.bp("/v1/cases/{caseId}/update-case-status");
282
- b.p("caseId", () => input.caseId, "{caseId}", false);
283
- let body;
284
- body = JSON.stringify(take(input, {
285
- caseStatus: [],
286
- }));
287
- b.m("POST").h(headers).b(body);
288
- return b.build();
289
- };
290
- export const se_UpdateMembershipCommand = async (input, context) => {
291
- const b = rb(input, context);
292
- const headers = {
293
- "content-type": "application/json",
294
- };
295
- b.bp("/v1/membership/{membershipId}/update-membership");
296
- b.p("membershipId", () => input.membershipId, "{membershipId}", false);
297
- let body;
298
- body = JSON.stringify(take(input, {
299
- incidentResponseTeam: (_) => _json(_),
300
- membershipAccountsConfigurationsUpdate: (_) => _json(_),
301
- membershipName: [],
302
- optInFeatures: (_) => _json(_),
303
- undoMembershipCancellation: [],
304
- }));
305
- b.m("PUT").h(headers).b(body);
306
- return b.build();
307
- };
308
- export const se_UpdateResolverTypeCommand = async (input, context) => {
309
- const b = rb(input, context);
310
- const headers = {
311
- "content-type": "application/json",
312
- };
313
- b.bp("/v1/cases/{caseId}/update-resolver-type");
314
- b.p("caseId", () => input.caseId, "{caseId}", false);
315
- let body;
316
- body = JSON.stringify(take(input, {
317
- resolverType: [],
318
- }));
319
- b.m("POST").h(headers).b(body);
320
- return b.build();
321
- };
322
- export const de_BatchGetMemberAccountDetailsCommand = async (output, context) => {
323
- if (output.statusCode !== 200 && output.statusCode >= 300) {
324
- return de_CommandError(output, context);
325
- }
326
- const contents = map({
327
- $metadata: deserializeMetadata(output),
328
- });
329
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
330
- const doc = take(data, {
331
- errors: _json,
332
- items: _json,
333
- });
334
- Object.assign(contents, doc);
335
- return contents;
336
- };
337
- export const de_CancelMembershipCommand = async (output, context) => {
338
- if (output.statusCode !== 200 && output.statusCode >= 300) {
339
- return de_CommandError(output, context);
340
- }
341
- const contents = map({
342
- $metadata: deserializeMetadata(output),
343
- });
344
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
345
- const doc = take(data, {
346
- membershipId: __expectString,
347
- });
348
- Object.assign(contents, doc);
349
- return contents;
350
- };
351
- export const de_CloseCaseCommand = async (output, context) => {
352
- if (output.statusCode !== 200 && output.statusCode >= 300) {
353
- return de_CommandError(output, context);
354
- }
355
- const contents = map({
356
- $metadata: deserializeMetadata(output),
357
- });
358
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
359
- const doc = take(data, {
360
- caseStatus: __expectString,
361
- closedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
362
- });
363
- Object.assign(contents, doc);
364
- return contents;
365
- };
366
- export const de_CreateCaseCommand = async (output, context) => {
367
- if (output.statusCode !== 201 && output.statusCode >= 300) {
368
- return de_CommandError(output, context);
369
- }
370
- const contents = map({
371
- $metadata: deserializeMetadata(output),
372
- });
373
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
374
- const doc = take(data, {
375
- caseId: __expectString,
376
- });
377
- Object.assign(contents, doc);
378
- return contents;
379
- };
380
- export const de_CreateCaseCommentCommand = async (output, context) => {
381
- if (output.statusCode !== 201 && output.statusCode >= 300) {
382
- return de_CommandError(output, context);
383
- }
384
- const contents = map({
385
- $metadata: deserializeMetadata(output),
386
- });
387
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
388
- const doc = take(data, {
389
- commentId: __expectString,
390
- });
391
- Object.assign(contents, doc);
392
- return contents;
393
- };
394
- export const de_CreateMembershipCommand = async (output, context) => {
395
- if (output.statusCode !== 201 && output.statusCode >= 300) {
396
- return de_CommandError(output, context);
397
- }
398
- const contents = map({
399
- $metadata: deserializeMetadata(output),
400
- });
401
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
402
- const doc = take(data, {
403
- membershipId: __expectString,
404
- });
405
- Object.assign(contents, doc);
406
- return contents;
407
- };
408
- export const de_GetCaseCommand = async (output, context) => {
409
- if (output.statusCode !== 200 && output.statusCode >= 300) {
410
- return de_CommandError(output, context);
411
- }
412
- const contents = map({
413
- $metadata: deserializeMetadata(output),
414
- });
415
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
416
- const doc = take(data, {
417
- actualIncidentStartDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
418
- caseArn: __expectString,
419
- caseAttachments: (_) => de_CaseAttachmentsList(_, context),
420
- caseStatus: __expectString,
421
- closedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
422
- closureCode: __expectString,
423
- createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
424
- description: __expectString,
425
- engagementType: __expectString,
426
- impactedAccounts: _json,
427
- impactedAwsRegions: _json,
428
- impactedServices: _json,
429
- lastUpdatedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
430
- pendingAction: __expectString,
431
- reportedIncidentStartDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
432
- resolverType: __expectString,
433
- threatActorIpAddresses: _json,
434
- title: __expectString,
435
- watchers: _json,
436
- });
437
- Object.assign(contents, doc);
438
- return contents;
439
- };
440
- export const de_GetCaseAttachmentDownloadUrlCommand = async (output, context) => {
441
- if (output.statusCode !== 201 && output.statusCode >= 300) {
442
- return de_CommandError(output, context);
443
- }
444
- const contents = map({
445
- $metadata: deserializeMetadata(output),
446
- });
447
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
448
- const doc = take(data, {
449
- attachmentPresignedUrl: __expectString,
450
- });
451
- Object.assign(contents, doc);
452
- return contents;
453
- };
454
- export const de_GetCaseAttachmentUploadUrlCommand = async (output, context) => {
455
- if (output.statusCode !== 201 && output.statusCode >= 300) {
456
- return de_CommandError(output, context);
457
- }
458
- const contents = map({
459
- $metadata: deserializeMetadata(output),
460
- });
461
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
462
- const doc = take(data, {
463
- attachmentPresignedUrl: __expectString,
464
- });
465
- Object.assign(contents, doc);
466
- return contents;
467
- };
468
- export const de_GetMembershipCommand = async (output, context) => {
469
- if (output.statusCode !== 200 && output.statusCode >= 300) {
470
- return de_CommandError(output, context);
471
- }
472
- const contents = map({
473
- $metadata: deserializeMetadata(output),
474
- });
475
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
476
- const doc = take(data, {
477
- accountId: __expectString,
478
- customerType: __expectString,
479
- incidentResponseTeam: _json,
480
- membershipAccountsConfigurations: _json,
481
- membershipActivationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
482
- membershipArn: __expectString,
483
- membershipDeactivationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
484
- membershipId: __expectString,
485
- membershipName: __expectString,
486
- membershipStatus: __expectString,
487
- numberOfAccountsCovered: __expectLong,
488
- optInFeatures: _json,
489
- region: __expectString,
490
- });
491
- Object.assign(contents, doc);
492
- return contents;
493
- };
494
- export const de_ListCaseEditsCommand = async (output, context) => {
495
- if (output.statusCode !== 200 && output.statusCode >= 300) {
496
- return de_CommandError(output, context);
497
- }
498
- const contents = map({
499
- $metadata: deserializeMetadata(output),
500
- });
501
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
502
- const doc = take(data, {
503
- items: (_) => de_CaseEditItems(_, context),
504
- nextToken: __expectString,
505
- total: __expectInt32,
506
- });
507
- Object.assign(contents, doc);
508
- return contents;
509
- };
510
- export const de_ListCasesCommand = async (output, context) => {
511
- if (output.statusCode !== 200 && output.statusCode >= 300) {
512
- return de_CommandError(output, context);
513
- }
514
- const contents = map({
515
- $metadata: deserializeMetadata(output),
516
- });
517
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
518
- const doc = take(data, {
519
- items: (_) => de_ListCasesItems(_, context),
520
- nextToken: __expectString,
521
- total: __expectLong,
522
- });
523
- Object.assign(contents, doc);
524
- return contents;
525
- };
526
- export const de_ListCommentsCommand = async (output, context) => {
527
- if (output.statusCode !== 200 && output.statusCode >= 300) {
528
- return de_CommandError(output, context);
529
- }
530
- const contents = map({
531
- $metadata: deserializeMetadata(output),
532
- });
533
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
534
- const doc = take(data, {
535
- items: (_) => de_ListCommentsItems(_, context),
536
- nextToken: __expectString,
537
- total: __expectInt32,
538
- });
539
- Object.assign(contents, doc);
540
- return contents;
541
- };
542
- export const de_ListMembershipsCommand = async (output, context) => {
543
- if (output.statusCode !== 200 && output.statusCode >= 300) {
544
- return de_CommandError(output, context);
545
- }
546
- const contents = map({
547
- $metadata: deserializeMetadata(output),
548
- });
549
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
550
- const doc = take(data, {
551
- items: _json,
552
- nextToken: __expectString,
553
- });
554
- Object.assign(contents, doc);
555
- return contents;
556
- };
557
- export const de_ListTagsForResourceCommand = async (output, context) => {
558
- if (output.statusCode !== 200 && output.statusCode >= 300) {
559
- return de_CommandError(output, context);
560
- }
561
- const contents = map({
562
- $metadata: deserializeMetadata(output),
563
- });
564
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
565
- const doc = take(data, {
566
- tags: _json,
567
- });
568
- Object.assign(contents, doc);
569
- return contents;
570
- };
571
- export const de_TagResourceCommand = async (output, context) => {
572
- if (output.statusCode !== 204 && output.statusCode >= 300) {
573
- return de_CommandError(output, context);
574
- }
575
- const contents = map({
576
- $metadata: deserializeMetadata(output),
577
- });
578
- await collectBody(output.body, context);
579
- return contents;
580
- };
581
- export const de_UntagResourceCommand = async (output, context) => {
582
- if (output.statusCode !== 200 && output.statusCode >= 300) {
583
- return de_CommandError(output, context);
584
- }
585
- const contents = map({
586
- $metadata: deserializeMetadata(output),
587
- });
588
- await collectBody(output.body, context);
589
- return contents;
590
- };
591
- export const de_UpdateCaseCommand = async (output, context) => {
592
- if (output.statusCode !== 200 && output.statusCode >= 300) {
593
- return de_CommandError(output, context);
594
- }
595
- const contents = map({
596
- $metadata: deserializeMetadata(output),
597
- });
598
- await collectBody(output.body, context);
599
- return contents;
600
- };
601
- export const de_UpdateCaseCommentCommand = async (output, context) => {
602
- if (output.statusCode !== 200 && output.statusCode >= 300) {
603
- return de_CommandError(output, context);
604
- }
605
- const contents = map({
606
- $metadata: deserializeMetadata(output),
607
- });
608
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
609
- const doc = take(data, {
610
- body: __expectString,
611
- commentId: __expectString,
612
- });
613
- Object.assign(contents, doc);
614
- return contents;
615
- };
616
- export const de_UpdateCaseStatusCommand = async (output, context) => {
617
- if (output.statusCode !== 201 && output.statusCode >= 300) {
618
- return de_CommandError(output, context);
619
- }
620
- const contents = map({
621
- $metadata: deserializeMetadata(output),
622
- });
623
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
624
- const doc = take(data, {
625
- caseStatus: __expectString,
626
- });
627
- Object.assign(contents, doc);
628
- return contents;
629
- };
630
- export const de_UpdateMembershipCommand = async (output, context) => {
631
- if (output.statusCode !== 200 && output.statusCode >= 300) {
632
- return de_CommandError(output, context);
633
- }
634
- const contents = map({
635
- $metadata: deserializeMetadata(output),
636
- });
637
- await collectBody(output.body, context);
638
- return contents;
639
- };
640
- export const de_UpdateResolverTypeCommand = async (output, context) => {
641
- if (output.statusCode !== 200 && output.statusCode >= 300) {
642
- return de_CommandError(output, context);
643
- }
644
- const contents = map({
645
- $metadata: deserializeMetadata(output),
646
- });
647
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
648
- const doc = take(data, {
649
- caseId: __expectString,
650
- caseStatus: __expectString,
651
- resolverType: __expectString,
652
- });
653
- Object.assign(contents, doc);
654
- return contents;
655
- };
656
- const de_CommandError = async (output, context) => {
657
- const parsedOutput = {
658
- ...output,
659
- body: await parseErrorBody(output.body, context),
660
- };
661
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
- switch (errorCode) {
663
- case "AccessDeniedException":
664
- case "com.amazonaws.securityir#AccessDeniedException":
665
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
666
- case "ConflictException":
667
- case "com.amazonaws.securityir#ConflictException":
668
- throw await de_ConflictExceptionRes(parsedOutput, context);
669
- case "InternalServerException":
670
- case "com.amazonaws.securityir#InternalServerException":
671
- throw await de_InternalServerExceptionRes(parsedOutput, context);
672
- case "InvalidTokenException":
673
- case "com.amazonaws.securityir#InvalidTokenException":
674
- throw await de_InvalidTokenExceptionRes(parsedOutput, context);
675
- case "ResourceNotFoundException":
676
- case "com.amazonaws.securityir#ResourceNotFoundException":
677
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
678
- case "SecurityIncidentResponseNotActiveException":
679
- case "com.amazonaws.securityir#SecurityIncidentResponseNotActiveException":
680
- throw await de_SecurityIncidentResponseNotActiveExceptionRes(parsedOutput, context);
681
- case "ServiceQuotaExceededException":
682
- case "com.amazonaws.securityir#ServiceQuotaExceededException":
683
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
684
- case "ThrottlingException":
685
- case "com.amazonaws.securityir#ThrottlingException":
686
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
687
- case "ValidationException":
688
- case "com.amazonaws.securityir#ValidationException":
689
- throw await de_ValidationExceptionRes(parsedOutput, context);
690
- default:
691
- const parsedBody = parsedOutput.body;
692
- return throwDefaultError({
693
- output,
694
- parsedBody,
695
- errorCode,
696
- });
697
- }
698
- };
699
- const throwDefaultError = withBaseException(__BaseException);
700
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
701
- const contents = map({});
702
- const data = parsedOutput.body;
703
- const doc = take(data, {
704
- message: __expectString,
705
- });
706
- Object.assign(contents, doc);
707
- const exception = new AccessDeniedException({
708
- $metadata: deserializeMetadata(parsedOutput),
709
- ...contents,
710
- });
711
- return __decorateServiceException(exception, parsedOutput.body);
712
- };
713
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
714
- const contents = map({});
715
- const data = parsedOutput.body;
716
- const doc = take(data, {
717
- message: __expectString,
718
- resourceId: __expectString,
719
- resourceType: __expectString,
720
- });
721
- Object.assign(contents, doc);
722
- const exception = new ConflictException({
723
- $metadata: deserializeMetadata(parsedOutput),
724
- ...contents,
725
- });
726
- return __decorateServiceException(exception, parsedOutput.body);
727
- };
728
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
729
- const contents = map({
730
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
731
- });
732
- const data = parsedOutput.body;
733
- const doc = take(data, {
734
- message: __expectString,
735
- });
736
- Object.assign(contents, doc);
737
- const exception = new InternalServerException({
738
- $metadata: deserializeMetadata(parsedOutput),
739
- ...contents,
740
- });
741
- return __decorateServiceException(exception, parsedOutput.body);
742
- };
743
- const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
744
- const contents = map({});
745
- const data = parsedOutput.body;
746
- const doc = take(data, {
747
- message: __expectString,
748
- });
749
- Object.assign(contents, doc);
750
- const exception = new InvalidTokenException({
751
- $metadata: deserializeMetadata(parsedOutput),
752
- ...contents,
753
- });
754
- return __decorateServiceException(exception, parsedOutput.body);
755
- };
756
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
757
- const contents = map({});
758
- const data = parsedOutput.body;
759
- const doc = take(data, {
760
- message: __expectString,
761
- });
762
- Object.assign(contents, doc);
763
- const exception = new ResourceNotFoundException({
764
- $metadata: deserializeMetadata(parsedOutput),
765
- ...contents,
766
- });
767
- return __decorateServiceException(exception, parsedOutput.body);
768
- };
769
- const de_SecurityIncidentResponseNotActiveExceptionRes = async (parsedOutput, context) => {
770
- const contents = map({});
771
- const data = parsedOutput.body;
772
- const doc = take(data, {
773
- message: __expectString,
774
- });
775
- Object.assign(contents, doc);
776
- const exception = new SecurityIncidentResponseNotActiveException({
777
- $metadata: deserializeMetadata(parsedOutput),
778
- ...contents,
779
- });
780
- return __decorateServiceException(exception, parsedOutput.body);
781
- };
782
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
783
- const contents = map({});
784
- const data = parsedOutput.body;
785
- const doc = take(data, {
786
- message: __expectString,
787
- quotaCode: __expectString,
788
- resourceId: __expectString,
789
- resourceType: __expectString,
790
- serviceCode: __expectString,
791
- });
792
- Object.assign(contents, doc);
793
- const exception = new ServiceQuotaExceededException({
794
- $metadata: deserializeMetadata(parsedOutput),
795
- ...contents,
796
- });
797
- return __decorateServiceException(exception, parsedOutput.body);
798
- };
799
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
800
- const contents = map({
801
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
802
- });
803
- const data = parsedOutput.body;
804
- const doc = take(data, {
805
- message: __expectString,
806
- quotaCode: __expectString,
807
- serviceCode: __expectString,
808
- });
809
- Object.assign(contents, doc);
810
- const exception = new ThrottlingException({
811
- $metadata: deserializeMetadata(parsedOutput),
812
- ...contents,
813
- });
814
- return __decorateServiceException(exception, parsedOutput.body);
815
- };
816
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
817
- const contents = map({});
818
- const data = parsedOutput.body;
819
- const doc = take(data, {
820
- fieldList: _json,
821
- message: __expectString,
822
- reason: __expectString,
823
- });
824
- Object.assign(contents, doc);
825
- const exception = new ValidationException({
826
- $metadata: deserializeMetadata(parsedOutput),
827
- ...contents,
828
- });
829
- return __decorateServiceException(exception, parsedOutput.body);
830
- };
831
- const de_CaseAttachmentAttributes = (output, context) => {
832
- return take(output, {
833
- attachmentId: __expectString,
834
- attachmentStatus: __expectString,
835
- createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
836
- creator: __expectString,
837
- fileName: __expectString,
838
- });
839
- };
840
- const de_CaseAttachmentsList = (output, context) => {
841
- const retVal = (output || [])
842
- .filter((e) => e != null)
843
- .map((entry) => {
844
- return de_CaseAttachmentAttributes(entry, context);
845
- });
846
- return retVal;
847
- };
848
- const de_CaseEditItem = (output, context) => {
849
- return take(output, {
850
- action: __expectString,
851
- eventTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
852
- message: __expectString,
853
- principal: __expectString,
854
- });
855
- };
856
- const de_CaseEditItems = (output, context) => {
857
- const retVal = (output || [])
858
- .filter((e) => e != null)
859
- .map((entry) => {
860
- return de_CaseEditItem(entry, context);
861
- });
862
- return retVal;
863
- };
864
- const de_ListCasesItem = (output, context) => {
865
- return take(output, {
866
- caseArn: __expectString,
867
- caseId: __expectString,
868
- caseStatus: __expectString,
869
- closedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
870
- createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
871
- engagementType: __expectString,
872
- lastUpdatedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
873
- pendingAction: __expectString,
874
- resolverType: __expectString,
875
- title: __expectString,
876
- });
877
- };
878
- const de_ListCasesItems = (output, context) => {
879
- const retVal = (output || [])
880
- .filter((e) => e != null)
881
- .map((entry) => {
882
- return de_ListCasesItem(entry, context);
883
- });
884
- return retVal;
885
- };
886
- const de_ListCommentsItem = (output, context) => {
887
- return take(output, {
888
- body: __expectString,
889
- commentId: __expectString,
890
- createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
891
- creator: __expectString,
892
- lastUpdatedBy: __expectString,
893
- lastUpdatedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
894
- });
895
- };
896
- const de_ListCommentsItems = (output, context) => {
897
- const retVal = (output || [])
898
- .filter((e) => e != null)
899
- .map((entry) => {
900
- return de_ListCommentsItem(entry, context);
901
- });
902
- return retVal;
903
- };
904
- const deserializeMetadata = (output) => ({
905
- httpStatusCode: output.statusCode,
906
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
907
- extendedRequestId: output.headers["x-amz-id-2"],
908
- cfId: output.headers["x-amz-cf-id"],
909
- });
910
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
911
- const _rAS = "retryAfterSeconds";
912
- const _ra = "retry-after";
913
- const _tK = "tagKeys";