@aws-sdk/client-ram 3.310.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.
@@ -12,10 +12,10 @@ const se_AcceptResourceShareInvitationCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/acceptresourceshareinvitation";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.clientToken != null && { clientToken: input.clientToken }),
17
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
18
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ clientToken: [],
17
+ resourceShareInvitationArn: [],
18
+ }));
19
19
  return new protocol_http_1.HttpRequest({
20
20
  protocol,
21
21
  hostname,
@@ -34,12 +34,12 @@ const se_AssociateResourceShareCommand = async (input, context) => {
34
34
  };
35
35
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associateresourceshare";
36
36
  let body;
37
- body = JSON.stringify({
38
- ...(input.clientToken != null && { clientToken: input.clientToken }),
39
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
40
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
41
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
42
- });
37
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
38
+ clientToken: [],
39
+ principals: (_) => (0, smithy_client_1._json)(_),
40
+ resourceArns: (_) => (0, smithy_client_1._json)(_),
41
+ resourceShareArn: [],
42
+ }));
43
43
  return new protocol_http_1.HttpRequest({
44
44
  protocol,
45
45
  hostname,
@@ -58,13 +58,13 @@ const se_AssociateResourceSharePermissionCommand = async (input, context) => {
58
58
  };
59
59
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associateresourcesharepermission";
60
60
  let body;
61
- body = JSON.stringify({
62
- ...(input.clientToken != null && { clientToken: input.clientToken }),
63
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
64
- ...(input.permissionVersion != null && { permissionVersion: input.permissionVersion }),
65
- ...(input.replace != null && { replace: input.replace }),
66
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
67
- });
61
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
62
+ clientToken: [],
63
+ permissionArn: [],
64
+ permissionVersion: [],
65
+ replace: [],
66
+ resourceShareArn: [],
67
+ }));
68
68
  return new protocol_http_1.HttpRequest({
69
69
  protocol,
70
70
  hostname,
@@ -83,15 +83,15 @@ const se_CreateResourceShareCommand = async (input, context) => {
83
83
  };
84
84
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/createresourceshare";
85
85
  let body;
86
- body = JSON.stringify({
87
- ...(input.allowExternalPrincipals != null && { allowExternalPrincipals: input.allowExternalPrincipals }),
88
- ...(input.clientToken != null && { clientToken: input.clientToken }),
89
- ...(input.name != null && { name: input.name }),
90
- ...(input.permissionArns != null && { permissionArns: se_PermissionArnList(input.permissionArns, context) }),
91
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
92
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
93
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
94
- });
86
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
87
+ allowExternalPrincipals: [],
88
+ clientToken: [],
89
+ name: [],
90
+ permissionArns: (_) => (0, smithy_client_1._json)(_),
91
+ principals: (_) => (0, smithy_client_1._json)(_),
92
+ resourceArns: (_) => (0, smithy_client_1._json)(_),
93
+ tags: (_) => (0, smithy_client_1._json)(_),
94
+ }));
95
95
  return new protocol_http_1.HttpRequest({
96
96
  protocol,
97
97
  hostname,
@@ -107,7 +107,7 @@ const se_DeleteResourceShareCommand = async (input, context) => {
107
107
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
108
  const headers = {};
109
109
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteresourceshare";
110
- const query = map({
110
+ const query = (0, smithy_client_1.map)({
111
111
  resourceShareArn: [, (0, smithy_client_1.expectNonNull)(input.resourceShareArn, `resourceShareArn`)],
112
112
  clientToken: [, input.clientToken],
113
113
  });
@@ -131,12 +131,12 @@ const se_DisassociateResourceShareCommand = async (input, context) => {
131
131
  };
132
132
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociateresourceshare";
133
133
  let body;
134
- body = JSON.stringify({
135
- ...(input.clientToken != null && { clientToken: input.clientToken }),
136
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
137
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
138
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
139
- });
134
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
135
+ clientToken: [],
136
+ principals: (_) => (0, smithy_client_1._json)(_),
137
+ resourceArns: (_) => (0, smithy_client_1._json)(_),
138
+ resourceShareArn: [],
139
+ }));
140
140
  return new protocol_http_1.HttpRequest({
141
141
  protocol,
142
142
  hostname,
@@ -155,11 +155,11 @@ const se_DisassociateResourceSharePermissionCommand = async (input, context) =>
155
155
  };
156
156
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociateresourcesharepermission";
157
157
  let body;
158
- body = JSON.stringify({
159
- ...(input.clientToken != null && { clientToken: input.clientToken }),
160
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
161
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
162
- });
158
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
159
+ clientToken: [],
160
+ permissionArn: [],
161
+ resourceShareArn: [],
162
+ }));
163
163
  return new protocol_http_1.HttpRequest({
164
164
  protocol,
165
165
  hostname,
@@ -197,10 +197,10 @@ const se_GetPermissionCommand = async (input, context) => {
197
197
  };
198
198
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getpermission";
199
199
  let body;
200
- body = JSON.stringify({
201
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
202
- ...(input.permissionVersion != null && { permissionVersion: input.permissionVersion }),
203
- });
200
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
201
+ permissionArn: [],
202
+ permissionVersion: [],
203
+ }));
204
204
  return new protocol_http_1.HttpRequest({
205
205
  protocol,
206
206
  hostname,
@@ -219,12 +219,12 @@ const se_GetResourcePoliciesCommand = async (input, context) => {
219
219
  };
220
220
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourcepolicies";
221
221
  let body;
222
- body = JSON.stringify({
223
- ...(input.maxResults != null && { maxResults: input.maxResults }),
224
- ...(input.nextToken != null && { nextToken: input.nextToken }),
225
- ...(input.principal != null && { principal: input.principal }),
226
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
227
- });
222
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
223
+ maxResults: [],
224
+ nextToken: [],
225
+ principal: [],
226
+ resourceArns: (_) => (0, smithy_client_1._json)(_),
227
+ }));
228
228
  return new protocol_http_1.HttpRequest({
229
229
  protocol,
230
230
  hostname,
@@ -243,17 +243,15 @@ const se_GetResourceShareAssociationsCommand = async (input, context) => {
243
243
  };
244
244
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshareassociations";
245
245
  let body;
246
- body = JSON.stringify({
247
- ...(input.associationStatus != null && { associationStatus: input.associationStatus }),
248
- ...(input.associationType != null && { associationType: input.associationType }),
249
- ...(input.maxResults != null && { maxResults: input.maxResults }),
250
- ...(input.nextToken != null && { nextToken: input.nextToken }),
251
- ...(input.principal != null && { principal: input.principal }),
252
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
253
- ...(input.resourceShareArns != null && {
254
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
255
- }),
256
- });
246
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
247
+ associationStatus: [],
248
+ associationType: [],
249
+ maxResults: [],
250
+ nextToken: [],
251
+ principal: [],
252
+ resourceArn: [],
253
+ resourceShareArns: (_) => (0, smithy_client_1._json)(_),
254
+ }));
257
255
  return new protocol_http_1.HttpRequest({
258
256
  protocol,
259
257
  hostname,
@@ -272,16 +270,12 @@ const se_GetResourceShareInvitationsCommand = async (input, context) => {
272
270
  };
273
271
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshareinvitations";
274
272
  let body;
275
- body = JSON.stringify({
276
- ...(input.maxResults != null && { maxResults: input.maxResults }),
277
- ...(input.nextToken != null && { nextToken: input.nextToken }),
278
- ...(input.resourceShareArns != null && {
279
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
280
- }),
281
- ...(input.resourceShareInvitationArns != null && {
282
- resourceShareInvitationArns: se_ResourceShareInvitationArnList(input.resourceShareInvitationArns, context),
283
- }),
284
- });
273
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
274
+ maxResults: [],
275
+ nextToken: [],
276
+ resourceShareArns: (_) => (0, smithy_client_1._json)(_),
277
+ resourceShareInvitationArns: (_) => (0, smithy_client_1._json)(_),
278
+ }));
285
279
  return new protocol_http_1.HttpRequest({
286
280
  protocol,
287
281
  hostname,
@@ -300,18 +294,16 @@ const se_GetResourceSharesCommand = async (input, context) => {
300
294
  };
301
295
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getresourceshares";
302
296
  let body;
303
- body = JSON.stringify({
304
- ...(input.maxResults != null && { maxResults: input.maxResults }),
305
- ...(input.name != null && { name: input.name }),
306
- ...(input.nextToken != null && { nextToken: input.nextToken }),
307
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
308
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
309
- ...(input.resourceShareArns != null && {
310
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
311
- }),
312
- ...(input.resourceShareStatus != null && { resourceShareStatus: input.resourceShareStatus }),
313
- ...(input.tagFilters != null && { tagFilters: se_TagFilters(input.tagFilters, context) }),
314
- });
297
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
298
+ maxResults: [],
299
+ name: [],
300
+ nextToken: [],
301
+ permissionArn: [],
302
+ resourceOwner: [],
303
+ resourceShareArns: (_) => (0, smithy_client_1._json)(_),
304
+ resourceShareStatus: [],
305
+ tagFilters: (_) => (0, smithy_client_1._json)(_),
306
+ }));
315
307
  return new protocol_http_1.HttpRequest({
316
308
  protocol,
317
309
  hostname,
@@ -330,12 +322,12 @@ const se_ListPendingInvitationResourcesCommand = async (input, context) => {
330
322
  };
331
323
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpendinginvitationresources";
332
324
  let body;
333
- body = JSON.stringify({
334
- ...(input.maxResults != null && { maxResults: input.maxResults }),
335
- ...(input.nextToken != null && { nextToken: input.nextToken }),
336
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
337
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
338
- });
325
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
326
+ maxResults: [],
327
+ nextToken: [],
328
+ resourceRegionScope: [],
329
+ resourceShareInvitationArn: [],
330
+ }));
339
331
  return new protocol_http_1.HttpRequest({
340
332
  protocol,
341
333
  hostname,
@@ -354,11 +346,11 @@ const se_ListPermissionsCommand = async (input, context) => {
354
346
  };
355
347
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpermissions";
356
348
  let body;
357
- body = JSON.stringify({
358
- ...(input.maxResults != null && { maxResults: input.maxResults }),
359
- ...(input.nextToken != null && { nextToken: input.nextToken }),
360
- ...(input.resourceType != null && { resourceType: input.resourceType }),
361
- });
349
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
350
+ maxResults: [],
351
+ nextToken: [],
352
+ resourceType: [],
353
+ }));
362
354
  return new protocol_http_1.HttpRequest({
363
355
  protocol,
364
356
  hostname,
@@ -377,11 +369,11 @@ const se_ListPermissionVersionsCommand = async (input, context) => {
377
369
  };
378
370
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listpermissionversions";
379
371
  let body;
380
- body = JSON.stringify({
381
- ...(input.maxResults != null && { maxResults: input.maxResults }),
382
- ...(input.nextToken != null && { nextToken: input.nextToken }),
383
- ...(input.permissionArn != null && { permissionArn: input.permissionArn }),
384
- });
372
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
373
+ maxResults: [],
374
+ nextToken: [],
375
+ permissionArn: [],
376
+ }));
385
377
  return new protocol_http_1.HttpRequest({
386
378
  protocol,
387
379
  hostname,
@@ -400,17 +392,15 @@ const se_ListPrincipalsCommand = async (input, context) => {
400
392
  };
401
393
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listprincipals";
402
394
  let body;
403
- body = JSON.stringify({
404
- ...(input.maxResults != null && { maxResults: input.maxResults }),
405
- ...(input.nextToken != null && { nextToken: input.nextToken }),
406
- ...(input.principals != null && { principals: se_PrincipalArnOrIdList(input.principals, context) }),
407
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
408
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
409
- ...(input.resourceShareArns != null && {
410
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
411
- }),
412
- ...(input.resourceType != null && { resourceType: input.resourceType }),
413
- });
395
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
396
+ maxResults: [],
397
+ nextToken: [],
398
+ principals: (_) => (0, smithy_client_1._json)(_),
399
+ resourceArn: [],
400
+ resourceOwner: [],
401
+ resourceShareArns: (_) => (0, smithy_client_1._json)(_),
402
+ resourceType: [],
403
+ }));
414
404
  return new protocol_http_1.HttpRequest({
415
405
  protocol,
416
406
  hostname,
@@ -429,18 +419,16 @@ const se_ListResourcesCommand = async (input, context) => {
429
419
  };
430
420
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresources";
431
421
  let body;
432
- body = JSON.stringify({
433
- ...(input.maxResults != null && { maxResults: input.maxResults }),
434
- ...(input.nextToken != null && { nextToken: input.nextToken }),
435
- ...(input.principal != null && { principal: input.principal }),
436
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
437
- ...(input.resourceOwner != null && { resourceOwner: input.resourceOwner }),
438
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
439
- ...(input.resourceShareArns != null && {
440
- resourceShareArns: se_ResourceShareArnList(input.resourceShareArns, context),
441
- }),
442
- ...(input.resourceType != null && { resourceType: input.resourceType }),
443
- });
422
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
423
+ maxResults: [],
424
+ nextToken: [],
425
+ principal: [],
426
+ resourceArns: (_) => (0, smithy_client_1._json)(_),
427
+ resourceOwner: [],
428
+ resourceRegionScope: [],
429
+ resourceShareArns: (_) => (0, smithy_client_1._json)(_),
430
+ resourceType: [],
431
+ }));
444
432
  return new protocol_http_1.HttpRequest({
445
433
  protocol,
446
434
  hostname,
@@ -459,11 +447,11 @@ const se_ListResourceSharePermissionsCommand = async (input, context) => {
459
447
  };
460
448
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresourcesharepermissions";
461
449
  let body;
462
- body = JSON.stringify({
463
- ...(input.maxResults != null && { maxResults: input.maxResults }),
464
- ...(input.nextToken != null && { nextToken: input.nextToken }),
465
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
466
- });
450
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
451
+ maxResults: [],
452
+ nextToken: [],
453
+ resourceShareArn: [],
454
+ }));
467
455
  return new protocol_http_1.HttpRequest({
468
456
  protocol,
469
457
  hostname,
@@ -482,11 +470,11 @@ const se_ListResourceTypesCommand = async (input, context) => {
482
470
  };
483
471
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listresourcetypes";
484
472
  let body;
485
- body = JSON.stringify({
486
- ...(input.maxResults != null && { maxResults: input.maxResults }),
487
- ...(input.nextToken != null && { nextToken: input.nextToken }),
488
- ...(input.resourceRegionScope != null && { resourceRegionScope: input.resourceRegionScope }),
489
- });
473
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
474
+ maxResults: [],
475
+ nextToken: [],
476
+ resourceRegionScope: [],
477
+ }));
490
478
  return new protocol_http_1.HttpRequest({
491
479
  protocol,
492
480
  hostname,
@@ -502,7 +490,7 @@ const se_PromoteResourceShareCreatedFromPolicyCommand = async (input, context) =
502
490
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
503
491
  const headers = {};
504
492
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/promoteresourcesharecreatedfrompolicy";
505
- const query = map({
493
+ const query = (0, smithy_client_1.map)({
506
494
  resourceShareArn: [, (0, smithy_client_1.expectNonNull)(input.resourceShareArn, `resourceShareArn`)],
507
495
  });
508
496
  let body;
@@ -525,10 +513,10 @@ const se_RejectResourceShareInvitationCommand = async (input, context) => {
525
513
  };
526
514
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rejectresourceshareinvitation";
527
515
  let body;
528
- body = JSON.stringify({
529
- ...(input.clientToken != null && { clientToken: input.clientToken }),
530
- ...(input.resourceShareInvitationArn != null && { resourceShareInvitationArn: input.resourceShareInvitationArn }),
531
- });
516
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
517
+ clientToken: [],
518
+ resourceShareInvitationArn: [],
519
+ }));
532
520
  return new protocol_http_1.HttpRequest({
533
521
  protocol,
534
522
  hostname,
@@ -547,10 +535,10 @@ const se_TagResourceCommand = async (input, context) => {
547
535
  };
548
536
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tagresource";
549
537
  let body;
550
- body = JSON.stringify({
551
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
552
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
553
- });
538
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
539
+ resourceShareArn: [],
540
+ tags: (_) => (0, smithy_client_1._json)(_),
541
+ }));
554
542
  return new protocol_http_1.HttpRequest({
555
543
  protocol,
556
544
  hostname,
@@ -569,10 +557,10 @@ const se_UntagResourceCommand = async (input, context) => {
569
557
  };
570
558
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/untagresource";
571
559
  let body;
572
- body = JSON.stringify({
573
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
574
- ...(input.tagKeys != null && { tagKeys: se_TagKeyList(input.tagKeys, context) }),
575
- });
560
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
561
+ resourceShareArn: [],
562
+ tagKeys: (_) => (0, smithy_client_1._json)(_),
563
+ }));
576
564
  return new protocol_http_1.HttpRequest({
577
565
  protocol,
578
566
  hostname,
@@ -591,12 +579,12 @@ const se_UpdateResourceShareCommand = async (input, context) => {
591
579
  };
592
580
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/updateresourceshare";
593
581
  let body;
594
- body = JSON.stringify({
595
- ...(input.allowExternalPrincipals != null && { allowExternalPrincipals: input.allowExternalPrincipals }),
596
- ...(input.clientToken != null && { clientToken: input.clientToken }),
597
- ...(input.name != null && { name: input.name }),
598
- ...(input.resourceShareArn != null && { resourceShareArn: input.resourceShareArn }),
599
- });
582
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
583
+ allowExternalPrincipals: [],
584
+ clientToken: [],
585
+ name: [],
586
+ resourceShareArn: [],
587
+ }));
600
588
  return new protocol_http_1.HttpRequest({
601
589
  protocol,
602
590
  hostname,
@@ -612,16 +600,15 @@ const de_AcceptResourceShareInvitationCommand = async (output, context) => {
612
600
  if (output.statusCode !== 200 && output.statusCode >= 300) {
613
601
  return de_AcceptResourceShareInvitationCommandError(output, context);
614
602
  }
615
- const contents = map({
603
+ const contents = (0, smithy_client_1.map)({
616
604
  $metadata: deserializeMetadata(output),
617
605
  });
618
606
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
619
- if (data.clientToken != null) {
620
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
621
- }
622
- if (data.resourceShareInvitation != null) {
623
- contents.resourceShareInvitation = de_ResourceShareInvitation(data.resourceShareInvitation, context);
624
- }
607
+ const doc = (0, smithy_client_1.take)(data, {
608
+ clientToken: smithy_client_1.expectString,
609
+ resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context),
610
+ });
611
+ Object.assign(contents, doc);
625
612
  return contents;
626
613
  };
627
614
  exports.de_AcceptResourceShareInvitationCommand = de_AcceptResourceShareInvitationCommand;
@@ -664,10 +651,9 @@ const de_AcceptResourceShareInvitationCommandError = async (output, context) =>
664
651
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
665
652
  default:
666
653
  const parsedBody = parsedOutput.body;
667
- (0, smithy_client_1.throwDefaultError)({
654
+ return throwDefaultError({
668
655
  output,
669
656
  parsedBody,
670
- exceptionCtor: RAMServiceException_1.RAMServiceException,
671
657
  errorCode,
672
658
  });
673
659
  }
@@ -676,16 +662,15 @@ const de_AssociateResourceShareCommand = async (output, context) => {
676
662
  if (output.statusCode !== 200 && output.statusCode >= 300) {
677
663
  return de_AssociateResourceShareCommandError(output, context);
678
664
  }
679
- const contents = map({
665
+ const contents = (0, smithy_client_1.map)({
680
666
  $metadata: deserializeMetadata(output),
681
667
  });
682
668
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
683
- if (data.clientToken != null) {
684
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
685
- }
686
- if (data.resourceShareAssociations != null) {
687
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
688
- }
669
+ const doc = (0, smithy_client_1.take)(data, {
670
+ clientToken: smithy_client_1.expectString,
671
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
672
+ });
673
+ Object.assign(contents, doc);
689
674
  return contents;
690
675
  };
691
676
  exports.de_AssociateResourceShareCommand = de_AssociateResourceShareCommand;
@@ -731,10 +716,9 @@ const de_AssociateResourceShareCommandError = async (output, context) => {
731
716
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
732
717
  default:
733
718
  const parsedBody = parsedOutput.body;
734
- (0, smithy_client_1.throwDefaultError)({
719
+ return throwDefaultError({
735
720
  output,
736
721
  parsedBody,
737
- exceptionCtor: RAMServiceException_1.RAMServiceException,
738
722
  errorCode,
739
723
  });
740
724
  }
@@ -743,16 +727,15 @@ const de_AssociateResourceSharePermissionCommand = async (output, context) => {
743
727
  if (output.statusCode !== 200 && output.statusCode >= 300) {
744
728
  return de_AssociateResourceSharePermissionCommandError(output, context);
745
729
  }
746
- const contents = map({
730
+ const contents = (0, smithy_client_1.map)({
747
731
  $metadata: deserializeMetadata(output),
748
732
  });
749
733
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
750
- if (data.clientToken != null) {
751
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
752
- }
753
- if (data.returnValue != null) {
754
- contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
755
- }
734
+ const doc = (0, smithy_client_1.take)(data, {
735
+ clientToken: smithy_client_1.expectString,
736
+ returnValue: smithy_client_1.expectBoolean,
737
+ });
738
+ Object.assign(contents, doc);
756
739
  return contents;
757
740
  };
758
741
  exports.de_AssociateResourceSharePermissionCommand = de_AssociateResourceSharePermissionCommand;
@@ -786,10 +769,9 @@ const de_AssociateResourceSharePermissionCommandError = async (output, context)
786
769
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
787
770
  default:
788
771
  const parsedBody = parsedOutput.body;
789
- (0, smithy_client_1.throwDefaultError)({
772
+ return throwDefaultError({
790
773
  output,
791
774
  parsedBody,
792
- exceptionCtor: RAMServiceException_1.RAMServiceException,
793
775
  errorCode,
794
776
  });
795
777
  }
@@ -798,16 +780,15 @@ const de_CreateResourceShareCommand = async (output, context) => {
798
780
  if (output.statusCode !== 200 && output.statusCode >= 300) {
799
781
  return de_CreateResourceShareCommandError(output, context);
800
782
  }
801
- const contents = map({
783
+ const contents = (0, smithy_client_1.map)({
802
784
  $metadata: deserializeMetadata(output),
803
785
  });
804
786
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
805
- if (data.clientToken != null) {
806
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
807
- }
808
- if (data.resourceShare != null) {
809
- contents.resourceShare = de_ResourceShare(data.resourceShare, context);
810
- }
787
+ const doc = (0, smithy_client_1.take)(data, {
788
+ clientToken: smithy_client_1.expectString,
789
+ resourceShare: (_) => de_ResourceShare(_, context),
790
+ });
791
+ Object.assign(contents, doc);
811
792
  return contents;
812
793
  };
813
794
  exports.de_CreateResourceShareCommand = de_CreateResourceShareCommand;
@@ -853,10 +834,9 @@ const de_CreateResourceShareCommandError = async (output, context) => {
853
834
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
854
835
  default:
855
836
  const parsedBody = parsedOutput.body;
856
- (0, smithy_client_1.throwDefaultError)({
837
+ return throwDefaultError({
857
838
  output,
858
839
  parsedBody,
859
- exceptionCtor: RAMServiceException_1.RAMServiceException,
860
840
  errorCode,
861
841
  });
862
842
  }
@@ -865,16 +845,15 @@ const de_DeleteResourceShareCommand = async (output, context) => {
865
845
  if (output.statusCode !== 200 && output.statusCode >= 300) {
866
846
  return de_DeleteResourceShareCommandError(output, context);
867
847
  }
868
- const contents = map({
848
+ const contents = (0, smithy_client_1.map)({
869
849
  $metadata: deserializeMetadata(output),
870
850
  });
871
851
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
872
- if (data.clientToken != null) {
873
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
874
- }
875
- if (data.returnValue != null) {
876
- contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
877
- }
852
+ const doc = (0, smithy_client_1.take)(data, {
853
+ clientToken: smithy_client_1.expectString,
854
+ returnValue: smithy_client_1.expectBoolean,
855
+ });
856
+ Object.assign(contents, doc);
878
857
  return contents;
879
858
  };
880
859
  exports.de_DeleteResourceShareCommand = de_DeleteResourceShareCommand;
@@ -914,10 +893,9 @@ const de_DeleteResourceShareCommandError = async (output, context) => {
914
893
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
915
894
  default:
916
895
  const parsedBody = parsedOutput.body;
917
- (0, smithy_client_1.throwDefaultError)({
896
+ return throwDefaultError({
918
897
  output,
919
898
  parsedBody,
920
- exceptionCtor: RAMServiceException_1.RAMServiceException,
921
899
  errorCode,
922
900
  });
923
901
  }
@@ -926,16 +904,15 @@ const de_DisassociateResourceShareCommand = async (output, context) => {
926
904
  if (output.statusCode !== 200 && output.statusCode >= 300) {
927
905
  return de_DisassociateResourceShareCommandError(output, context);
928
906
  }
929
- const contents = map({
907
+ const contents = (0, smithy_client_1.map)({
930
908
  $metadata: deserializeMetadata(output),
931
909
  });
932
910
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
933
- if (data.clientToken != null) {
934
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
935
- }
936
- if (data.resourceShareAssociations != null) {
937
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
938
- }
911
+ const doc = (0, smithy_client_1.take)(data, {
912
+ clientToken: smithy_client_1.expectString,
913
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
914
+ });
915
+ Object.assign(contents, doc);
939
916
  return contents;
940
917
  };
941
918
  exports.de_DisassociateResourceShareCommand = de_DisassociateResourceShareCommand;
@@ -978,10 +955,9 @@ const de_DisassociateResourceShareCommandError = async (output, context) => {
978
955
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
979
956
  default:
980
957
  const parsedBody = parsedOutput.body;
981
- (0, smithy_client_1.throwDefaultError)({
958
+ return throwDefaultError({
982
959
  output,
983
960
  parsedBody,
984
- exceptionCtor: RAMServiceException_1.RAMServiceException,
985
961
  errorCode,
986
962
  });
987
963
  }
@@ -990,16 +966,15 @@ const de_DisassociateResourceSharePermissionCommand = async (output, context) =>
990
966
  if (output.statusCode !== 200 && output.statusCode >= 300) {
991
967
  return de_DisassociateResourceSharePermissionCommandError(output, context);
992
968
  }
993
- const contents = map({
969
+ const contents = (0, smithy_client_1.map)({
994
970
  $metadata: deserializeMetadata(output),
995
971
  });
996
972
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
997
- if (data.clientToken != null) {
998
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
999
- }
1000
- if (data.returnValue != null) {
1001
- contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1002
- }
973
+ const doc = (0, smithy_client_1.take)(data, {
974
+ clientToken: smithy_client_1.expectString,
975
+ returnValue: smithy_client_1.expectBoolean,
976
+ });
977
+ Object.assign(contents, doc);
1003
978
  return contents;
1004
979
  };
1005
980
  exports.de_DisassociateResourceSharePermissionCommand = de_DisassociateResourceSharePermissionCommand;
@@ -1036,10 +1011,9 @@ const de_DisassociateResourceSharePermissionCommandError = async (output, contex
1036
1011
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1037
1012
  default:
1038
1013
  const parsedBody = parsedOutput.body;
1039
- (0, smithy_client_1.throwDefaultError)({
1014
+ return throwDefaultError({
1040
1015
  output,
1041
1016
  parsedBody,
1042
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1043
1017
  errorCode,
1044
1018
  });
1045
1019
  }
@@ -1048,13 +1022,14 @@ const de_EnableSharingWithAwsOrganizationCommand = async (output, context) => {
1048
1022
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1049
1023
  return de_EnableSharingWithAwsOrganizationCommandError(output, context);
1050
1024
  }
1051
- const contents = map({
1025
+ const contents = (0, smithy_client_1.map)({
1052
1026
  $metadata: deserializeMetadata(output),
1053
1027
  });
1054
1028
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1055
- if (data.returnValue != null) {
1056
- contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1057
- }
1029
+ const doc = (0, smithy_client_1.take)(data, {
1030
+ returnValue: smithy_client_1.expectBoolean,
1031
+ });
1032
+ Object.assign(contents, doc);
1058
1033
  return contents;
1059
1034
  };
1060
1035
  exports.de_EnableSharingWithAwsOrganizationCommand = de_EnableSharingWithAwsOrganizationCommand;
@@ -1076,10 +1051,9 @@ const de_EnableSharingWithAwsOrganizationCommandError = async (output, context)
1076
1051
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1077
1052
  default:
1078
1053
  const parsedBody = parsedOutput.body;
1079
- (0, smithy_client_1.throwDefaultError)({
1054
+ return throwDefaultError({
1080
1055
  output,
1081
1056
  parsedBody,
1082
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1083
1057
  errorCode,
1084
1058
  });
1085
1059
  }
@@ -1088,13 +1062,14 @@ const de_GetPermissionCommand = async (output, context) => {
1088
1062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1089
1063
  return de_GetPermissionCommandError(output, context);
1090
1064
  }
1091
- const contents = map({
1065
+ const contents = (0, smithy_client_1.map)({
1092
1066
  $metadata: deserializeMetadata(output),
1093
1067
  });
1094
1068
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1095
- if (data.permission != null) {
1096
- contents.permission = de_ResourceSharePermissionDetail(data.permission, context);
1097
- }
1069
+ const doc = (0, smithy_client_1.take)(data, {
1070
+ permission: (_) => de_ResourceSharePermissionDetail(_, context),
1071
+ });
1072
+ Object.assign(contents, doc);
1098
1073
  return contents;
1099
1074
  };
1100
1075
  exports.de_GetPermissionCommand = de_GetPermissionCommand;
@@ -1125,10 +1100,9 @@ const de_GetPermissionCommandError = async (output, context) => {
1125
1100
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1126
1101
  default:
1127
1102
  const parsedBody = parsedOutput.body;
1128
- (0, smithy_client_1.throwDefaultError)({
1103
+ return throwDefaultError({
1129
1104
  output,
1130
1105
  parsedBody,
1131
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1132
1106
  errorCode,
1133
1107
  });
1134
1108
  }
@@ -1137,16 +1111,15 @@ const de_GetResourcePoliciesCommand = async (output, context) => {
1137
1111
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1138
1112
  return de_GetResourcePoliciesCommandError(output, context);
1139
1113
  }
1140
- const contents = map({
1114
+ const contents = (0, smithy_client_1.map)({
1141
1115
  $metadata: deserializeMetadata(output),
1142
1116
  });
1143
1117
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1144
- if (data.nextToken != null) {
1145
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1146
- }
1147
- if (data.policies != null) {
1148
- contents.policies = de_PolicyList(data.policies, context);
1149
- }
1118
+ const doc = (0, smithy_client_1.take)(data, {
1119
+ nextToken: smithy_client_1.expectString,
1120
+ policies: smithy_client_1._json,
1121
+ });
1122
+ Object.assign(contents, doc);
1150
1123
  return contents;
1151
1124
  };
1152
1125
  exports.de_GetResourcePoliciesCommand = de_GetResourcePoliciesCommand;
@@ -1177,10 +1150,9 @@ const de_GetResourcePoliciesCommandError = async (output, context) => {
1177
1150
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1178
1151
  default:
1179
1152
  const parsedBody = parsedOutput.body;
1180
- (0, smithy_client_1.throwDefaultError)({
1153
+ return throwDefaultError({
1181
1154
  output,
1182
1155
  parsedBody,
1183
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1184
1156
  errorCode,
1185
1157
  });
1186
1158
  }
@@ -1189,16 +1161,15 @@ const de_GetResourceShareAssociationsCommand = async (output, context) => {
1189
1161
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1190
1162
  return de_GetResourceShareAssociationsCommandError(output, context);
1191
1163
  }
1192
- const contents = map({
1164
+ const contents = (0, smithy_client_1.map)({
1193
1165
  $metadata: deserializeMetadata(output),
1194
1166
  });
1195
1167
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1196
- if (data.nextToken != null) {
1197
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1198
- }
1199
- if (data.resourceShareAssociations != null) {
1200
- contents.resourceShareAssociations = de_ResourceShareAssociationList(data.resourceShareAssociations, context);
1201
- }
1168
+ const doc = (0, smithy_client_1.take)(data, {
1169
+ nextToken: smithy_client_1.expectString,
1170
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
1171
+ });
1172
+ Object.assign(contents, doc);
1202
1173
  return contents;
1203
1174
  };
1204
1175
  exports.de_GetResourceShareAssociationsCommand = de_GetResourceShareAssociationsCommand;
@@ -1232,10 +1203,9 @@ const de_GetResourceShareAssociationsCommandError = async (output, context) => {
1232
1203
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1233
1204
  default:
1234
1205
  const parsedBody = parsedOutput.body;
1235
- (0, smithy_client_1.throwDefaultError)({
1206
+ return throwDefaultError({
1236
1207
  output,
1237
1208
  parsedBody,
1238
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1239
1209
  errorCode,
1240
1210
  });
1241
1211
  }
@@ -1244,16 +1214,15 @@ const de_GetResourceShareInvitationsCommand = async (output, context) => {
1244
1214
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1245
1215
  return de_GetResourceShareInvitationsCommandError(output, context);
1246
1216
  }
1247
- const contents = map({
1217
+ const contents = (0, smithy_client_1.map)({
1248
1218
  $metadata: deserializeMetadata(output),
1249
1219
  });
1250
1220
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1251
- if (data.nextToken != null) {
1252
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1253
- }
1254
- if (data.resourceShareInvitations != null) {
1255
- contents.resourceShareInvitations = de_ResourceShareInvitationList(data.resourceShareInvitations, context);
1256
- }
1221
+ const doc = (0, smithy_client_1.take)(data, {
1222
+ nextToken: smithy_client_1.expectString,
1223
+ resourceShareInvitations: (_) => de_ResourceShareInvitationList(_, context),
1224
+ });
1225
+ Object.assign(contents, doc);
1257
1226
  return contents;
1258
1227
  };
1259
1228
  exports.de_GetResourceShareInvitationsCommand = de_GetResourceShareInvitationsCommand;
@@ -1290,10 +1259,9 @@ const de_GetResourceShareInvitationsCommandError = async (output, context) => {
1290
1259
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1291
1260
  default:
1292
1261
  const parsedBody = parsedOutput.body;
1293
- (0, smithy_client_1.throwDefaultError)({
1262
+ return throwDefaultError({
1294
1263
  output,
1295
1264
  parsedBody,
1296
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1297
1265
  errorCode,
1298
1266
  });
1299
1267
  }
@@ -1302,16 +1270,15 @@ const de_GetResourceSharesCommand = async (output, context) => {
1302
1270
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1303
1271
  return de_GetResourceSharesCommandError(output, context);
1304
1272
  }
1305
- const contents = map({
1273
+ const contents = (0, smithy_client_1.map)({
1306
1274
  $metadata: deserializeMetadata(output),
1307
1275
  });
1308
1276
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1309
- if (data.nextToken != null) {
1310
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1311
- }
1312
- if (data.resourceShares != null) {
1313
- contents.resourceShares = de_ResourceShareList(data.resourceShares, context);
1314
- }
1277
+ const doc = (0, smithy_client_1.take)(data, {
1278
+ nextToken: smithy_client_1.expectString,
1279
+ resourceShares: (_) => de_ResourceShareList(_, context),
1280
+ });
1281
+ Object.assign(contents, doc);
1315
1282
  return contents;
1316
1283
  };
1317
1284
  exports.de_GetResourceSharesCommand = de_GetResourceSharesCommand;
@@ -1342,10 +1309,9 @@ const de_GetResourceSharesCommandError = async (output, context) => {
1342
1309
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1343
1310
  default:
1344
1311
  const parsedBody = parsedOutput.body;
1345
- (0, smithy_client_1.throwDefaultError)({
1312
+ return throwDefaultError({
1346
1313
  output,
1347
1314
  parsedBody,
1348
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1349
1315
  errorCode,
1350
1316
  });
1351
1317
  }
@@ -1354,16 +1320,15 @@ const de_ListPendingInvitationResourcesCommand = async (output, context) => {
1354
1320
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1355
1321
  return de_ListPendingInvitationResourcesCommandError(output, context);
1356
1322
  }
1357
- const contents = map({
1323
+ const contents = (0, smithy_client_1.map)({
1358
1324
  $metadata: deserializeMetadata(output),
1359
1325
  });
1360
1326
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1361
- if (data.nextToken != null) {
1362
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1363
- }
1364
- if (data.resources != null) {
1365
- contents.resources = de_ResourceList(data.resources, context);
1366
- }
1327
+ const doc = (0, smithy_client_1.take)(data, {
1328
+ nextToken: smithy_client_1.expectString,
1329
+ resources: (_) => de_ResourceList(_, context),
1330
+ });
1331
+ Object.assign(contents, doc);
1367
1332
  return contents;
1368
1333
  };
1369
1334
  exports.de_ListPendingInvitationResourcesCommand = de_ListPendingInvitationResourcesCommand;
@@ -1403,10 +1368,9 @@ const de_ListPendingInvitationResourcesCommandError = async (output, context) =>
1403
1368
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1404
1369
  default:
1405
1370
  const parsedBody = parsedOutput.body;
1406
- (0, smithy_client_1.throwDefaultError)({
1371
+ return throwDefaultError({
1407
1372
  output,
1408
1373
  parsedBody,
1409
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1410
1374
  errorCode,
1411
1375
  });
1412
1376
  }
@@ -1415,16 +1379,15 @@ const de_ListPermissionsCommand = async (output, context) => {
1415
1379
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1416
1380
  return de_ListPermissionsCommandError(output, context);
1417
1381
  }
1418
- const contents = map({
1382
+ const contents = (0, smithy_client_1.map)({
1419
1383
  $metadata: deserializeMetadata(output),
1420
1384
  });
1421
1385
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1422
- if (data.nextToken != null) {
1423
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1424
- }
1425
- if (data.permissions != null) {
1426
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1427
- }
1386
+ const doc = (0, smithy_client_1.take)(data, {
1387
+ nextToken: smithy_client_1.expectString,
1388
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1389
+ });
1390
+ Object.assign(contents, doc);
1428
1391
  return contents;
1429
1392
  };
1430
1393
  exports.de_ListPermissionsCommand = de_ListPermissionsCommand;
@@ -1452,10 +1415,9 @@ const de_ListPermissionsCommandError = async (output, context) => {
1452
1415
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1453
1416
  default:
1454
1417
  const parsedBody = parsedOutput.body;
1455
- (0, smithy_client_1.throwDefaultError)({
1418
+ return throwDefaultError({
1456
1419
  output,
1457
1420
  parsedBody,
1458
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1459
1421
  errorCode,
1460
1422
  });
1461
1423
  }
@@ -1464,16 +1426,15 @@ const de_ListPermissionVersionsCommand = async (output, context) => {
1464
1426
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1465
1427
  return de_ListPermissionVersionsCommandError(output, context);
1466
1428
  }
1467
- const contents = map({
1429
+ const contents = (0, smithy_client_1.map)({
1468
1430
  $metadata: deserializeMetadata(output),
1469
1431
  });
1470
1432
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1471
- if (data.nextToken != null) {
1472
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1473
- }
1474
- if (data.permissions != null) {
1475
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1476
- }
1433
+ const doc = (0, smithy_client_1.take)(data, {
1434
+ nextToken: smithy_client_1.expectString,
1435
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1436
+ });
1437
+ Object.assign(contents, doc);
1477
1438
  return contents;
1478
1439
  };
1479
1440
  exports.de_ListPermissionVersionsCommand = de_ListPermissionVersionsCommand;
@@ -1507,10 +1468,9 @@ const de_ListPermissionVersionsCommandError = async (output, context) => {
1507
1468
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1508
1469
  default:
1509
1470
  const parsedBody = parsedOutput.body;
1510
- (0, smithy_client_1.throwDefaultError)({
1471
+ return throwDefaultError({
1511
1472
  output,
1512
1473
  parsedBody,
1513
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1514
1474
  errorCode,
1515
1475
  });
1516
1476
  }
@@ -1519,16 +1479,15 @@ const de_ListPrincipalsCommand = async (output, context) => {
1519
1479
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1520
1480
  return de_ListPrincipalsCommandError(output, context);
1521
1481
  }
1522
- const contents = map({
1482
+ const contents = (0, smithy_client_1.map)({
1523
1483
  $metadata: deserializeMetadata(output),
1524
1484
  });
1525
1485
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1526
- if (data.nextToken != null) {
1527
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1528
- }
1529
- if (data.principals != null) {
1530
- contents.principals = de_PrincipalList(data.principals, context);
1531
- }
1486
+ const doc = (0, smithy_client_1.take)(data, {
1487
+ nextToken: smithy_client_1.expectString,
1488
+ principals: (_) => de_PrincipalList(_, context),
1489
+ });
1490
+ Object.assign(contents, doc);
1532
1491
  return contents;
1533
1492
  };
1534
1493
  exports.de_ListPrincipalsCommand = de_ListPrincipalsCommand;
@@ -1559,10 +1518,9 @@ const de_ListPrincipalsCommandError = async (output, context) => {
1559
1518
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1560
1519
  default:
1561
1520
  const parsedBody = parsedOutput.body;
1562
- (0, smithy_client_1.throwDefaultError)({
1521
+ return throwDefaultError({
1563
1522
  output,
1564
1523
  parsedBody,
1565
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1566
1524
  errorCode,
1567
1525
  });
1568
1526
  }
@@ -1571,16 +1529,15 @@ const de_ListResourcesCommand = async (output, context) => {
1571
1529
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1572
1530
  return de_ListResourcesCommandError(output, context);
1573
1531
  }
1574
- const contents = map({
1532
+ const contents = (0, smithy_client_1.map)({
1575
1533
  $metadata: deserializeMetadata(output),
1576
1534
  });
1577
1535
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1578
- if (data.nextToken != null) {
1579
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1580
- }
1581
- if (data.resources != null) {
1582
- contents.resources = de_ResourceList(data.resources, context);
1583
- }
1536
+ const doc = (0, smithy_client_1.take)(data, {
1537
+ nextToken: smithy_client_1.expectString,
1538
+ resources: (_) => de_ResourceList(_, context),
1539
+ });
1540
+ Object.assign(contents, doc);
1584
1541
  return contents;
1585
1542
  };
1586
1543
  exports.de_ListResourcesCommand = de_ListResourcesCommand;
@@ -1614,10 +1571,9 @@ const de_ListResourcesCommandError = async (output, context) => {
1614
1571
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1615
1572
  default:
1616
1573
  const parsedBody = parsedOutput.body;
1617
- (0, smithy_client_1.throwDefaultError)({
1574
+ return throwDefaultError({
1618
1575
  output,
1619
1576
  parsedBody,
1620
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1621
1577
  errorCode,
1622
1578
  });
1623
1579
  }
@@ -1626,16 +1582,15 @@ const de_ListResourceSharePermissionsCommand = async (output, context) => {
1626
1582
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1627
1583
  return de_ListResourceSharePermissionsCommandError(output, context);
1628
1584
  }
1629
- const contents = map({
1585
+ const contents = (0, smithy_client_1.map)({
1630
1586
  $metadata: deserializeMetadata(output),
1631
1587
  });
1632
1588
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1633
- if (data.nextToken != null) {
1634
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1635
- }
1636
- if (data.permissions != null) {
1637
- contents.permissions = de_ResourceSharePermissionList(data.permissions, context);
1638
- }
1589
+ const doc = (0, smithy_client_1.take)(data, {
1590
+ nextToken: smithy_client_1.expectString,
1591
+ permissions: (_) => de_ResourceSharePermissionList(_, context),
1592
+ });
1593
+ Object.assign(contents, doc);
1639
1594
  return contents;
1640
1595
  };
1641
1596
  exports.de_ListResourceSharePermissionsCommand = de_ListResourceSharePermissionsCommand;
@@ -1669,10 +1624,9 @@ const de_ListResourceSharePermissionsCommandError = async (output, context) => {
1669
1624
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1670
1625
  default:
1671
1626
  const parsedBody = parsedOutput.body;
1672
- (0, smithy_client_1.throwDefaultError)({
1627
+ return throwDefaultError({
1673
1628
  output,
1674
1629
  parsedBody,
1675
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1676
1630
  errorCode,
1677
1631
  });
1678
1632
  }
@@ -1681,16 +1635,15 @@ const de_ListResourceTypesCommand = async (output, context) => {
1681
1635
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1682
1636
  return de_ListResourceTypesCommandError(output, context);
1683
1637
  }
1684
- const contents = map({
1638
+ const contents = (0, smithy_client_1.map)({
1685
1639
  $metadata: deserializeMetadata(output),
1686
1640
  });
1687
1641
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1688
- if (data.nextToken != null) {
1689
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1690
- }
1691
- if (data.resourceTypes != null) {
1692
- contents.resourceTypes = de_ServiceNameAndResourceTypeList(data.resourceTypes, context);
1693
- }
1642
+ const doc = (0, smithy_client_1.take)(data, {
1643
+ nextToken: smithy_client_1.expectString,
1644
+ resourceTypes: smithy_client_1._json,
1645
+ });
1646
+ Object.assign(contents, doc);
1694
1647
  return contents;
1695
1648
  };
1696
1649
  exports.de_ListResourceTypesCommand = de_ListResourceTypesCommand;
@@ -1715,10 +1668,9 @@ const de_ListResourceTypesCommandError = async (output, context) => {
1715
1668
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1716
1669
  default:
1717
1670
  const parsedBody = parsedOutput.body;
1718
- (0, smithy_client_1.throwDefaultError)({
1671
+ return throwDefaultError({
1719
1672
  output,
1720
1673
  parsedBody,
1721
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1722
1674
  errorCode,
1723
1675
  });
1724
1676
  }
@@ -1727,13 +1679,14 @@ const de_PromoteResourceShareCreatedFromPolicyCommand = async (output, context)
1727
1679
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1728
1680
  return de_PromoteResourceShareCreatedFromPolicyCommandError(output, context);
1729
1681
  }
1730
- const contents = map({
1682
+ const contents = (0, smithy_client_1.map)({
1731
1683
  $metadata: deserializeMetadata(output),
1732
1684
  });
1733
1685
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1734
- if (data.returnValue != null) {
1735
- contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1736
- }
1686
+ const doc = (0, smithy_client_1.take)(data, {
1687
+ returnValue: smithy_client_1.expectBoolean,
1688
+ });
1689
+ Object.assign(contents, doc);
1737
1690
  return contents;
1738
1691
  };
1739
1692
  exports.de_PromoteResourceShareCreatedFromPolicyCommand = de_PromoteResourceShareCreatedFromPolicyCommand;
@@ -1770,10 +1723,9 @@ const de_PromoteResourceShareCreatedFromPolicyCommandError = async (output, cont
1770
1723
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1771
1724
  default:
1772
1725
  const parsedBody = parsedOutput.body;
1773
- (0, smithy_client_1.throwDefaultError)({
1726
+ return throwDefaultError({
1774
1727
  output,
1775
1728
  parsedBody,
1776
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1777
1729
  errorCode,
1778
1730
  });
1779
1731
  }
@@ -1782,16 +1734,15 @@ const de_RejectResourceShareInvitationCommand = async (output, context) => {
1782
1734
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1783
1735
  return de_RejectResourceShareInvitationCommandError(output, context);
1784
1736
  }
1785
- const contents = map({
1737
+ const contents = (0, smithy_client_1.map)({
1786
1738
  $metadata: deserializeMetadata(output),
1787
1739
  });
1788
1740
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1789
- if (data.clientToken != null) {
1790
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
1791
- }
1792
- if (data.resourceShareInvitation != null) {
1793
- contents.resourceShareInvitation = de_ResourceShareInvitation(data.resourceShareInvitation, context);
1794
- }
1741
+ const doc = (0, smithy_client_1.take)(data, {
1742
+ clientToken: smithy_client_1.expectString,
1743
+ resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context),
1744
+ });
1745
+ Object.assign(contents, doc);
1795
1746
  return contents;
1796
1747
  };
1797
1748
  exports.de_RejectResourceShareInvitationCommand = de_RejectResourceShareInvitationCommand;
@@ -1834,10 +1785,9 @@ const de_RejectResourceShareInvitationCommandError = async (output, context) =>
1834
1785
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1835
1786
  default:
1836
1787
  const parsedBody = parsedOutput.body;
1837
- (0, smithy_client_1.throwDefaultError)({
1788
+ return throwDefaultError({
1838
1789
  output,
1839
1790
  parsedBody,
1840
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1841
1791
  errorCode,
1842
1792
  });
1843
1793
  }
@@ -1846,7 +1796,7 @@ const de_TagResourceCommand = async (output, context) => {
1846
1796
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1847
1797
  return de_TagResourceCommandError(output, context);
1848
1798
  }
1849
- const contents = map({
1799
+ const contents = (0, smithy_client_1.map)({
1850
1800
  $metadata: deserializeMetadata(output),
1851
1801
  });
1852
1802
  await collectBody(output.body, context);
@@ -1886,10 +1836,9 @@ const de_TagResourceCommandError = async (output, context) => {
1886
1836
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1887
1837
  default:
1888
1838
  const parsedBody = parsedOutput.body;
1889
- (0, smithy_client_1.throwDefaultError)({
1839
+ return throwDefaultError({
1890
1840
  output,
1891
1841
  parsedBody,
1892
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1893
1842
  errorCode,
1894
1843
  });
1895
1844
  }
@@ -1898,7 +1847,7 @@ const de_UntagResourceCommand = async (output, context) => {
1898
1847
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1899
1848
  return de_UntagResourceCommandError(output, context);
1900
1849
  }
1901
- const contents = map({
1850
+ const contents = (0, smithy_client_1.map)({
1902
1851
  $metadata: deserializeMetadata(output),
1903
1852
  });
1904
1853
  await collectBody(output.body, context);
@@ -1923,10 +1872,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1923
1872
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1924
1873
  default:
1925
1874
  const parsedBody = parsedOutput.body;
1926
- (0, smithy_client_1.throwDefaultError)({
1875
+ return throwDefaultError({
1927
1876
  output,
1928
1877
  parsedBody,
1929
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1930
1878
  errorCode,
1931
1879
  });
1932
1880
  }
@@ -1935,16 +1883,15 @@ const de_UpdateResourceShareCommand = async (output, context) => {
1935
1883
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1936
1884
  return de_UpdateResourceShareCommandError(output, context);
1937
1885
  }
1938
- const contents = map({
1886
+ const contents = (0, smithy_client_1.map)({
1939
1887
  $metadata: deserializeMetadata(output),
1940
1888
  });
1941
1889
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1942
- if (data.clientToken != null) {
1943
- contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
1944
- }
1945
- if (data.resourceShare != null) {
1946
- contents.resourceShare = de_ResourceShare(data.resourceShare, context);
1947
- }
1890
+ const doc = (0, smithy_client_1.take)(data, {
1891
+ clientToken: smithy_client_1.expectString,
1892
+ resourceShare: (_) => de_ResourceShare(_, context),
1893
+ });
1894
+ Object.assign(contents, doc);
1948
1895
  return contents;
1949
1896
  };
1950
1897
  exports.de_UpdateResourceShareCommand = de_UpdateResourceShareCommand;
@@ -1984,21 +1931,21 @@ const de_UpdateResourceShareCommandError = async (output, context) => {
1984
1931
  throw await de_UnknownResourceExceptionRes(parsedOutput, context);
1985
1932
  default:
1986
1933
  const parsedBody = parsedOutput.body;
1987
- (0, smithy_client_1.throwDefaultError)({
1934
+ return throwDefaultError({
1988
1935
  output,
1989
1936
  parsedBody,
1990
- exceptionCtor: RAMServiceException_1.RAMServiceException,
1991
1937
  errorCode,
1992
1938
  });
1993
1939
  }
1994
1940
  };
1995
- const map = smithy_client_1.map;
1941
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(RAMServiceException_1.RAMServiceException);
1996
1942
  const de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context) => {
1997
- const contents = map({});
1943
+ const contents = (0, smithy_client_1.map)({});
1998
1944
  const data = parsedOutput.body;
1999
- if (data.message != null) {
2000
- contents.message = (0, smithy_client_1.expectString)(data.message);
2001
- }
1945
+ const doc = (0, smithy_client_1.take)(data, {
1946
+ message: smithy_client_1.expectString,
1947
+ });
1948
+ Object.assign(contents, doc);
2002
1949
  const exception = new models_0_1.IdempotentParameterMismatchException({
2003
1950
  $metadata: deserializeMetadata(parsedOutput),
2004
1951
  ...contents,
@@ -2006,11 +1953,12 @@ const de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context)
2006
1953
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2007
1954
  };
2008
1955
  const de_InvalidClientTokenExceptionRes = async (parsedOutput, context) => {
2009
- const contents = map({});
1956
+ const contents = (0, smithy_client_1.map)({});
2010
1957
  const data = parsedOutput.body;
2011
- if (data.message != null) {
2012
- contents.message = (0, smithy_client_1.expectString)(data.message);
2013
- }
1958
+ const doc = (0, smithy_client_1.take)(data, {
1959
+ message: smithy_client_1.expectString,
1960
+ });
1961
+ Object.assign(contents, doc);
2014
1962
  const exception = new models_0_1.InvalidClientTokenException({
2015
1963
  $metadata: deserializeMetadata(parsedOutput),
2016
1964
  ...contents,
@@ -2018,11 +1966,12 @@ const de_InvalidClientTokenExceptionRes = async (parsedOutput, context) => {
2018
1966
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2019
1967
  };
2020
1968
  const de_InvalidMaxResultsExceptionRes = async (parsedOutput, context) => {
2021
- const contents = map({});
1969
+ const contents = (0, smithy_client_1.map)({});
2022
1970
  const data = parsedOutput.body;
2023
- if (data.message != null) {
2024
- contents.message = (0, smithy_client_1.expectString)(data.message);
2025
- }
1971
+ const doc = (0, smithy_client_1.take)(data, {
1972
+ message: smithy_client_1.expectString,
1973
+ });
1974
+ Object.assign(contents, doc);
2026
1975
  const exception = new models_0_1.InvalidMaxResultsException({
2027
1976
  $metadata: deserializeMetadata(parsedOutput),
2028
1977
  ...contents,
@@ -2030,11 +1979,12 @@ const de_InvalidMaxResultsExceptionRes = async (parsedOutput, context) => {
2030
1979
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2031
1980
  };
2032
1981
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
2033
- const contents = map({});
1982
+ const contents = (0, smithy_client_1.map)({});
2034
1983
  const data = parsedOutput.body;
2035
- if (data.message != null) {
2036
- contents.message = (0, smithy_client_1.expectString)(data.message);
2037
- }
1984
+ const doc = (0, smithy_client_1.take)(data, {
1985
+ message: smithy_client_1.expectString,
1986
+ });
1987
+ Object.assign(contents, doc);
2038
1988
  const exception = new models_0_1.InvalidNextTokenException({
2039
1989
  $metadata: deserializeMetadata(parsedOutput),
2040
1990
  ...contents,
@@ -2042,11 +1992,12 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
2042
1992
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2043
1993
  };
2044
1994
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
2045
- const contents = map({});
1995
+ const contents = (0, smithy_client_1.map)({});
2046
1996
  const data = parsedOutput.body;
2047
- if (data.message != null) {
2048
- contents.message = (0, smithy_client_1.expectString)(data.message);
2049
- }
1997
+ const doc = (0, smithy_client_1.take)(data, {
1998
+ message: smithy_client_1.expectString,
1999
+ });
2000
+ Object.assign(contents, doc);
2050
2001
  const exception = new models_0_1.InvalidParameterException({
2051
2002
  $metadata: deserializeMetadata(parsedOutput),
2052
2003
  ...contents,
@@ -2054,11 +2005,12 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
2054
2005
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2055
2006
  };
2056
2007
  const de_InvalidResourceTypeExceptionRes = async (parsedOutput, context) => {
2057
- const contents = map({});
2008
+ const contents = (0, smithy_client_1.map)({});
2058
2009
  const data = parsedOutput.body;
2059
- if (data.message != null) {
2060
- contents.message = (0, smithy_client_1.expectString)(data.message);
2061
- }
2010
+ const doc = (0, smithy_client_1.take)(data, {
2011
+ message: smithy_client_1.expectString,
2012
+ });
2013
+ Object.assign(contents, doc);
2062
2014
  const exception = new models_0_1.InvalidResourceTypeException({
2063
2015
  $metadata: deserializeMetadata(parsedOutput),
2064
2016
  ...contents,
@@ -2066,11 +2018,12 @@ const de_InvalidResourceTypeExceptionRes = async (parsedOutput, context) => {
2066
2018
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2067
2019
  };
2068
2020
  const de_InvalidStateTransitionExceptionRes = async (parsedOutput, context) => {
2069
- const contents = map({});
2021
+ const contents = (0, smithy_client_1.map)({});
2070
2022
  const data = parsedOutput.body;
2071
- if (data.message != null) {
2072
- contents.message = (0, smithy_client_1.expectString)(data.message);
2073
- }
2023
+ const doc = (0, smithy_client_1.take)(data, {
2024
+ message: smithy_client_1.expectString,
2025
+ });
2026
+ Object.assign(contents, doc);
2074
2027
  const exception = new models_0_1.InvalidStateTransitionException({
2075
2028
  $metadata: deserializeMetadata(parsedOutput),
2076
2029
  ...contents,
@@ -2078,11 +2031,12 @@ const de_InvalidStateTransitionExceptionRes = async (parsedOutput, context) => {
2078
2031
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2079
2032
  };
2080
2033
  const de_MalformedArnExceptionRes = async (parsedOutput, context) => {
2081
- const contents = map({});
2034
+ const contents = (0, smithy_client_1.map)({});
2082
2035
  const data = parsedOutput.body;
2083
- if (data.message != null) {
2084
- contents.message = (0, smithy_client_1.expectString)(data.message);
2085
- }
2036
+ const doc = (0, smithy_client_1.take)(data, {
2037
+ message: smithy_client_1.expectString,
2038
+ });
2039
+ Object.assign(contents, doc);
2086
2040
  const exception = new models_0_1.MalformedArnException({
2087
2041
  $metadata: deserializeMetadata(parsedOutput),
2088
2042
  ...contents,
@@ -2090,11 +2044,12 @@ const de_MalformedArnExceptionRes = async (parsedOutput, context) => {
2090
2044
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2091
2045
  };
2092
2046
  const de_MissingRequiredParameterExceptionRes = async (parsedOutput, context) => {
2093
- const contents = map({});
2047
+ const contents = (0, smithy_client_1.map)({});
2094
2048
  const data = parsedOutput.body;
2095
- if (data.message != null) {
2096
- contents.message = (0, smithy_client_1.expectString)(data.message);
2097
- }
2049
+ const doc = (0, smithy_client_1.take)(data, {
2050
+ message: smithy_client_1.expectString,
2051
+ });
2052
+ Object.assign(contents, doc);
2098
2053
  const exception = new models_0_1.MissingRequiredParameterException({
2099
2054
  $metadata: deserializeMetadata(parsedOutput),
2100
2055
  ...contents,
@@ -2102,11 +2057,12 @@ const de_MissingRequiredParameterExceptionRes = async (parsedOutput, context) =>
2102
2057
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2103
2058
  };
2104
2059
  const de_OperationNotPermittedExceptionRes = async (parsedOutput, context) => {
2105
- const contents = map({});
2060
+ const contents = (0, smithy_client_1.map)({});
2106
2061
  const data = parsedOutput.body;
2107
- if (data.message != null) {
2108
- contents.message = (0, smithy_client_1.expectString)(data.message);
2109
- }
2062
+ const doc = (0, smithy_client_1.take)(data, {
2063
+ message: smithy_client_1.expectString,
2064
+ });
2065
+ Object.assign(contents, doc);
2110
2066
  const exception = new models_0_1.OperationNotPermittedException({
2111
2067
  $metadata: deserializeMetadata(parsedOutput),
2112
2068
  ...contents,
@@ -2114,11 +2070,12 @@ const de_OperationNotPermittedExceptionRes = async (parsedOutput, context) => {
2114
2070
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2115
2071
  };
2116
2072
  const de_ResourceArnNotFoundExceptionRes = async (parsedOutput, context) => {
2117
- const contents = map({});
2073
+ const contents = (0, smithy_client_1.map)({});
2118
2074
  const data = parsedOutput.body;
2119
- if (data.message != null) {
2120
- contents.message = (0, smithy_client_1.expectString)(data.message);
2121
- }
2075
+ const doc = (0, smithy_client_1.take)(data, {
2076
+ message: smithy_client_1.expectString,
2077
+ });
2078
+ Object.assign(contents, doc);
2122
2079
  const exception = new models_0_1.ResourceArnNotFoundException({
2123
2080
  $metadata: deserializeMetadata(parsedOutput),
2124
2081
  ...contents,
@@ -2126,11 +2083,12 @@ const de_ResourceArnNotFoundExceptionRes = async (parsedOutput, context) => {
2126
2083
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2127
2084
  };
2128
2085
  const de_ResourceShareInvitationAlreadyAcceptedExceptionRes = async (parsedOutput, context) => {
2129
- const contents = map({});
2086
+ const contents = (0, smithy_client_1.map)({});
2130
2087
  const data = parsedOutput.body;
2131
- if (data.message != null) {
2132
- contents.message = (0, smithy_client_1.expectString)(data.message);
2133
- }
2088
+ const doc = (0, smithy_client_1.take)(data, {
2089
+ message: smithy_client_1.expectString,
2090
+ });
2091
+ Object.assign(contents, doc);
2134
2092
  const exception = new models_0_1.ResourceShareInvitationAlreadyAcceptedException({
2135
2093
  $metadata: deserializeMetadata(parsedOutput),
2136
2094
  ...contents,
@@ -2138,11 +2096,12 @@ const de_ResourceShareInvitationAlreadyAcceptedExceptionRes = async (parsedOutpu
2138
2096
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2139
2097
  };
2140
2098
  const de_ResourceShareInvitationAlreadyRejectedExceptionRes = async (parsedOutput, context) => {
2141
- const contents = map({});
2099
+ const contents = (0, smithy_client_1.map)({});
2142
2100
  const data = parsedOutput.body;
2143
- if (data.message != null) {
2144
- contents.message = (0, smithy_client_1.expectString)(data.message);
2145
- }
2101
+ const doc = (0, smithy_client_1.take)(data, {
2102
+ message: smithy_client_1.expectString,
2103
+ });
2104
+ Object.assign(contents, doc);
2146
2105
  const exception = new models_0_1.ResourceShareInvitationAlreadyRejectedException({
2147
2106
  $metadata: deserializeMetadata(parsedOutput),
2148
2107
  ...contents,
@@ -2150,11 +2109,12 @@ const de_ResourceShareInvitationAlreadyRejectedExceptionRes = async (parsedOutpu
2150
2109
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2151
2110
  };
2152
2111
  const de_ResourceShareInvitationArnNotFoundExceptionRes = async (parsedOutput, context) => {
2153
- const contents = map({});
2112
+ const contents = (0, smithy_client_1.map)({});
2154
2113
  const data = parsedOutput.body;
2155
- if (data.message != null) {
2156
- contents.message = (0, smithy_client_1.expectString)(data.message);
2157
- }
2114
+ const doc = (0, smithy_client_1.take)(data, {
2115
+ message: smithy_client_1.expectString,
2116
+ });
2117
+ Object.assign(contents, doc);
2158
2118
  const exception = new models_0_1.ResourceShareInvitationArnNotFoundException({
2159
2119
  $metadata: deserializeMetadata(parsedOutput),
2160
2120
  ...contents,
@@ -2162,11 +2122,12 @@ const de_ResourceShareInvitationArnNotFoundExceptionRes = async (parsedOutput, c
2162
2122
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2163
2123
  };
2164
2124
  const de_ResourceShareInvitationExpiredExceptionRes = async (parsedOutput, context) => {
2165
- const contents = map({});
2125
+ const contents = (0, smithy_client_1.map)({});
2166
2126
  const data = parsedOutput.body;
2167
- if (data.message != null) {
2168
- contents.message = (0, smithy_client_1.expectString)(data.message);
2169
- }
2127
+ const doc = (0, smithy_client_1.take)(data, {
2128
+ message: smithy_client_1.expectString,
2129
+ });
2130
+ Object.assign(contents, doc);
2170
2131
  const exception = new models_0_1.ResourceShareInvitationExpiredException({
2171
2132
  $metadata: deserializeMetadata(parsedOutput),
2172
2133
  ...contents,
@@ -2174,11 +2135,12 @@ const de_ResourceShareInvitationExpiredExceptionRes = async (parsedOutput, conte
2174
2135
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2175
2136
  };
2176
2137
  const de_ResourceShareLimitExceededExceptionRes = async (parsedOutput, context) => {
2177
- const contents = map({});
2138
+ const contents = (0, smithy_client_1.map)({});
2178
2139
  const data = parsedOutput.body;
2179
- if (data.message != null) {
2180
- contents.message = (0, smithy_client_1.expectString)(data.message);
2181
- }
2140
+ const doc = (0, smithy_client_1.take)(data, {
2141
+ message: smithy_client_1.expectString,
2142
+ });
2143
+ Object.assign(contents, doc);
2182
2144
  const exception = new models_0_1.ResourceShareLimitExceededException({
2183
2145
  $metadata: deserializeMetadata(parsedOutput),
2184
2146
  ...contents,
@@ -2186,11 +2148,12 @@ const de_ResourceShareLimitExceededExceptionRes = async (parsedOutput, context)
2186
2148
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2187
2149
  };
2188
2150
  const de_ServerInternalExceptionRes = async (parsedOutput, context) => {
2189
- const contents = map({});
2151
+ const contents = (0, smithy_client_1.map)({});
2190
2152
  const data = parsedOutput.body;
2191
- if (data.message != null) {
2192
- contents.message = (0, smithy_client_1.expectString)(data.message);
2193
- }
2153
+ const doc = (0, smithy_client_1.take)(data, {
2154
+ message: smithy_client_1.expectString,
2155
+ });
2156
+ Object.assign(contents, doc);
2194
2157
  const exception = new models_0_1.ServerInternalException({
2195
2158
  $metadata: deserializeMetadata(parsedOutput),
2196
2159
  ...contents,
@@ -2198,11 +2161,12 @@ const de_ServerInternalExceptionRes = async (parsedOutput, context) => {
2198
2161
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2199
2162
  };
2200
2163
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
2201
- const contents = map({});
2164
+ const contents = (0, smithy_client_1.map)({});
2202
2165
  const data = parsedOutput.body;
2203
- if (data.message != null) {
2204
- contents.message = (0, smithy_client_1.expectString)(data.message);
2205
- }
2166
+ const doc = (0, smithy_client_1.take)(data, {
2167
+ message: smithy_client_1.expectString,
2168
+ });
2169
+ Object.assign(contents, doc);
2206
2170
  const exception = new models_0_1.ServiceUnavailableException({
2207
2171
  $metadata: deserializeMetadata(parsedOutput),
2208
2172
  ...contents,
@@ -2210,11 +2174,12 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
2210
2174
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2211
2175
  };
2212
2176
  const de_TagLimitExceededExceptionRes = async (parsedOutput, context) => {
2213
- const contents = map({});
2177
+ const contents = (0, smithy_client_1.map)({});
2214
2178
  const data = parsedOutput.body;
2215
- if (data.message != null) {
2216
- contents.message = (0, smithy_client_1.expectString)(data.message);
2217
- }
2179
+ const doc = (0, smithy_client_1.take)(data, {
2180
+ message: smithy_client_1.expectString,
2181
+ });
2182
+ Object.assign(contents, doc);
2218
2183
  const exception = new models_0_1.TagLimitExceededException({
2219
2184
  $metadata: deserializeMetadata(parsedOutput),
2220
2185
  ...contents,
@@ -2222,11 +2187,12 @@ const de_TagLimitExceededExceptionRes = async (parsedOutput, context) => {
2222
2187
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2223
2188
  };
2224
2189
  const de_TagPolicyViolationExceptionRes = async (parsedOutput, context) => {
2225
- const contents = map({});
2190
+ const contents = (0, smithy_client_1.map)({});
2226
2191
  const data = parsedOutput.body;
2227
- if (data.message != null) {
2228
- contents.message = (0, smithy_client_1.expectString)(data.message);
2229
- }
2192
+ const doc = (0, smithy_client_1.take)(data, {
2193
+ message: smithy_client_1.expectString,
2194
+ });
2195
+ Object.assign(contents, doc);
2230
2196
  const exception = new models_0_1.TagPolicyViolationException({
2231
2197
  $metadata: deserializeMetadata(parsedOutput),
2232
2198
  ...contents,
@@ -2234,11 +2200,12 @@ const de_TagPolicyViolationExceptionRes = async (parsedOutput, context) => {
2234
2200
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2235
2201
  };
2236
2202
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2237
- const contents = map({});
2203
+ const contents = (0, smithy_client_1.map)({});
2238
2204
  const data = parsedOutput.body;
2239
- if (data.message != null) {
2240
- contents.message = (0, smithy_client_1.expectString)(data.message);
2241
- }
2205
+ const doc = (0, smithy_client_1.take)(data, {
2206
+ message: smithy_client_1.expectString,
2207
+ });
2208
+ Object.assign(contents, doc);
2242
2209
  const exception = new models_0_1.ThrottlingException({
2243
2210
  $metadata: deserializeMetadata(parsedOutput),
2244
2211
  ...contents,
@@ -2246,225 +2213,108 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2246
2213
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2247
2214
  };
2248
2215
  const de_UnknownResourceExceptionRes = async (parsedOutput, context) => {
2249
- const contents = map({});
2216
+ const contents = (0, smithy_client_1.map)({});
2250
2217
  const data = parsedOutput.body;
2251
- if (data.message != null) {
2252
- contents.message = (0, smithy_client_1.expectString)(data.message);
2253
- }
2218
+ const doc = (0, smithy_client_1.take)(data, {
2219
+ message: smithy_client_1.expectString,
2220
+ });
2221
+ Object.assign(contents, doc);
2254
2222
  const exception = new models_0_1.UnknownResourceException({
2255
2223
  $metadata: deserializeMetadata(parsedOutput),
2256
2224
  ...contents,
2257
2225
  });
2258
2226
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2259
2227
  };
2260
- const se_PermissionArnList = (input, context) => {
2261
- return input
2262
- .filter((e) => e != null)
2263
- .map((entry) => {
2264
- return entry;
2265
- });
2266
- };
2267
- const se_PrincipalArnOrIdList = (input, context) => {
2268
- return input
2269
- .filter((e) => e != null)
2270
- .map((entry) => {
2271
- return entry;
2272
- });
2273
- };
2274
- const se_ResourceArnList = (input, context) => {
2275
- return input
2276
- .filter((e) => e != null)
2277
- .map((entry) => {
2278
- return entry;
2279
- });
2280
- };
2281
- const se_ResourceShareArnList = (input, context) => {
2282
- return input
2283
- .filter((e) => e != null)
2284
- .map((entry) => {
2285
- return entry;
2286
- });
2287
- };
2288
- const se_ResourceShareInvitationArnList = (input, context) => {
2289
- return input
2290
- .filter((e) => e != null)
2291
- .map((entry) => {
2292
- return entry;
2293
- });
2294
- };
2295
- const se_Tag = (input, context) => {
2296
- return {
2297
- ...(input.key != null && { key: input.key }),
2298
- ...(input.value != null && { value: input.value }),
2299
- };
2300
- };
2301
- const se_TagFilter = (input, context) => {
2302
- return {
2303
- ...(input.tagKey != null && { tagKey: input.tagKey }),
2304
- ...(input.tagValues != null && { tagValues: se_TagValueList(input.tagValues, context) }),
2305
- };
2306
- };
2307
- const se_TagFilters = (input, context) => {
2308
- return input
2309
- .filter((e) => e != null)
2310
- .map((entry) => {
2311
- return se_TagFilter(entry, context);
2312
- });
2313
- };
2314
- const se_TagKeyList = (input, context) => {
2315
- return input
2316
- .filter((e) => e != null)
2317
- .map((entry) => {
2318
- return entry;
2319
- });
2320
- };
2321
- const se_TagList = (input, context) => {
2322
- return input
2323
- .filter((e) => e != null)
2324
- .map((entry) => {
2325
- return se_Tag(entry, context);
2326
- });
2327
- };
2328
- const se_TagValueList = (input, context) => {
2329
- return input
2330
- .filter((e) => e != null)
2331
- .map((entry) => {
2332
- return entry;
2333
- });
2334
- };
2335
- const de_PolicyList = (output, context) => {
2336
- const retVal = (output || [])
2337
- .filter((e) => e != null)
2338
- .map((entry) => {
2339
- if (entry === null) {
2340
- return null;
2341
- }
2342
- return (0, smithy_client_1.expectString)(entry);
2343
- });
2344
- return retVal;
2345
- };
2346
2228
  const de_Principal = (output, context) => {
2347
- return {
2348
- creationTime: output.creationTime != null
2349
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2350
- : undefined,
2351
- external: (0, smithy_client_1.expectBoolean)(output.external),
2352
- id: (0, smithy_client_1.expectString)(output.id),
2353
- lastUpdatedTime: output.lastUpdatedTime != null
2354
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2355
- : undefined,
2356
- resourceShareArn: (0, smithy_client_1.expectString)(output.resourceShareArn),
2357
- };
2229
+ return (0, smithy_client_1.take)(output, {
2230
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2231
+ external: smithy_client_1.expectBoolean,
2232
+ id: smithy_client_1.expectString,
2233
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2234
+ resourceShareArn: smithy_client_1.expectString,
2235
+ });
2358
2236
  };
2359
2237
  const de_PrincipalList = (output, context) => {
2360
2238
  const retVal = (output || [])
2361
2239
  .filter((e) => e != null)
2362
2240
  .map((entry) => {
2363
- if (entry === null) {
2364
- return null;
2365
- }
2366
2241
  return de_Principal(entry, context);
2367
2242
  });
2368
2243
  return retVal;
2369
2244
  };
2370
2245
  const de_Resource = (output, context) => {
2371
- return {
2372
- arn: (0, smithy_client_1.expectString)(output.arn),
2373
- creationTime: output.creationTime != null
2374
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2375
- : undefined,
2376
- lastUpdatedTime: output.lastUpdatedTime != null
2377
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2378
- : undefined,
2379
- resourceGroupArn: (0, smithy_client_1.expectString)(output.resourceGroupArn),
2380
- resourceRegionScope: (0, smithy_client_1.expectString)(output.resourceRegionScope),
2381
- resourceShareArn: (0, smithy_client_1.expectString)(output.resourceShareArn),
2382
- status: (0, smithy_client_1.expectString)(output.status),
2383
- statusMessage: (0, smithy_client_1.expectString)(output.statusMessage),
2384
- type: (0, smithy_client_1.expectString)(output.type),
2385
- };
2246
+ return (0, smithy_client_1.take)(output, {
2247
+ arn: smithy_client_1.expectString,
2248
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2249
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2250
+ resourceGroupArn: smithy_client_1.expectString,
2251
+ resourceRegionScope: smithy_client_1.expectString,
2252
+ resourceShareArn: smithy_client_1.expectString,
2253
+ status: smithy_client_1.expectString,
2254
+ statusMessage: smithy_client_1.expectString,
2255
+ type: smithy_client_1.expectString,
2256
+ });
2386
2257
  };
2387
2258
  const de_ResourceList = (output, context) => {
2388
2259
  const retVal = (output || [])
2389
2260
  .filter((e) => e != null)
2390
2261
  .map((entry) => {
2391
- if (entry === null) {
2392
- return null;
2393
- }
2394
2262
  return de_Resource(entry, context);
2395
2263
  });
2396
2264
  return retVal;
2397
2265
  };
2398
2266
  const de_ResourceShare = (output, context) => {
2399
- return {
2400
- allowExternalPrincipals: (0, smithy_client_1.expectBoolean)(output.allowExternalPrincipals),
2401
- creationTime: output.creationTime != null
2402
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2403
- : undefined,
2404
- featureSet: (0, smithy_client_1.expectString)(output.featureSet),
2405
- lastUpdatedTime: output.lastUpdatedTime != null
2406
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2407
- : undefined,
2408
- name: (0, smithy_client_1.expectString)(output.name),
2409
- owningAccountId: (0, smithy_client_1.expectString)(output.owningAccountId),
2410
- resourceShareArn: (0, smithy_client_1.expectString)(output.resourceShareArn),
2411
- status: (0, smithy_client_1.expectString)(output.status),
2412
- statusMessage: (0, smithy_client_1.expectString)(output.statusMessage),
2413
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
2414
- };
2267
+ return (0, smithy_client_1.take)(output, {
2268
+ allowExternalPrincipals: smithy_client_1.expectBoolean,
2269
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2270
+ featureSet: smithy_client_1.expectString,
2271
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2272
+ name: smithy_client_1.expectString,
2273
+ owningAccountId: smithy_client_1.expectString,
2274
+ resourceShareArn: smithy_client_1.expectString,
2275
+ status: smithy_client_1.expectString,
2276
+ statusMessage: smithy_client_1.expectString,
2277
+ tags: smithy_client_1._json,
2278
+ });
2415
2279
  };
2416
2280
  const de_ResourceShareAssociation = (output, context) => {
2417
- return {
2418
- associatedEntity: (0, smithy_client_1.expectString)(output.associatedEntity),
2419
- associationType: (0, smithy_client_1.expectString)(output.associationType),
2420
- creationTime: output.creationTime != null
2421
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2422
- : undefined,
2423
- external: (0, smithy_client_1.expectBoolean)(output.external),
2424
- lastUpdatedTime: output.lastUpdatedTime != null
2425
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2426
- : undefined,
2427
- resourceShareArn: (0, smithy_client_1.expectString)(output.resourceShareArn),
2428
- resourceShareName: (0, smithy_client_1.expectString)(output.resourceShareName),
2429
- status: (0, smithy_client_1.expectString)(output.status),
2430
- statusMessage: (0, smithy_client_1.expectString)(output.statusMessage),
2431
- };
2281
+ return (0, smithy_client_1.take)(output, {
2282
+ associatedEntity: smithy_client_1.expectString,
2283
+ associationType: smithy_client_1.expectString,
2284
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2285
+ external: smithy_client_1.expectBoolean,
2286
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2287
+ resourceShareArn: smithy_client_1.expectString,
2288
+ resourceShareName: smithy_client_1.expectString,
2289
+ status: smithy_client_1.expectString,
2290
+ statusMessage: smithy_client_1.expectString,
2291
+ });
2432
2292
  };
2433
2293
  const de_ResourceShareAssociationList = (output, context) => {
2434
2294
  const retVal = (output || [])
2435
2295
  .filter((e) => e != null)
2436
2296
  .map((entry) => {
2437
- if (entry === null) {
2438
- return null;
2439
- }
2440
2297
  return de_ResourceShareAssociation(entry, context);
2441
2298
  });
2442
2299
  return retVal;
2443
2300
  };
2444
2301
  const de_ResourceShareInvitation = (output, context) => {
2445
- return {
2446
- invitationTimestamp: output.invitationTimestamp != null
2447
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.invitationTimestamp)))
2448
- : undefined,
2449
- receiverAccountId: (0, smithy_client_1.expectString)(output.receiverAccountId),
2450
- receiverArn: (0, smithy_client_1.expectString)(output.receiverArn),
2451
- resourceShareArn: (0, smithy_client_1.expectString)(output.resourceShareArn),
2452
- resourceShareAssociations: output.resourceShareAssociations != null
2453
- ? de_ResourceShareAssociationList(output.resourceShareAssociations, context)
2454
- : undefined,
2455
- resourceShareInvitationArn: (0, smithy_client_1.expectString)(output.resourceShareInvitationArn),
2456
- resourceShareName: (0, smithy_client_1.expectString)(output.resourceShareName),
2457
- senderAccountId: (0, smithy_client_1.expectString)(output.senderAccountId),
2458
- status: (0, smithy_client_1.expectString)(output.status),
2459
- };
2302
+ return (0, smithy_client_1.take)(output, {
2303
+ invitationTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2304
+ receiverAccountId: smithy_client_1.expectString,
2305
+ receiverArn: smithy_client_1.expectString,
2306
+ resourceShareArn: smithy_client_1.expectString,
2307
+ resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context),
2308
+ resourceShareInvitationArn: smithy_client_1.expectString,
2309
+ resourceShareName: smithy_client_1.expectString,
2310
+ senderAccountId: smithy_client_1.expectString,
2311
+ status: smithy_client_1.expectString,
2312
+ });
2460
2313
  };
2461
2314
  const de_ResourceShareInvitationList = (output, context) => {
2462
2315
  const retVal = (output || [])
2463
2316
  .filter((e) => e != null)
2464
2317
  .map((entry) => {
2465
- if (entry === null) {
2466
- return null;
2467
- }
2468
2318
  return de_ResourceShareInvitation(entry, context);
2469
2319
  });
2470
2320
  return retVal;
@@ -2473,92 +2323,43 @@ const de_ResourceShareList = (output, context) => {
2473
2323
  const retVal = (output || [])
2474
2324
  .filter((e) => e != null)
2475
2325
  .map((entry) => {
2476
- if (entry === null) {
2477
- return null;
2478
- }
2479
2326
  return de_ResourceShare(entry, context);
2480
2327
  });
2481
2328
  return retVal;
2482
2329
  };
2483
2330
  const de_ResourceSharePermissionDetail = (output, context) => {
2484
- return {
2485
- arn: (0, smithy_client_1.expectString)(output.arn),
2486
- creationTime: output.creationTime != null
2487
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2488
- : undefined,
2489
- defaultVersion: (0, smithy_client_1.expectBoolean)(output.defaultVersion),
2490
- isResourceTypeDefault: (0, smithy_client_1.expectBoolean)(output.isResourceTypeDefault),
2491
- lastUpdatedTime: output.lastUpdatedTime != null
2492
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2493
- : undefined,
2494
- name: (0, smithy_client_1.expectString)(output.name),
2495
- permission: (0, smithy_client_1.expectString)(output.permission),
2496
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
2497
- version: (0, smithy_client_1.expectString)(output.version),
2498
- };
2331
+ return (0, smithy_client_1.take)(output, {
2332
+ arn: smithy_client_1.expectString,
2333
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2334
+ defaultVersion: smithy_client_1.expectBoolean,
2335
+ isResourceTypeDefault: smithy_client_1.expectBoolean,
2336
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2337
+ name: smithy_client_1.expectString,
2338
+ permission: smithy_client_1.expectString,
2339
+ resourceType: smithy_client_1.expectString,
2340
+ version: smithy_client_1.expectString,
2341
+ });
2499
2342
  };
2500
2343
  const de_ResourceSharePermissionList = (output, context) => {
2501
2344
  const retVal = (output || [])
2502
2345
  .filter((e) => e != null)
2503
2346
  .map((entry) => {
2504
- if (entry === null) {
2505
- return null;
2506
- }
2507
2347
  return de_ResourceSharePermissionSummary(entry, context);
2508
2348
  });
2509
2349
  return retVal;
2510
2350
  };
2511
2351
  const de_ResourceSharePermissionSummary = (output, context) => {
2512
- return {
2513
- arn: (0, smithy_client_1.expectString)(output.arn),
2514
- creationTime: output.creationTime != null
2515
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
2516
- : undefined,
2517
- defaultVersion: (0, smithy_client_1.expectBoolean)(output.defaultVersion),
2518
- isResourceTypeDefault: (0, smithy_client_1.expectBoolean)(output.isResourceTypeDefault),
2519
- lastUpdatedTime: output.lastUpdatedTime != null
2520
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
2521
- : undefined,
2522
- name: (0, smithy_client_1.expectString)(output.name),
2523
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
2524
- status: (0, smithy_client_1.expectString)(output.status),
2525
- version: (0, smithy_client_1.expectString)(output.version),
2526
- };
2527
- };
2528
- const de_ServiceNameAndResourceType = (output, context) => {
2529
- return {
2530
- resourceRegionScope: (0, smithy_client_1.expectString)(output.resourceRegionScope),
2531
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
2532
- serviceName: (0, smithy_client_1.expectString)(output.serviceName),
2533
- };
2534
- };
2535
- const de_ServiceNameAndResourceTypeList = (output, context) => {
2536
- const retVal = (output || [])
2537
- .filter((e) => e != null)
2538
- .map((entry) => {
2539
- if (entry === null) {
2540
- return null;
2541
- }
2542
- return de_ServiceNameAndResourceType(entry, context);
2352
+ return (0, smithy_client_1.take)(output, {
2353
+ arn: smithy_client_1.expectString,
2354
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2355
+ defaultVersion: smithy_client_1.expectBoolean,
2356
+ isResourceTypeDefault: smithy_client_1.expectBoolean,
2357
+ lastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2358
+ name: smithy_client_1.expectString,
2359
+ resourceType: smithy_client_1.expectString,
2360
+ status: smithy_client_1.expectString,
2361
+ version: smithy_client_1.expectString,
2543
2362
  });
2544
- return retVal;
2545
- };
2546
- const de_Tag = (output, context) => {
2547
- return {
2548
- key: (0, smithy_client_1.expectString)(output.key),
2549
- value: (0, smithy_client_1.expectString)(output.value),
2550
- };
2551
- };
2552
- const de_TagList = (output, context) => {
2553
- const retVal = (output || [])
2554
- .filter((e) => e != null)
2555
- .map((entry) => {
2556
- if (entry === null) {
2557
- return null;
2558
- }
2559
- return de_Tag(entry, context);
2560
- });
2561
- return retVal;
2562
2363
  };
2563
2364
  const deserializeMetadata = (output) => ({
2564
2365
  httpStatusCode: output.statusCode,