@aws-sdk/client-ram 3.312.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { IdempotentParameterMismatchException, InvalidClientTokenException, InvalidMaxResultsException, InvalidNextTokenException, InvalidParameterException, InvalidResourceTypeException, InvalidStateTransitionException, MalformedArnException, MissingRequiredParameterException, OperationNotPermittedException, ResourceArnNotFoundException, ResourceShareInvitationAlreadyAcceptedException, ResourceShareInvitationAlreadyRejectedException, ResourceShareInvitationArnNotFoundException, ResourceShareInvitationExpiredException, ResourceShareLimitExceededException, ServerInternalException, ServiceUnavailableException, TagLimitExceededException, TagPolicyViolationException, ThrottlingException, UnknownResourceException, } from "../models/models_0";
4
4
  import { RAMServiceException as __BaseException } from "../models/RAMServiceException";
5
5
  export const se_AcceptResourceShareInvitationCommand = async (input, context) => {
@@ -9,10 +9,10 @@ export const se_AcceptResourceShareInvitationCommand = async (input, context) =>
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/acceptresourceshareinvitation";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.clientToken != null && { clientToken: input.clientToken }),
14
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
15
- });
12
+ body = JSON.stringify(take(input, {
13
+ clientToken: [],
14
+ resourceShareInvitationArn: [],
15
+ }));
16
16
  return new __HttpRequest({
17
17
  protocol,
18
18
  hostname,
@@ -30,12 +30,12 @@ export const se_AssociateResourceShareCommand = async (input, context) => {
30
30
  };
31
31
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associateresourceshare";
32
32
  let body;
33
- body = JSON.stringify({
34
- ...(input.clientToken != null && { clientToken: input.clientToken }),
35
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
36
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
37
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
38
- });
33
+ body = JSON.stringify(take(input, {
34
+ clientToken: [],
35
+ principals: (_) => _json(_),
36
+ resourceArns: (_) => _json(_),
37
+ resourceShareArn: [],
38
+ }));
39
39
  return new __HttpRequest({
40
40
  protocol,
41
41
  hostname,
@@ -53,13 +53,13 @@ export const se_AssociateResourceSharePermissionCommand = async (input, context)
53
53
  };
54
54
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associateresourcesharepermission";
55
55
  let body;
56
- body = JSON.stringify({
57
- ...(input.clientToken != null && { clientToken: input.clientToken }),
58
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
59
- ...(input.permissionVersion != null && { permissionVersion: input.permissionVersion }),
60
- ...(input.replace != null && { replace: input.replace }),
61
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
62
- });
56
+ body = JSON.stringify(take(input, {
57
+ clientToken: [],
58
+ permissionArn: [],
59
+ permissionVersion: [],
60
+ replace: [],
61
+ resourceShareArn: [],
62
+ }));
63
63
  return new __HttpRequest({
64
64
  protocol,
65
65
  hostname,
@@ -77,15 +77,15 @@ export const se_CreateResourceShareCommand = async (input, context) => {
77
77
  };
78
78
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/createresourceshare";
79
79
  let body;
80
- body = JSON.stringify({
81
- ...(input.allowExternalPrincipals != null && { allowExternalPrincipals: input.allowExternalPrincipals }),
82
- ...(input.clientToken != null && { clientToken: input.clientToken }),
83
- ...(input.name != null && { name: input.name }),
84
- ...(input.permissionArns != null && { permissionArns: se_PermissionArnList(input.permissionArns, context) }),
85
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
86
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
87
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
88
- });
80
+ body = JSON.stringify(take(input, {
81
+ allowExternalPrincipals: [],
82
+ clientToken: [],
83
+ name: [],
84
+ permissionArns: (_) => _json(_),
85
+ principals: (_) => _json(_),
86
+ resourceArns: (_) => _json(_),
87
+ tags: (_) => _json(_),
88
+ }));
89
89
  return new __HttpRequest({
90
90
  protocol,
91
91
  hostname,
@@ -123,12 +123,12 @@ export const se_DisassociateResourceShareCommand = async (input, context) => {
123
123
  };
124
124
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociateresourceshare";
125
125
  let body;
126
- body = JSON.stringify({
127
- ...(input.clientToken != null && { clientToken: input.clientToken }),
128
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
129
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
130
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
131
- });
126
+ body = JSON.stringify(take(input, {
127
+ clientToken: [],
128
+ principals: (_) => _json(_),
129
+ resourceArns: (_) => _json(_),
130
+ resourceShareArn: [],
131
+ }));
132
132
  return new __HttpRequest({
133
133
  protocol,
134
134
  hostname,
@@ -146,11 +146,11 @@ export const se_DisassociateResourceSharePermissionCommand = async (input, conte
146
146
  };
147
147
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociateresourcesharepermission";
148
148
  let body;
149
- body = JSON.stringify({
150
- ...(input.clientToken != null && { clientToken: input.clientToken }),
151
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
152
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
153
- });
149
+ body = JSON.stringify(take(input, {
150
+ clientToken: [],
151
+ permissionArn: [],
152
+ resourceShareArn: [],
153
+ }));
154
154
  return new __HttpRequest({
155
155
  protocol,
156
156
  hostname,
@@ -186,10 +186,10 @@ export const se_GetPermissionCommand = async (input, context) => {
186
186
  };
187
187
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getpermission";
188
188
  let body;
189
- body = JSON.stringify({
190
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
191
- ...(input.permissionVersion != null && { permissionVersion: input.permissionVersion }),
192
- });
189
+ body = JSON.stringify(take(input, {
190
+ permissionArn: [],
191
+ permissionVersion: [],
192
+ }));
193
193
  return new __HttpRequest({
194
194
  protocol,
195
195
  hostname,
@@ -207,12 +207,12 @@ export const se_GetResourcePoliciesCommand = async (input, context) => {
207
207
  };
208
208
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourcepolicies";
209
209
  let body;
210
- body = JSON.stringify({
211
- ...(input.maxResults != null && { maxResults: input.maxResults }),
212
- ...(input.nextToken != null && { nextToken: input.nextToken }),
213
- ...(input.principal != null && { principal: input.principal }),
214
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
215
- });
210
+ body = JSON.stringify(take(input, {
211
+ maxResults: [],
212
+ nextToken: [],
213
+ principal: [],
214
+ resourceArns: (_) => _json(_),
215
+ }));
216
216
  return new __HttpRequest({
217
217
  protocol,
218
218
  hostname,
@@ -230,17 +230,15 @@ export const se_GetResourceShareAssociationsCommand = async (input, context) =>
230
230
  };
231
231
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshareassociations";
232
232
  let body;
233
- body = JSON.stringify({
234
- ...(input.associationStatus != null && { associationStatus: input.associationStatus }),
235
- ...(input.associationType != null && { associationType: input.associationType }),
236
- ...(input.maxResults != null && { maxResults: input.maxResults }),
237
- ...(input.nextToken != null && { nextToken: input.nextToken }),
238
- ...(input.principal != null && { principal: input.principal }),
239
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
240
- ...(input.resourceShareArns != null && {
241
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
242
- }),
243
- });
233
+ body = JSON.stringify(take(input, {
234
+ associationStatus: [],
235
+ associationType: [],
236
+ maxResults: [],
237
+ nextToken: [],
238
+ principal: [],
239
+ resourceArn: [],
240
+ resourceShareArns: (_) => _json(_),
241
+ }));
244
242
  return new __HttpRequest({
245
243
  protocol,
246
244
  hostname,
@@ -258,16 +256,12 @@ export const se_GetResourceShareInvitationsCommand = async (input, context) => {
258
256
  };
259
257
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshareinvitations";
260
258
  let body;
261
- body = JSON.stringify({
262
- ...(input.maxResults != null && { maxResults: input.maxResults }),
263
- ...(input.nextToken != null && { nextToken: input.nextToken }),
264
- ...(input.resourceShareArns != null && {
265
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
266
- }),
267
- ...(input.resourceShareInvitationArns != null && {
268
- resourceShareInvitationArns: se_ResourceShareInvitationArnList(input.resourceShareInvitationArns, context),
269
- }),
270
- });
259
+ body = JSON.stringify(take(input, {
260
+ maxResults: [],
261
+ nextToken: [],
262
+ resourceShareArns: (_) => _json(_),
263
+ resourceShareInvitationArns: (_) => _json(_),
264
+ }));
271
265
  return new __HttpRequest({
272
266
  protocol,
273
267
  hostname,
@@ -285,18 +279,16 @@ export const se_GetResourceSharesCommand = async (input, context) => {
285
279
  };
286
280
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshares";
287
281
  let body;
288
- body = JSON.stringify({
289
- ...(input.maxResults != null && { maxResults: input.maxResults }),
290
- ...(input.name != null && { name: input.name }),
291
- ...(input.nextToken != null && { nextToken: input.nextToken }),
292
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
293
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
294
- ...(input.resourceShareArns != null && {
295
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
296
- }),
297
- ...(input.resourceShareStatus != null && { resourceShareStatus: input.resourceShareStatus }),
298
- ...(input.tagFilters != null && { tagFilters: se_TagFilters(input.tagFilters, context) }),
299
- });
282
+ body = JSON.stringify(take(input, {
283
+ maxResults: [],
284
+ name: [],
285
+ nextToken: [],
286
+ permissionArn: [],
287
+ resourceOwner: [],
288
+ resourceShareArns: (_) => _json(_),
289
+ resourceShareStatus: [],
290
+ tagFilters: (_) => _json(_),
291
+ }));
300
292
  return new __HttpRequest({
301
293
  protocol,
302
294
  hostname,
@@ -314,12 +306,12 @@ export const se_ListPendingInvitationResourcesCommand = async (input, context) =
314
306
  };
315
307
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpendinginvitationresources";
316
308
  let body;
317
- body = JSON.stringify({
318
- ...(input.maxResults != null && { maxResults: input.maxResults }),
319
- ...(input.nextToken != null && { nextToken: input.nextToken }),
320
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
321
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
322
- });
309
+ body = JSON.stringify(take(input, {
310
+ maxResults: [],
311
+ nextToken: [],
312
+ resourceRegionScope: [],
313
+ resourceShareInvitationArn: [],
314
+ }));
323
315
  return new __HttpRequest({
324
316
  protocol,
325
317
  hostname,
@@ -337,11 +329,11 @@ export const se_ListPermissionsCommand = async (input, context) => {
337
329
  };
338
330
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpermissions";
339
331
  let body;
340
- body = JSON.stringify({
341
- ...(input.maxResults != null && { maxResults: input.maxResults }),
342
- ...(input.nextToken != null && { nextToken: input.nextToken }),
343
- ...(input.resourceType != null && { resourceType: input.resourceType }),
344
- });
332
+ body = JSON.stringify(take(input, {
333
+ maxResults: [],
334
+ nextToken: [],
335
+ resourceType: [],
336
+ }));
345
337
  return new __HttpRequest({
346
338
  protocol,
347
339
  hostname,
@@ -359,11 +351,11 @@ export const se_ListPermissionVersionsCommand = async (input, context) => {
359
351
  };
360
352
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpermissionversions";
361
353
  let body;
362
- body = JSON.stringify({
363
- ...(input.maxResults != null && { maxResults: input.maxResults }),
364
- ...(input.nextToken != null && { nextToken: input.nextToken }),
365
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
366
- });
354
+ body = JSON.stringify(take(input, {
355
+ maxResults: [],
356
+ nextToken: [],
357
+ permissionArn: [],
358
+ }));
367
359
  return new __HttpRequest({
368
360
  protocol,
369
361
  hostname,
@@ -381,17 +373,15 @@ export const se_ListPrincipalsCommand = async (input, context) => {
381
373
  };
382
374
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listprincipals";
383
375
  let body;
384
- body = JSON.stringify({
385
- ...(input.maxResults != null && { maxResults: input.maxResults }),
386
- ...(input.nextToken != null && { nextToken: input.nextToken }),
387
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
388
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
389
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
390
- ...(input.resourceShareArns != null && {
391
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
392
- }),
393
- ...(input.resourceType != null && { resourceType: input.resourceType }),
394
- });
376
+ body = JSON.stringify(take(input, {
377
+ maxResults: [],
378
+ nextToken: [],
379
+ principals: (_) => _json(_),
380
+ resourceArn: [],
381
+ resourceOwner: [],
382
+ resourceShareArns: (_) => _json(_),
383
+ resourceType: [],
384
+ }));
395
385
  return new __HttpRequest({
396
386
  protocol,
397
387
  hostname,
@@ -409,18 +399,16 @@ export const se_ListResourcesCommand = async (input, context) => {
409
399
  };
410
400
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresources";
411
401
  let body;
412
- body = JSON.stringify({
413
- ...(input.maxResults != null && { maxResults: input.maxResults }),
414
- ...(input.nextToken != null && { nextToken: input.nextToken }),
415
- ...(input.principal != null && { principal: input.principal }),
416
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
417
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
418
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
419
- ...(input.resourceShareArns != null && {
420
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
421
- }),
422
- ...(input.resourceType != null && { resourceType: input.resourceType }),
423
- });
402
+ body = JSON.stringify(take(input, {
403
+ maxResults: [],
404
+ nextToken: [],
405
+ principal: [],
406
+ resourceArns: (_) => _json(_),
407
+ resourceOwner: [],
408
+ resourceRegionScope: [],
409
+ resourceShareArns: (_) => _json(_),
410
+ resourceType: [],
411
+ }));
424
412
  return new __HttpRequest({
425
413
  protocol,
426
414
  hostname,
@@ -438,11 +426,11 @@ export const se_ListResourceSharePermissionsCommand = async (input, context) =>
438
426
  };
439
427
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresourcesharepermissions";
440
428
  let body;
441
- body = JSON.stringify({
442
- ...(input.maxResults != null && { maxResults: input.maxResults }),
443
- ...(input.nextToken != null && { nextToken: input.nextToken }),
444
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
445
- });
429
+ body = JSON.stringify(take(input, {
430
+ maxResults: [],
431
+ nextToken: [],
432
+ resourceShareArn: [],
433
+ }));
446
434
  return new __HttpRequest({
447
435
  protocol,
448
436
  hostname,
@@ -460,11 +448,11 @@ export const se_ListResourceTypesCommand = async (input, context) => {
460
448
  };
461
449
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresourcetypes";
462
450
  let body;
463
- body = JSON.stringify({
464
- ...(input.maxResults != null && { maxResults: input.maxResults }),
465
- ...(input.nextToken != null && { nextToken: input.nextToken }),
466
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
467
- });
451
+ body = JSON.stringify(take(input, {
452
+ maxResults: [],
453
+ nextToken: [],
454
+ resourceRegionScope: [],
455
+ }));
468
456
  return new __HttpRequest({
469
457
  protocol,
470
458
  hostname,
@@ -501,10 +489,10 @@ export const se_RejectResourceShareInvitationCommand = async (input, context) =>
501
489
  };
502
490
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rejectresourceshareinvitation";
503
491
  let body;
504
- body = JSON.stringify({
505
- ...(input.clientToken != null && { clientToken: input.clientToken }),
506
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
507
- });
492
+ body = JSON.stringify(take(input, {
493
+ clientToken: [],
494
+ resourceShareInvitationArn: [],
495
+ }));
508
496
  return new __HttpRequest({
509
497
  protocol,
510
498
  hostname,
@@ -522,10 +510,10 @@ export const se_TagResourceCommand = async (input, context) => {
522
510
  };
523
511
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tagresource";
524
512
  let body;
525
- body = JSON.stringify({
526
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
527
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
528
- });
513
+ body = JSON.stringify(take(input, {
514
+ resourceShareArn: [],
515
+ tags: (_) => _json(_),
516
+ }));
529
517
  return new __HttpRequest({
530
518
  protocol,
531
519
  hostname,
@@ -543,10 +531,10 @@ export const se_UntagResourceCommand = async (input, context) => {
543
531
  };
544
532
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/untagresource";
545
533
  let body;
546
- body = JSON.stringify({
547
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
548
- ...(input.tagKeys != null && { tagKeys: se_TagKeyList(input.tagKeys, context) }),
549
- });
534
+ body = JSON.stringify(take(input, {
535
+ resourceShareArn: [],
536
+ tagKeys: (_) => _json(_),
537
+ }));
550
538
  return new __HttpRequest({
551
539
  protocol,
552
540
  hostname,
@@ -564,12 +552,12 @@ export const se_UpdateResourceShareCommand = async (input, context) => {
564
552
  };
565
553
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/updateresourceshare";
566
554
  let body;
567
- body = JSON.stringify({
568
- ...(input.allowExternalPrincipals != null && { allowExternalPrincipals: input.allowExternalPrincipals }),
569
- ...(input.clientToken != null && { clientToken: input.clientToken }),
570
- ...(input.name != null && { name: input.name }),
571
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
572
- });
555
+ body = JSON.stringify(take(input, {
556
+ allowExternalPrincipals: [],
557
+ clientToken: [],
558
+ name: [],
559
+ resourceShareArn: [],
560
+ }));
573
561
  return new __HttpRequest({
574
562
  protocol,
575
563
  hostname,
@@ -588,12 +576,11 @@ export const de_AcceptResourceShareInvitationCommand = async (output, context) =
588
576
  $metadata: deserializeMetadata(output),
589
577
  });
590
578
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
591
- if (data.clientToken != null) {
592
- contents.clientToken = __expectString(data.clientToken);
593
- }
594
- if (data.resourceShareInvitation != null) {
595
- contents.resourceShareInvitation = de_ResourceShareInvitation(data.resourceShareInvitation, context);
596
- }
579
+ const doc = take(data, {
580
+ clientToken: __expectString,
581
+ resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context),
582
+ });
583
+ Object.assign(contents, doc);
597
584
  return contents;
598
585
  };
599
586
  const de_AcceptResourceShareInvitationCommandError = async (output, context) => {
@@ -635,10 +622,9 @@ const de_AcceptResourceShareInvitationCommandError = async (output, context) =>
635
622
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
636
623
  default:
637
624
  const parsedBody = parsedOutput.body;
638
- throwDefaultError({
625
+ return throwDefaultError({
639
626
  output,
640
627
  parsedBody,
641
- exceptionCtor: __BaseException,
642
628
  errorCode,
643
629
  });
644
630
  }
@@ -651,12 +637,11 @@ export const de_AssociateResourceShareCommand = async (output, context) => {
651
637
  $metadata: deserializeMetadata(output),
652
638
  });
653
639
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
654
- if (data.clientToken != null) {
655
- contents.clientToken = __expectString(data.clientToken);
656
- }
657
- if (data.resourceShareAssociations != null) {
658
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
659
- }
640
+ const doc = take(data, {
641
+ clientToken: __expectString,
642
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
643
+ });
644
+ Object.assign(contents, doc);
660
645
  return contents;
661
646
  };
662
647
  const de_AssociateResourceShareCommandError = async (output, context) => {
@@ -701,10 +686,9 @@ const de_AssociateResourceShareCommandError = async (output, context) => {
701
686
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
702
687
  default:
703
688
  const parsedBody = parsedOutput.body;
704
- throwDefaultError({
689
+ return throwDefaultError({
705
690
  output,
706
691
  parsedBody,
707
- exceptionCtor: __BaseException,
708
692
  errorCode,
709
693
  });
710
694
  }
@@ -717,12 +701,11 @@ export const de_AssociateResourceSharePermissionCommand = async (output, context
717
701
  $metadata: deserializeMetadata(output),
718
702
  });
719
703
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
720
- if (data.clientToken != null) {
721
- contents.clientToken = __expectString(data.clientToken);
722
- }
723
- if (data.returnValue != null) {
724
- contents.returnValue = __expectBoolean(data.returnValue);
725
- }
704
+ const doc = take(data, {
705
+ clientToken: __expectString,
706
+ returnValue: __expectBoolean,
707
+ });
708
+ Object.assign(contents, doc);
726
709
  return contents;
727
710
  };
728
711
  const de_AssociateResourceSharePermissionCommandError = async (output, context) => {
@@ -755,10 +738,9 @@ const de_AssociateResourceSharePermissionCommandError = async (output, context)
755
738
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
756
739
  default:
757
740
  const parsedBody = parsedOutput.body;
758
- throwDefaultError({
741
+ return throwDefaultError({
759
742
  output,
760
743
  parsedBody,
761
- exceptionCtor: __BaseException,
762
744
  errorCode,
763
745
  });
764
746
  }
@@ -771,12 +753,11 @@ export const de_CreateResourceShareCommand = async (output, context) => {
771
753
  $metadata: deserializeMetadata(output),
772
754
  });
773
755
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
774
- if (data.clientToken != null) {
775
- contents.clientToken = __expectString(data.clientToken);
776
- }
777
- if (data.resourceShare != null) {
778
- contents.resourceShare = de_ResourceShare(data.resourceShare, context);
779
- }
756
+ const doc = take(data, {
757
+ clientToken: __expectString,
758
+ resourceShare: (_) => de_ResourceShare(_, context),
759
+ });
760
+ Object.assign(contents, doc);
780
761
  return contents;
781
762
  };
782
763
  const de_CreateResourceShareCommandError = async (output, context) => {
@@ -821,10 +802,9 @@ const de_CreateResourceShareCommandError = async (output, context) => {
821
802
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
822
803
  default:
823
804
  const parsedBody = parsedOutput.body;
824
- throwDefaultError({
805
+ return throwDefaultError({
825
806
  output,
826
807
  parsedBody,
827
- exceptionCtor: __BaseException,
828
808
  errorCode,
829
809
  });
830
810
  }
@@ -837,12 +817,11 @@ export const de_DeleteResourceShareCommand = async (output, context) => {
837
817
  $metadata: deserializeMetadata(output),
838
818
  });
839
819
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
840
- if (data.clientToken != null) {
841
- contents.clientToken = __expectString(data.clientToken);
842
- }
843
- if (data.returnValue != null) {
844
- contents.returnValue = __expectBoolean(data.returnValue);
845
- }
820
+ const doc = take(data, {
821
+ clientToken: __expectString,
822
+ returnValue: __expectBoolean,
823
+ });
824
+ Object.assign(contents, doc);
846
825
  return contents;
847
826
  };
848
827
  const de_DeleteResourceShareCommandError = async (output, context) => {
@@ -881,10 +860,9 @@ const de_DeleteResourceShareCommandError = async (output, context) => {
881
860
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
882
861
  default:
883
862
  const parsedBody = parsedOutput.body;
884
- throwDefaultError({
863
+ return throwDefaultError({
885
864
  output,
886
865
  parsedBody,
887
- exceptionCtor: __BaseException,
888
866
  errorCode,
889
867
  });
890
868
  }
@@ -897,12 +875,11 @@ export const de_DisassociateResourceShareCommand = async (output, context) => {
897
875
  $metadata: deserializeMetadata(output),
898
876
  });
899
877
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
900
- if (data.clientToken != null) {
901
- contents.clientToken = __expectString(data.clientToken);
902
- }
903
- if (data.resourceShareAssociations != null) {
904
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
905
- }
878
+ const doc = take(data, {
879
+ clientToken: __expectString,
880
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
881
+ });
882
+ Object.assign(contents, doc);
906
883
  return contents;
907
884
  };
908
885
  const de_DisassociateResourceShareCommandError = async (output, context) => {
@@ -944,10 +921,9 @@ const de_DisassociateResourceShareCommandError = async (output, context) => {
944
921
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
945
922
  default:
946
923
  const parsedBody = parsedOutput.body;
947
- throwDefaultError({
924
+ return throwDefaultError({
948
925
  output,
949
926
  parsedBody,
950
- exceptionCtor: __BaseException,
951
927
  errorCode,
952
928
  });
953
929
  }
@@ -960,12 +936,11 @@ export const de_DisassociateResourceSharePermissionCommand = async (output, cont
960
936
  $metadata: deserializeMetadata(output),
961
937
  });
962
938
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
963
- if (data.clientToken != null) {
964
- contents.clientToken = __expectString(data.clientToken);
965
- }
966
- if (data.returnValue != null) {
967
- contents.returnValue = __expectBoolean(data.returnValue);
968
- }
939
+ const doc = take(data, {
940
+ clientToken: __expectString,
941
+ returnValue: __expectBoolean,
942
+ });
943
+ Object.assign(contents, doc);
969
944
  return contents;
970
945
  };
971
946
  const de_DisassociateResourceSharePermissionCommandError = async (output, context) => {
@@ -1001,10 +976,9 @@ const de_DisassociateResourceSharePermissionCommandError = async (output, contex
1001
976
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1002
977
  default:
1003
978
  const parsedBody = parsedOutput.body;
1004
- throwDefaultError({
979
+ return throwDefaultError({
1005
980
  output,
1006
981
  parsedBody,
1007
- exceptionCtor: __BaseException,
1008
982
  errorCode,
1009
983
  });
1010
984
  }
@@ -1017,9 +991,10 @@ export const de_EnableSharingWithAwsOrganizationCommand = async (output, context
1017
991
  $metadata: deserializeMetadata(output),
1018
992
  });
1019
993
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1020
- if (data.returnValue != null) {
1021
- contents.returnValue = __expectBoolean(data.returnValue);
1022
- }
994
+ const doc = take(data, {
995
+ returnValue: __expectBoolean,
996
+ });
997
+ Object.assign(contents, doc);
1023
998
  return contents;
1024
999
  };
1025
1000
  const de_EnableSharingWithAwsOrganizationCommandError = async (output, context) => {
@@ -1040,10 +1015,9 @@ const de_EnableSharingWithAwsOrganizationCommandError = async (output, context)
1040
1015
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1041
1016
  default:
1042
1017
  const parsedBody = parsedOutput.body;
1043
- throwDefaultError({
1018
+ return throwDefaultError({
1044
1019
  output,
1045
1020
  parsedBody,
1046
- exceptionCtor: __BaseException,
1047
1021
  errorCode,
1048
1022
  });
1049
1023
  }
@@ -1056,9 +1030,10 @@ export const de_GetPermissionCommand = async (output, context) => {
1056
1030
  $metadata: deserializeMetadata(output),
1057
1031
  });
1058
1032
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1059
- if (data.permission != null) {
1060
- contents.permission = de_ResourceSharePermissionDetail(data.permission, context);
1061
- }
1033
+ const doc = take(data, {
1034
+ permission: (_) => de_ResourceSharePermissionDetail(_, context),
1035
+ });
1036
+ Object.assign(contents, doc);
1062
1037
  return contents;
1063
1038
  };
1064
1039
  const de_GetPermissionCommandError = async (output, context) => {
@@ -1088,10 +1063,9 @@ const de_GetPermissionCommandError = async (output, context) => {
1088
1063
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1089
1064
  default:
1090
1065
  const parsedBody = parsedOutput.body;
1091
- throwDefaultError({
1066
+ return throwDefaultError({
1092
1067
  output,
1093
1068
  parsedBody,
1094
- exceptionCtor: __BaseException,
1095
1069
  errorCode,
1096
1070
  });
1097
1071
  }
@@ -1104,12 +1078,11 @@ export const de_GetResourcePoliciesCommand = async (output, context) => {
1104
1078
  $metadata: deserializeMetadata(output),
1105
1079
  });
1106
1080
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1107
- if (data.nextToken != null) {
1108
- contents.nextToken = __expectString(data.nextToken);
1109
- }
1110
- if (data.policies != null) {
1111
- contents.policies = de_PolicyList(data.policies, context);
1112
- }
1081
+ const doc = take(data, {
1082
+ nextToken: __expectString,
1083
+ policies: _json,
1084
+ });
1085
+ Object.assign(contents, doc);
1113
1086
  return contents;
1114
1087
  };
1115
1088
  const de_GetResourcePoliciesCommandError = async (output, context) => {
@@ -1139,10 +1112,9 @@ const de_GetResourcePoliciesCommandError = async (output, context) => {
1139
1112
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1140
1113
  default:
1141
1114
  const parsedBody = parsedOutput.body;
1142
- throwDefaultError({
1115
+ return throwDefaultError({
1143
1116
  output,
1144
1117
  parsedBody,
1145
- exceptionCtor: __BaseException,
1146
1118
  errorCode,
1147
1119
  });
1148
1120
  }
@@ -1155,12 +1127,11 @@ export const de_GetResourceShareAssociationsCommand = async (output, context) =>
1155
1127
  $metadata: deserializeMetadata(output),
1156
1128
  });
1157
1129
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1158
- if (data.nextToken != null) {
1159
- contents.nextToken = __expectString(data.nextToken);
1160
- }
1161
- if (data.resourceShareAssociations != null) {
1162
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
1163
- }
1130
+ const doc = take(data, {
1131
+ nextToken: __expectString,
1132
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
1133
+ });
1134
+ Object.assign(contents, doc);
1164
1135
  return contents;
1165
1136
  };
1166
1137
  const de_GetResourceShareAssociationsCommandError = async (output, context) => {
@@ -1193,10 +1164,9 @@ const de_GetResourceShareAssociationsCommandError = async (output, context) => {
1193
1164
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1194
1165
  default:
1195
1166
  const parsedBody = parsedOutput.body;
1196
- throwDefaultError({
1167
+ return throwDefaultError({
1197
1168
  output,
1198
1169
  parsedBody,
1199
- exceptionCtor: __BaseException,
1200
1170
  errorCode,
1201
1171
  });
1202
1172
  }
@@ -1209,12 +1179,11 @@ export const de_GetResourceShareInvitationsCommand = async (output, context) =>
1209
1179
  $metadata: deserializeMetadata(output),
1210
1180
  });
1211
1181
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1212
- if (data.nextToken != null) {
1213
- contents.nextToken = __expectString(data.nextToken);
1214
- }
1215
- if (data.resourceShareInvitations != null) {
1216
- contents.resourceShareInvitations = de_ResourceShareInvitationList(data.resourceShareInvitations, context);
1217
- }
1182
+ const doc = take(data, {
1183
+ nextToken: __expectString,
1184
+ resourceShareInvitations: (_) => de_ResourceShareInvitationList(_, context),
1185
+ });
1186
+ Object.assign(contents, doc);
1218
1187
  return contents;
1219
1188
  };
1220
1189
  const de_GetResourceShareInvitationsCommandError = async (output, context) => {
@@ -1250,10 +1219,9 @@ const de_GetResourceShareInvitationsCommandError = async (output, context) => {
1250
1219
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1251
1220
  default:
1252
1221
  const parsedBody = parsedOutput.body;
1253
- throwDefaultError({
1222
+ return throwDefaultError({
1254
1223
  output,
1255
1224
  parsedBody,
1256
- exceptionCtor: __BaseException,
1257
1225
  errorCode,
1258
1226
  });
1259
1227
  }
@@ -1266,12 +1234,11 @@ export const de_GetResourceSharesCommand = async (output, context) => {
1266
1234
  $metadata: deserializeMetadata(output),
1267
1235
  });
1268
1236
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1269
- if (data.nextToken != null) {
1270
- contents.nextToken = __expectString(data.nextToken);
1271
- }
1272
- if (data.resourceShares != null) {
1273
- contents.resourceShares = de_ResourceShareList(data.resourceShares, context);
1274
- }
1237
+ const doc = take(data, {
1238
+ nextToken: __expectString,
1239
+ resourceShares: (_) => de_ResourceShareList(_, context),
1240
+ });
1241
+ Object.assign(contents, doc);
1275
1242
  return contents;
1276
1243
  };
1277
1244
  const de_GetResourceSharesCommandError = async (output, context) => {
@@ -1301,10 +1268,9 @@ const de_GetResourceSharesCommandError = async (output, context) => {
1301
1268
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1302
1269
  default:
1303
1270
  const parsedBody = parsedOutput.body;
1304
- throwDefaultError({
1271
+ return throwDefaultError({
1305
1272
  output,
1306
1273
  parsedBody,
1307
- exceptionCtor: __BaseException,
1308
1274
  errorCode,
1309
1275
  });
1310
1276
  }
@@ -1317,12 +1283,11 @@ export const de_ListPendingInvitationResourcesCommand = async (output, context)
1317
1283
  $metadata: deserializeMetadata(output),
1318
1284
  });
1319
1285
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1320
- if (data.nextToken != null) {
1321
- contents.nextToken = __expectString(data.nextToken);
1322
- }
1323
- if (data.resources != null) {
1324
- contents.resources = de_ResourceList(data.resources, context);
1325
- }
1286
+ const doc = take(data, {
1287
+ nextToken: __expectString,
1288
+ resources: (_) => de_ResourceList(_, context),
1289
+ });
1290
+ Object.assign(contents, doc);
1326
1291
  return contents;
1327
1292
  };
1328
1293
  const de_ListPendingInvitationResourcesCommandError = async (output, context) => {
@@ -1361,10 +1326,9 @@ const de_ListPendingInvitationResourcesCommandError = async (output, context) =>
1361
1326
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1362
1327
  default:
1363
1328
  const parsedBody = parsedOutput.body;
1364
- throwDefaultError({
1329
+ return throwDefaultError({
1365
1330
  output,
1366
1331
  parsedBody,
1367
- exceptionCtor: __BaseException,
1368
1332
  errorCode,
1369
1333
  });
1370
1334
  }
@@ -1377,12 +1341,11 @@ export const de_ListPermissionsCommand = async (output, context) => {
1377
1341
  $metadata: deserializeMetadata(output),
1378
1342
  });
1379
1343
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1380
- if (data.nextToken != null) {
1381
- contents.nextToken = __expectString(data.nextToken);
1382
- }
1383
- if (data.permissions != null) {
1384
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1385
- }
1344
+ const doc = take(data, {
1345
+ nextToken: __expectString,
1346
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1347
+ });
1348
+ Object.assign(contents, doc);
1386
1349
  return contents;
1387
1350
  };
1388
1351
  const de_ListPermissionsCommandError = async (output, context) => {
@@ -1409,10 +1372,9 @@ const de_ListPermissionsCommandError = async (output, context) => {
1409
1372
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1410
1373
  default:
1411
1374
  const parsedBody = parsedOutput.body;
1412
- throwDefaultError({
1375
+ return throwDefaultError({
1413
1376
  output,
1414
1377
  parsedBody,
1415
- exceptionCtor: __BaseException,
1416
1378
  errorCode,
1417
1379
  });
1418
1380
  }
@@ -1425,12 +1387,11 @@ export const de_ListPermissionVersionsCommand = async (output, context) => {
1425
1387
  $metadata: deserializeMetadata(output),
1426
1388
  });
1427
1389
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1428
- if (data.nextToken != null) {
1429
- contents.nextToken = __expectString(data.nextToken);
1430
- }
1431
- if (data.permissions != null) {
1432
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1433
- }
1390
+ const doc = take(data, {
1391
+ nextToken: __expectString,
1392
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1393
+ });
1394
+ Object.assign(contents, doc);
1434
1395
  return contents;
1435
1396
  };
1436
1397
  const de_ListPermissionVersionsCommandError = async (output, context) => {
@@ -1463,10 +1424,9 @@ const de_ListPermissionVersionsCommandError = async (output, context) => {
1463
1424
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1464
1425
  default:
1465
1426
  const parsedBody = parsedOutput.body;
1466
- throwDefaultError({
1427
+ return throwDefaultError({
1467
1428
  output,
1468
1429
  parsedBody,
1469
- exceptionCtor: __BaseException,
1470
1430
  errorCode,
1471
1431
  });
1472
1432
  }
@@ -1479,12 +1439,11 @@ export const de_ListPrincipalsCommand = async (output, context) => {
1479
1439
  $metadata: deserializeMetadata(output),
1480
1440
  });
1481
1441
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1482
- if (data.nextToken != null) {
1483
- contents.nextToken = __expectString(data.nextToken);
1484
- }
1485
- if (data.principals != null) {
1486
- contents.principals = de_PrincipalList(data.principals, context);
1487
- }
1442
+ const doc = take(data, {
1443
+ nextToken: __expectString,
1444
+ principals: (_) => de_PrincipalList(_, context),
1445
+ });
1446
+ Object.assign(contents, doc);
1488
1447
  return contents;
1489
1448
  };
1490
1449
  const de_ListPrincipalsCommandError = async (output, context) => {
@@ -1514,10 +1473,9 @@ const de_ListPrincipalsCommandError = async (output, context) => {
1514
1473
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1515
1474
  default:
1516
1475
  const parsedBody = parsedOutput.body;
1517
- throwDefaultError({
1476
+ return throwDefaultError({
1518
1477
  output,
1519
1478
  parsedBody,
1520
- exceptionCtor: __BaseException,
1521
1479
  errorCode,
1522
1480
  });
1523
1481
  }
@@ -1530,12 +1488,11 @@ export const de_ListResourcesCommand = async (output, context) => {
1530
1488
  $metadata: deserializeMetadata(output),
1531
1489
  });
1532
1490
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1533
- if (data.nextToken != null) {
1534
- contents.nextToken = __expectString(data.nextToken);
1535
- }
1536
- if (data.resources != null) {
1537
- contents.resources = de_ResourceList(data.resources, context);
1538
- }
1491
+ const doc = take(data, {
1492
+ nextToken: __expectString,
1493
+ resources: (_) => de_ResourceList(_, context),
1494
+ });
1495
+ Object.assign(contents, doc);
1539
1496
  return contents;
1540
1497
  };
1541
1498
  const de_ListResourcesCommandError = async (output, context) => {
@@ -1568,10 +1525,9 @@ const de_ListResourcesCommandError = async (output, context) => {
1568
1525
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1569
1526
  default:
1570
1527
  const parsedBody = parsedOutput.body;
1571
- throwDefaultError({
1528
+ return throwDefaultError({
1572
1529
  output,
1573
1530
  parsedBody,
1574
- exceptionCtor: __BaseException,
1575
1531
  errorCode,
1576
1532
  });
1577
1533
  }
@@ -1584,12 +1540,11 @@ export const de_ListResourceSharePermissionsCommand = async (output, context) =>
1584
1540
  $metadata: deserializeMetadata(output),
1585
1541
  });
1586
1542
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1587
- if (data.nextToken != null) {
1588
- contents.nextToken = __expectString(data.nextToken);
1589
- }
1590
- if (data.permissions != null) {
1591
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1592
- }
1543
+ const doc = take(data, {
1544
+ nextToken: __expectString,
1545
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1546
+ });
1547
+ Object.assign(contents, doc);
1593
1548
  return contents;
1594
1549
  };
1595
1550
  const de_ListResourceSharePermissionsCommandError = async (output, context) => {
@@ -1622,10 +1577,9 @@ const de_ListResourceSharePermissionsCommandError = async (output, context) => {
1622
1577
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1623
1578
  default:
1624
1579
  const parsedBody = parsedOutput.body;
1625
- throwDefaultError({
1580
+ return throwDefaultError({
1626
1581
  output,
1627
1582
  parsedBody,
1628
- exceptionCtor: __BaseException,
1629
1583
  errorCode,
1630
1584
  });
1631
1585
  }
@@ -1638,12 +1592,11 @@ export const de_ListResourceTypesCommand = async (output, context) => {
1638
1592
  $metadata: deserializeMetadata(output),
1639
1593
  });
1640
1594
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1641
- if (data.nextToken != null) {
1642
- contents.nextToken = __expectString(data.nextToken);
1643
- }
1644
- if (data.resourceTypes != null) {
1645
- contents.resourceTypes = de_ServiceNameAndResourceTypeList(data.resourceTypes, context);
1646
- }
1595
+ const doc = take(data, {
1596
+ nextToken: __expectString,
1597
+ resourceTypes: _json,
1598
+ });
1599
+ Object.assign(contents, doc);
1647
1600
  return contents;
1648
1601
  };
1649
1602
  const de_ListResourceTypesCommandError = async (output, context) => {
@@ -1667,10 +1620,9 @@ const de_ListResourceTypesCommandError = async (output, context) => {
1667
1620
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1668
1621
  default:
1669
1622
  const parsedBody = parsedOutput.body;
1670
- throwDefaultError({
1623
+ return throwDefaultError({
1671
1624
  output,
1672
1625
  parsedBody,
1673
- exceptionCtor: __BaseException,
1674
1626
  errorCode,
1675
1627
  });
1676
1628
  }
@@ -1683,9 +1635,10 @@ export const de_PromoteResourceShareCreatedFromPolicyCommand = async (output, co
1683
1635
  $metadata: deserializeMetadata(output),
1684
1636
  });
1685
1637
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1686
- if (data.returnValue != null) {
1687
- contents.returnValue = __expectBoolean(data.returnValue);
1688
- }
1638
+ const doc = take(data, {
1639
+ returnValue: __expectBoolean,
1640
+ });
1641
+ Object.assign(contents, doc);
1689
1642
  return contents;
1690
1643
  };
1691
1644
  const de_PromoteResourceShareCreatedFromPolicyCommandError = async (output, context) => {
@@ -1721,10 +1674,9 @@ const de_PromoteResourceShareCreatedFromPolicyCommandError = async (output, cont
1721
1674
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1722
1675
  default:
1723
1676
  const parsedBody = parsedOutput.body;
1724
- throwDefaultError({
1677
+ return throwDefaultError({
1725
1678
  output,
1726
1679
  parsedBody,
1727
- exceptionCtor: __BaseException,
1728
1680
  errorCode,
1729
1681
  });
1730
1682
  }
@@ -1737,12 +1689,11 @@ export const de_RejectResourceShareInvitationCommand = async (output, context) =
1737
1689
  $metadata: deserializeMetadata(output),
1738
1690
  });
1739
1691
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1740
- if (data.clientToken != null) {
1741
- contents.clientToken = __expectString(data.clientToken);
1742
- }
1743
- if (data.resourceShareInvitation != null) {
1744
- contents.resourceShareInvitation = de_ResourceShareInvitation(data.resourceShareInvitation, context);
1745
- }
1692
+ const doc = take(data, {
1693
+ clientToken: __expectString,
1694
+ resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context),
1695
+ });
1696
+ Object.assign(contents, doc);
1746
1697
  return contents;
1747
1698
  };
1748
1699
  const de_RejectResourceShareInvitationCommandError = async (output, context) => {
@@ -1784,10 +1735,9 @@ const de_RejectResourceShareInvitationCommandError = async (output, context) =>
1784
1735
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1785
1736
  default:
1786
1737
  const parsedBody = parsedOutput.body;
1787
- throwDefaultError({
1738
+ return throwDefaultError({
1788
1739
  output,
1789
1740
  parsedBody,
1790
- exceptionCtor: __BaseException,
1791
1741
  errorCode,
1792
1742
  });
1793
1743
  }
@@ -1835,10 +1785,9 @@ const de_TagResourceCommandError = async (output, context) => {
1835
1785
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1836
1786
  default:
1837
1787
  const parsedBody = parsedOutput.body;
1838
- throwDefaultError({
1788
+ return throwDefaultError({
1839
1789
  output,
1840
1790
  parsedBody,
1841
- exceptionCtor: __BaseException,
1842
1791
  errorCode,
1843
1792
  });
1844
1793
  }
@@ -1871,10 +1820,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1871
1820
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1872
1821
  default:
1873
1822
  const parsedBody = parsedOutput.body;
1874
- throwDefaultError({
1823
+ return throwDefaultError({
1875
1824
  output,
1876
1825
  parsedBody,
1877
- exceptionCtor: __BaseException,
1878
1826
  errorCode,
1879
1827
  });
1880
1828
  }
@@ -1887,12 +1835,11 @@ export const de_UpdateResourceShareCommand = async (output, context) => {
1887
1835
  $metadata: deserializeMetadata(output),
1888
1836
  });
1889
1837
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1890
- if (data.clientToken != null) {
1891
- contents.clientToken = __expectString(data.clientToken);
1892
- }
1893
- if (data.resourceShare != null) {
1894
- contents.resourceShare = de_ResourceShare(data.resourceShare, context);
1895
- }
1838
+ const doc = take(data, {
1839
+ clientToken: __expectString,
1840
+ resourceShare: (_) => de_ResourceShare(_, context),
1841
+ });
1842
+ Object.assign(contents, doc);
1896
1843
  return contents;
1897
1844
  };
1898
1845
  const de_UpdateResourceShareCommandError = async (output, context) => {
@@ -1931,21 +1878,21 @@ const de_UpdateResourceShareCommandError = async (output, context) => {
1931
1878
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1932
1879
  default:
1933
1880
  const parsedBody = parsedOutput.body;
1934
- throwDefaultError({
1881
+ return throwDefaultError({
1935
1882
  output,
1936
1883
  parsedBody,
1937
- exceptionCtor: __BaseException,
1938
1884
  errorCode,
1939
1885
  });
1940
1886
  }
1941
1887
  };
1942
- const map = __map;
1888
+ const throwDefaultError = withBaseException(__BaseException);
1943
1889
  const de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context) => {
1944
1890
  const contents = map({});
1945
1891
  const data = parsedOutput.body;
1946
- if (data.message != null) {
1947
- contents.message = __expectString(data.message);
1948
- }
1892
+ const doc = take(data, {
1893
+ message: __expectString,
1894
+ });
1895
+ Object.assign(contents, doc);
1949
1896
  const exception = new IdempotentParameterMismatchException({
1950
1897
  $metadata: deserializeMetadata(parsedOutput),
1951
1898
  ...contents,
@@ -1955,9 +1902,10 @@ const de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context)
1955
1902
  const de_InvalidClientTokenExceptionRes = async (parsedOutput, context) => {
1956
1903
  const contents = map({});
1957
1904
  const data = parsedOutput.body;
1958
- if (data.message != null) {
1959
- contents.message = __expectString(data.message);
1960
- }
1905
+ const doc = take(data, {
1906
+ message: __expectString,
1907
+ });
1908
+ Object.assign(contents, doc);
1961
1909
  const exception = new InvalidClientTokenException({
1962
1910
  $metadata: deserializeMetadata(parsedOutput),
1963
1911
  ...contents,
@@ -1967,9 +1915,10 @@ const de_InvalidClientTokenExceptionRes = async (parsedOutput, context) => {
1967
1915
  const de_InvalidMaxResultsExceptionRes = async (parsedOutput, context) => {
1968
1916
  const contents = map({});
1969
1917
  const data = parsedOutput.body;
1970
- if (data.message != null) {
1971
- contents.message = __expectString(data.message);
1972
- }
1918
+ const doc = take(data, {
1919
+ message: __expectString,
1920
+ });
1921
+ Object.assign(contents, doc);
1973
1922
  const exception = new InvalidMaxResultsException({
1974
1923
  $metadata: deserializeMetadata(parsedOutput),
1975
1924
  ...contents,
@@ -1979,9 +1928,10 @@ const de_InvalidMaxResultsExceptionRes = async (parsedOutput, context) => {
1979
1928
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
1980
1929
  const contents = map({});
1981
1930
  const data = parsedOutput.body;
1982
- if (data.message != null) {
1983
- contents.message = __expectString(data.message);
1984
- }
1931
+ const doc = take(data, {
1932
+ message: __expectString,
1933
+ });
1934
+ Object.assign(contents, doc);
1985
1935
  const exception = new InvalidNextTokenException({
1986
1936
  $metadata: deserializeMetadata(parsedOutput),
1987
1937
  ...contents,
@@ -1991,9 +1941,10 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
1991
1941
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
1992
1942
  const contents = map({});
1993
1943
  const data = parsedOutput.body;
1994
- if (data.message != null) {
1995
- contents.message = __expectString(data.message);
1996
- }
1944
+ const doc = take(data, {
1945
+ message: __expectString,
1946
+ });
1947
+ Object.assign(contents, doc);
1997
1948
  const exception = new InvalidParameterException({
1998
1949
  $metadata: deserializeMetadata(parsedOutput),
1999
1950
  ...contents,
@@ -2003,9 +1954,10 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
2003
1954
  const de_InvalidResourceTypeExceptionRes = async (parsedOutput, context) => {
2004
1955
  const contents = map({});
2005
1956
  const data = parsedOutput.body;
2006
- if (data.message != null) {
2007
- contents.message = __expectString(data.message);
2008
- }
1957
+ const doc = take(data, {
1958
+ message: __expectString,
1959
+ });
1960
+ Object.assign(contents, doc);
2009
1961
  const exception = new InvalidResourceTypeException({
2010
1962
  $metadata: deserializeMetadata(parsedOutput),
2011
1963
  ...contents,
@@ -2015,9 +1967,10 @@ const de_InvalidResourceTypeExceptionRes = async (parsedOutput, context) => {
2015
1967
  const de_InvalidStateTransitionExceptionRes = async (parsedOutput, context) => {
2016
1968
  const contents = map({});
2017
1969
  const data = parsedOutput.body;
2018
- if (data.message != null) {
2019
- contents.message = __expectString(data.message);
2020
- }
1970
+ const doc = take(data, {
1971
+ message: __expectString,
1972
+ });
1973
+ Object.assign(contents, doc);
2021
1974
  const exception = new InvalidStateTransitionException({
2022
1975
  $metadata: deserializeMetadata(parsedOutput),
2023
1976
  ...contents,
@@ -2027,9 +1980,10 @@ const de_InvalidStateTransitionExceptionRes = async (parsedOutput, context) => {
2027
1980
  const de_MalformedArnExceptionRes = async (parsedOutput, context) => {
2028
1981
  const contents = map({});
2029
1982
  const data = parsedOutput.body;
2030
- if (data.message != null) {
2031
- contents.message = __expectString(data.message);
2032
- }
1983
+ const doc = take(data, {
1984
+ message: __expectString,
1985
+ });
1986
+ Object.assign(contents, doc);
2033
1987
  const exception = new MalformedArnException({
2034
1988
  $metadata: deserializeMetadata(parsedOutput),
2035
1989
  ...contents,
@@ -2039,9 +1993,10 @@ const de_MalformedArnExceptionRes = async (parsedOutput, context) => {
2039
1993
  const de_MissingRequiredParameterExceptionRes = async (parsedOutput, context) => {
2040
1994
  const contents = map({});
2041
1995
  const data = parsedOutput.body;
2042
- if (data.message != null) {
2043
- contents.message = __expectString(data.message);
2044
- }
1996
+ const doc = take(data, {
1997
+ message: __expectString,
1998
+ });
1999
+ Object.assign(contents, doc);
2045
2000
  const exception = new MissingRequiredParameterException({
2046
2001
  $metadata: deserializeMetadata(parsedOutput),
2047
2002
  ...contents,
@@ -2051,9 +2006,10 @@ const de_MissingRequiredParameterExceptionRes = async (parsedOutput, context) =>
2051
2006
  const de_OperationNotPermittedExceptionRes = async (parsedOutput, context) => {
2052
2007
  const contents = map({});
2053
2008
  const data = parsedOutput.body;
2054
- if (data.message != null) {
2055
- contents.message = __expectString(data.message);
2056
- }
2009
+ const doc = take(data, {
2010
+ message: __expectString,
2011
+ });
2012
+ Object.assign(contents, doc);
2057
2013
  const exception = new OperationNotPermittedException({
2058
2014
  $metadata: deserializeMetadata(parsedOutput),
2059
2015
  ...contents,
@@ -2063,9 +2019,10 @@ const de_OperationNotPermittedExceptionRes = async (parsedOutput, context) => {
2063
2019
  const de_ResourceArnNotFoundExceptionRes = async (parsedOutput, context) => {
2064
2020
  const contents = map({});
2065
2021
  const data = parsedOutput.body;
2066
- if (data.message != null) {
2067
- contents.message = __expectString(data.message);
2068
- }
2022
+ const doc = take(data, {
2023
+ message: __expectString,
2024
+ });
2025
+ Object.assign(contents, doc);
2069
2026
  const exception = new ResourceArnNotFoundException({
2070
2027
  $metadata: deserializeMetadata(parsedOutput),
2071
2028
  ...contents,
@@ -2075,9 +2032,10 @@ const de_ResourceArnNotFoundExceptionRes = async (parsedOutput, context) => {
2075
2032
  const de_ResourceShareInvitationAlreadyAcceptedExceptionRes = async (parsedOutput, context) => {
2076
2033
  const contents = map({});
2077
2034
  const data = parsedOutput.body;
2078
- if (data.message != null) {
2079
- contents.message = __expectString(data.message);
2080
- }
2035
+ const doc = take(data, {
2036
+ message: __expectString,
2037
+ });
2038
+ Object.assign(contents, doc);
2081
2039
  const exception = new ResourceShareInvitationAlreadyAcceptedException({
2082
2040
  $metadata: deserializeMetadata(parsedOutput),
2083
2041
  ...contents,
@@ -2087,9 +2045,10 @@ const de_ResourceShareInvitationAlreadyAcceptedExceptionRes = async (parsedOutpu
2087
2045
  const de_ResourceShareInvitationAlreadyRejectedExceptionRes = async (parsedOutput, context) => {
2088
2046
  const contents = map({});
2089
2047
  const data = parsedOutput.body;
2090
- if (data.message != null) {
2091
- contents.message = __expectString(data.message);
2092
- }
2048
+ const doc = take(data, {
2049
+ message: __expectString,
2050
+ });
2051
+ Object.assign(contents, doc);
2093
2052
  const exception = new ResourceShareInvitationAlreadyRejectedException({
2094
2053
  $metadata: deserializeMetadata(parsedOutput),
2095
2054
  ...contents,
@@ -2099,9 +2058,10 @@ const de_ResourceShareInvitationAlreadyRejectedExceptionRes = async (parsedOutpu
2099
2058
  const de_ResourceShareInvitationArnNotFoundExceptionRes = async (parsedOutput, context) => {
2100
2059
  const contents = map({});
2101
2060
  const data = parsedOutput.body;
2102
- if (data.message != null) {
2103
- contents.message = __expectString(data.message);
2104
- }
2061
+ const doc = take(data, {
2062
+ message: __expectString,
2063
+ });
2064
+ Object.assign(contents, doc);
2105
2065
  const exception = new ResourceShareInvitationArnNotFoundException({
2106
2066
  $metadata: deserializeMetadata(parsedOutput),
2107
2067
  ...contents,
@@ -2111,9 +2071,10 @@ const de_ResourceShareInvitationArnNotFoundExceptionRes = async (parsedOutput, c
2111
2071
  const de_ResourceShareInvitationExpiredExceptionRes = async (parsedOutput, context) => {
2112
2072
  const contents = map({});
2113
2073
  const data = parsedOutput.body;
2114
- if (data.message != null) {
2115
- contents.message = __expectString(data.message);
2116
- }
2074
+ const doc = take(data, {
2075
+ message: __expectString,
2076
+ });
2077
+ Object.assign(contents, doc);
2117
2078
  const exception = new ResourceShareInvitationExpiredException({
2118
2079
  $metadata: deserializeMetadata(parsedOutput),
2119
2080
  ...contents,
@@ -2123,9 +2084,10 @@ const de_ResourceShareInvitationExpiredExceptionRes = async (parsedOutput, conte
2123
2084
  const de_ResourceShareLimitExceededExceptionRes = async (parsedOutput, context) => {
2124
2085
  const contents = map({});
2125
2086
  const data = parsedOutput.body;
2126
- if (data.message != null) {
2127
- contents.message = __expectString(data.message);
2128
- }
2087
+ const doc = take(data, {
2088
+ message: __expectString,
2089
+ });
2090
+ Object.assign(contents, doc);
2129
2091
  const exception = new ResourceShareLimitExceededException({
2130
2092
  $metadata: deserializeMetadata(parsedOutput),
2131
2093
  ...contents,
@@ -2135,9 +2097,10 @@ const de_ResourceShareLimitExceededExceptionRes = async (parsedOutput, context)
2135
2097
  const de_ServerInternalExceptionRes = async (parsedOutput, context) => {
2136
2098
  const contents = map({});
2137
2099
  const data = parsedOutput.body;
2138
- if (data.message != null) {
2139
- contents.message = __expectString(data.message);
2140
- }
2100
+ const doc = take(data, {
2101
+ message: __expectString,
2102
+ });
2103
+ Object.assign(contents, doc);
2141
2104
  const exception = new ServerInternalException({
2142
2105
  $metadata: deserializeMetadata(parsedOutput),
2143
2106
  ...contents,
@@ -2147,9 +2110,10 @@ const de_ServerInternalExceptionRes = async (parsedOutput, context) => {
2147
2110
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
2148
2111
  const contents = map({});
2149
2112
  const data = parsedOutput.body;
2150
- if (data.message != null) {
2151
- contents.message = __expectString(data.message);
2152
- }
2113
+ const doc = take(data, {
2114
+ message: __expectString,
2115
+ });
2116
+ Object.assign(contents, doc);
2153
2117
  const exception = new ServiceUnavailableException({
2154
2118
  $metadata: deserializeMetadata(parsedOutput),
2155
2119
  ...contents,
@@ -2159,9 +2123,10 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
2159
2123
  const de_TagLimitExceededExceptionRes = async (parsedOutput, context) => {
2160
2124
  const contents = map({});
2161
2125
  const data = parsedOutput.body;
2162
- if (data.message != null) {
2163
- contents.message = __expectString(data.message);
2164
- }
2126
+ const doc = take(data, {
2127
+ message: __expectString,
2128
+ });
2129
+ Object.assign(contents, doc);
2165
2130
  const exception = new TagLimitExceededException({
2166
2131
  $metadata: deserializeMetadata(parsedOutput),
2167
2132
  ...contents,
@@ -2171,9 +2136,10 @@ const de_TagLimitExceededExceptionRes = async (parsedOutput, context) => {
2171
2136
  const de_TagPolicyViolationExceptionRes = async (parsedOutput, context) => {
2172
2137
  const contents = map({});
2173
2138
  const data = parsedOutput.body;
2174
- if (data.message != null) {
2175
- contents.message = __expectString(data.message);
2176
- }
2139
+ const doc = take(data, {
2140
+ message: __expectString,
2141
+ });
2142
+ Object.assign(contents, doc);
2177
2143
  const exception = new TagPolicyViolationException({
2178
2144
  $metadata: deserializeMetadata(parsedOutput),
2179
2145
  ...contents,
@@ -2183,9 +2149,10 @@ const de_TagPolicyViolationExceptionRes = async (parsedOutput, context) => {
2183
2149
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2184
2150
  const contents = map({});
2185
2151
  const data = parsedOutput.body;
2186
- if (data.message != null) {
2187
- contents.message = __expectString(data.message);
2188
- }
2152
+ const doc = take(data, {
2153
+ message: __expectString,
2154
+ });
2155
+ Object.assign(contents, doc);
2189
2156
  const exception = new ThrottlingException({
2190
2157
  $metadata: deserializeMetadata(parsedOutput),
2191
2158
  ...contents,
@@ -2195,223 +2162,106 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2195
2162
  const de_UnknownResourceExceptionRes = async (parsedOutput, context) => {
2196
2163
  const contents = map({});
2197
2164
  const data = parsedOutput.body;
2198
- if (data.message != null) {
2199
- contents.message = __expectString(data.message);
2200
- }
2165
+ const doc = take(data, {
2166
+ message: __expectString,
2167
+ });
2168
+ Object.assign(contents, doc);
2201
2169
  const exception = new UnknownResourceException({
2202
2170
  $metadata: deserializeMetadata(parsedOutput),
2203
2171
  ...contents,
2204
2172
  });
2205
2173
  return __decorateServiceException(exception, parsedOutput.body);
2206
2174
  };
2207
- const se_PermissionArnList = (input, context) => {
2208
- return input
2209
- .filter((e) => e != null)
2210
- .map((entry) => {
2211
- return entry;
2212
- });
2213
- };
2214
- const se_PrincipalArnOrIdList = (input, context) => {
2215
- return input
2216
- .filter((e) => e != null)
2217
- .map((entry) => {
2218
- return entry;
2219
- });
2220
- };
2221
- const se_ResourceArnList = (input, context) => {
2222
- return input
2223
- .filter((e) => e != null)
2224
- .map((entry) => {
2225
- return entry;
2226
- });
2227
- };
2228
- const se_ResourceShareArnList = (input, context) => {
2229
- return input
2230
- .filter((e) => e != null)
2231
- .map((entry) => {
2232
- return entry;
2233
- });
2234
- };
2235
- const se_ResourceShareInvitationArnList = (input, context) => {
2236
- return input
2237
- .filter((e) => e != null)
2238
- .map((entry) => {
2239
- return entry;
2240
- });
2241
- };
2242
- const se_Tag = (input, context) => {
2243
- return {
2244
- ...(input.key != null && { key: input.key }),
2245
- ...(input.value != null && { value: input.value }),
2246
- };
2247
- };
2248
- const se_TagFilter = (input, context) => {
2249
- return {
2250
- ...(input.tagKey != null && { tagKey: input.tagKey }),
2251
- ...(input.tagValues != null && { tagValues: se_TagValueList(input.tagValues, context) }),
2252
- };
2253
- };
2254
- const se_TagFilters = (input, context) => {
2255
- return input
2256
- .filter((e) => e != null)
2257
- .map((entry) => {
2258
- return se_TagFilter(entry, context);
2259
- });
2260
- };
2261
- const se_TagKeyList = (input, context) => {
2262
- return input
2263
- .filter((e) => e != null)
2264
- .map((entry) => {
2265
- return entry;
2266
- });
2267
- };
2268
- const se_TagList = (input, context) => {
2269
- return input
2270
- .filter((e) => e != null)
2271
- .map((entry) => {
2272
- return se_Tag(entry, context);
2273
- });
2274
- };
2275
- const se_TagValueList = (input, context) => {
2276
- return input
2277
- .filter((e) => e != null)
2278
- .map((entry) => {
2279
- return entry;
2280
- });
2281
- };
2282
- const de_PolicyList = (output, context) => {
2283
- const retVal = (output || [])
2284
- .filter((e) => e != null)
2285
- .map((entry) => {
2286
- if (entry === null) {
2287
- return null;
2288
- }
2289
- return __expectString(entry);
2290
- });
2291
- return retVal;
2292
- };
2293
2175
  const de_Principal = (output, context) => {
2294
- return {
2295
- creationTime: output.creationTime != null
2296
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2297
- : undefined,
2298
- external: __expectBoolean(output.external),
2299
- id: __expectString(output.id),
2300
- lastUpdatedTime: output.lastUpdatedTime != null
2301
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2302
- : undefined,
2303
- resourceShareArn: __expectString(output.resourceShareArn),
2304
- };
2176
+ return take(output, {
2177
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2178
+ external: __expectBoolean,
2179
+ id: __expectString,
2180
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2181
+ resourceShareArn: __expectString,
2182
+ });
2305
2183
  };
2306
2184
  const de_PrincipalList = (output, context) => {
2307
2185
  const retVal = (output || [])
2308
2186
  .filter((e) => e != null)
2309
2187
  .map((entry) => {
2310
- if (entry === null) {
2311
- return null;
2312
- }
2313
2188
  return de_Principal(entry, context);
2314
2189
  });
2315
2190
  return retVal;
2316
2191
  };
2317
2192
  const de_Resource = (output, context) => {
2318
- return {
2319
- arn: __expectString(output.arn),
2320
- creationTime: output.creationTime != null
2321
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2322
- : undefined,
2323
- lastUpdatedTime: output.lastUpdatedTime != null
2324
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2325
- : undefined,
2326
- resourceGroupArn: __expectString(output.resourceGroupArn),
2327
- resourceRegionScope: __expectString(output.resourceRegionScope),
2328
- resourceShareArn: __expectString(output.resourceShareArn),
2329
- status: __expectString(output.status),
2330
- statusMessage: __expectString(output.statusMessage),
2331
- type: __expectString(output.type),
2332
- };
2193
+ return take(output, {
2194
+ arn: __expectString,
2195
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2196
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2197
+ resourceGroupArn: __expectString,
2198
+ resourceRegionScope: __expectString,
2199
+ resourceShareArn: __expectString,
2200
+ status: __expectString,
2201
+ statusMessage: __expectString,
2202
+ type: __expectString,
2203
+ });
2333
2204
  };
2334
2205
  const de_ResourceList = (output, context) => {
2335
2206
  const retVal = (output || [])
2336
2207
  .filter((e) => e != null)
2337
2208
  .map((entry) => {
2338
- if (entry === null) {
2339
- return null;
2340
- }
2341
2209
  return de_Resource(entry, context);
2342
2210
  });
2343
2211
  return retVal;
2344
2212
  };
2345
2213
  const de_ResourceShare = (output, context) => {
2346
- return {
2347
- allowExternalPrincipals: __expectBoolean(output.allowExternalPrincipals),
2348
- creationTime: output.creationTime != null
2349
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2350
- : undefined,
2351
- featureSet: __expectString(output.featureSet),
2352
- lastUpdatedTime: output.lastUpdatedTime != null
2353
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2354
- : undefined,
2355
- name: __expectString(output.name),
2356
- owningAccountId: __expectString(output.owningAccountId),
2357
- resourceShareArn: __expectString(output.resourceShareArn),
2358
- status: __expectString(output.status),
2359
- statusMessage: __expectString(output.statusMessage),
2360
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
2361
- };
2214
+ return take(output, {
2215
+ allowExternalPrincipals: __expectBoolean,
2216
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2217
+ featureSet: __expectString,
2218
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2219
+ name: __expectString,
2220
+ owningAccountId: __expectString,
2221
+ resourceShareArn: __expectString,
2222
+ status: __expectString,
2223
+ statusMessage: __expectString,
2224
+ tags: _json,
2225
+ });
2362
2226
  };
2363
2227
  const de_ResourceShareAssociation = (output, context) => {
2364
- return {
2365
- associatedEntity: __expectString(output.associatedEntity),
2366
- associationType: __expectString(output.associationType),
2367
- creationTime: output.creationTime != null
2368
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2369
- : undefined,
2370
- external: __expectBoolean(output.external),
2371
- lastUpdatedTime: output.lastUpdatedTime != null
2372
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2373
- : undefined,
2374
- resourceShareArn: __expectString(output.resourceShareArn),
2375
- resourceShareName: __expectString(output.resourceShareName),
2376
- status: __expectString(output.status),
2377
- statusMessage: __expectString(output.statusMessage),
2378
- };
2228
+ return take(output, {
2229
+ associatedEntity: __expectString,
2230
+ associationType: __expectString,
2231
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2232
+ external: __expectBoolean,
2233
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2234
+ resourceShareArn: __expectString,
2235
+ resourceShareName: __expectString,
2236
+ status: __expectString,
2237
+ statusMessage: __expectString,
2238
+ });
2379
2239
  };
2380
2240
  const de_ResourceShareAssociationList = (output, context) => {
2381
2241
  const retVal = (output || [])
2382
2242
  .filter((e) => e != null)
2383
2243
  .map((entry) => {
2384
- if (entry === null) {
2385
- return null;
2386
- }
2387
2244
  return de_ResourceShareAssociation(entry, context);
2388
2245
  });
2389
2246
  return retVal;
2390
2247
  };
2391
2248
  const de_ResourceShareInvitation = (output, context) => {
2392
- return {
2393
- invitationTimestamp: output.invitationTimestamp != null
2394
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.invitationTimestamp)))
2395
- : undefined,
2396
- receiverAccountId: __expectString(output.receiverAccountId),
2397
- receiverArn: __expectString(output.receiverArn),
2398
- resourceShareArn: __expectString(output.resourceShareArn),
2399
- resourceShareAssociations: output.resourceShareAssociations != null
2400
- ? de_ResourceShareAssociationList(output.resourceShareAssociations, context)
2401
- : undefined,
2402
- resourceShareInvitationArn: __expectString(output.resourceShareInvitationArn),
2403
- resourceShareName: __expectString(output.resourceShareName),
2404
- senderAccountId: __expectString(output.senderAccountId),
2405
- status: __expectString(output.status),
2406
- };
2249
+ return take(output, {
2250
+ invitationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2251
+ receiverAccountId: __expectString,
2252
+ receiverArn: __expectString,
2253
+ resourceShareArn: __expectString,
2254
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
2255
+ resourceShareInvitationArn: __expectString,
2256
+ resourceShareName: __expectString,
2257
+ senderAccountId: __expectString,
2258
+ status: __expectString,
2259
+ });
2407
2260
  };
2408
2261
  const de_ResourceShareInvitationList = (output, context) => {
2409
2262
  const retVal = (output || [])
2410
2263
  .filter((e) => e != null)
2411
2264
  .map((entry) => {
2412
- if (entry === null) {
2413
- return null;
2414
- }
2415
2265
  return de_ResourceShareInvitation(entry, context);
2416
2266
  });
2417
2267
  return retVal;
@@ -2420,92 +2270,43 @@ const de_ResourceShareList = (output, context) => {
2420
2270
  const retVal = (output || [])
2421
2271
  .filter((e) => e != null)
2422
2272
  .map((entry) => {
2423
- if (entry === null) {
2424
- return null;
2425
- }
2426
2273
  return de_ResourceShare(entry, context);
2427
2274
  });
2428
2275
  return retVal;
2429
2276
  };
2430
2277
  const de_ResourceSharePermissionDetail = (output, context) => {
2431
- return {
2432
- arn: __expectString(output.arn),
2433
- creationTime: output.creationTime != null
2434
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2435
- : undefined,
2436
- defaultVersion: __expectBoolean(output.defaultVersion),
2437
- isResourceTypeDefault: __expectBoolean(output.isResourceTypeDefault),
2438
- lastUpdatedTime: output.lastUpdatedTime != null
2439
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2440
- : undefined,
2441
- name: __expectString(output.name),
2442
- permission: __expectString(output.permission),
2443
- resourceType: __expectString(output.resourceType),
2444
- version: __expectString(output.version),
2445
- };
2278
+ return take(output, {
2279
+ arn: __expectString,
2280
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2281
+ defaultVersion: __expectBoolean,
2282
+ isResourceTypeDefault: __expectBoolean,
2283
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2284
+ name: __expectString,
2285
+ permission: __expectString,
2286
+ resourceType: __expectString,
2287
+ version: __expectString,
2288
+ });
2446
2289
  };
2447
2290
  const de_ResourceSharePermissionList = (output, context) => {
2448
2291
  const retVal = (output || [])
2449
2292
  .filter((e) => e != null)
2450
2293
  .map((entry) => {
2451
- if (entry === null) {
2452
- return null;
2453
- }
2454
2294
  return de_ResourceSharePermissionSummary(entry, context);
2455
2295
  });
2456
2296
  return retVal;
2457
2297
  };
2458
2298
  const de_ResourceSharePermissionSummary = (output, context) => {
2459
- return {
2460
- arn: __expectString(output.arn),
2461
- creationTime: output.creationTime != null
2462
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
2463
- : undefined,
2464
- defaultVersion: __expectBoolean(output.defaultVersion),
2465
- isResourceTypeDefault: __expectBoolean(output.isResourceTypeDefault),
2466
- lastUpdatedTime: output.lastUpdatedTime != null
2467
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedTime)))
2468
- : undefined,
2469
- name: __expectString(output.name),
2470
- resourceType: __expectString(output.resourceType),
2471
- status: __expectString(output.status),
2472
- version: __expectString(output.version),
2473
- };
2474
- };
2475
- const de_ServiceNameAndResourceType = (output, context) => {
2476
- return {
2477
- resourceRegionScope: __expectString(output.resourceRegionScope),
2478
- resourceType: __expectString(output.resourceType),
2479
- serviceName: __expectString(output.serviceName),
2480
- };
2481
- };
2482
- const de_ServiceNameAndResourceTypeList = (output, context) => {
2483
- const retVal = (output || [])
2484
- .filter((e) => e != null)
2485
- .map((entry) => {
2486
- if (entry === null) {
2487
- return null;
2488
- }
2489
- return de_ServiceNameAndResourceType(entry, context);
2299
+ return take(output, {
2300
+ arn: __expectString,
2301
+ creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2302
+ defaultVersion: __expectBoolean,
2303
+ isResourceTypeDefault: __expectBoolean,
2304
+ lastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2305
+ name: __expectString,
2306
+ resourceType: __expectString,
2307
+ status: __expectString,
2308
+ version: __expectString,
2490
2309
  });
2491
- return retVal;
2492
- };
2493
- const de_Tag = (output, context) => {
2494
- return {
2495
- key: __expectString(output.key),
2496
- value: __expectString(output.value),
2497
- };
2498
- };
2499
- const de_TagList = (output, context) => {
2500
- const retVal = (output || [])
2501
- .filter((e) => e != null)
2502
- .map((entry) => {
2503
- if (entry === null) {
2504
- return null;
2505
- }
2506
- return de_Tag(entry, context);
2507
- });
2508
- return retVal;
2509
2310
  };
2510
2311
  const deserializeMetadata = (output) => ({
2511
2312
  httpStatusCode: output.statusCode,