@aws-sdk/client-resource-groups 3.312.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,13 +12,13 @@ const se_CreateGroupCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/groups";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.Configuration != null && { Configuration: se_GroupConfigurationList(input.Configuration, context) }),
17
- ...(input.Description != null && { Description: input.Description }),
18
- ...(input.Name != null && { Name: input.Name }),
19
- ...(input.ResourceQuery != null && { ResourceQuery: se_ResourceQuery(input.ResourceQuery, context) }),
20
- ...(input.Tags != null && { Tags: se_Tags(input.Tags, context) }),
21
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ Configuration: (_) => (0, smithy_client_1._json)(_),
17
+ Description: [],
18
+ Name: [],
19
+ ResourceQuery: (_) => (0, smithy_client_1._json)(_),
20
+ Tags: (_) => (0, smithy_client_1._json)(_),
21
+ }));
22
22
  return new protocol_http_1.HttpRequest({
23
23
  protocol,
24
24
  hostname,
@@ -37,10 +37,10 @@ const se_DeleteGroupCommand = async (input, context) => {
37
37
  };
38
38
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/delete-group";
39
39
  let body;
40
- body = JSON.stringify({
41
- ...(input.Group != null && { Group: input.Group }),
42
- ...(input.GroupName != null && { GroupName: input.GroupName }),
43
- });
40
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
41
+ Group: [],
42
+ GroupName: [],
43
+ }));
44
44
  return new protocol_http_1.HttpRequest({
45
45
  protocol,
46
46
  hostname,
@@ -78,10 +78,10 @@ const se_GetGroupCommand = async (input, context) => {
78
78
  };
79
79
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-group";
80
80
  let body;
81
- body = JSON.stringify({
82
- ...(input.Group != null && { Group: input.Group }),
83
- ...(input.GroupName != null && { GroupName: input.GroupName }),
84
- });
81
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
82
+ Group: [],
83
+ GroupName: [],
84
+ }));
85
85
  return new protocol_http_1.HttpRequest({
86
86
  protocol,
87
87
  hostname,
@@ -100,9 +100,9 @@ const se_GetGroupConfigurationCommand = async (input, context) => {
100
100
  };
101
101
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-group-configuration";
102
102
  let body;
103
- body = JSON.stringify({
104
- ...(input.Group != null && { Group: input.Group }),
105
- });
103
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
104
+ Group: [],
105
+ }));
106
106
  return new protocol_http_1.HttpRequest({
107
107
  protocol,
108
108
  hostname,
@@ -121,10 +121,10 @@ const se_GetGroupQueryCommand = async (input, context) => {
121
121
  };
122
122
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-group-query";
123
123
  let body;
124
- body = JSON.stringify({
125
- ...(input.Group != null && { Group: input.Group }),
126
- ...(input.GroupName != null && { GroupName: input.GroupName }),
127
- });
124
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
125
+ Group: [],
126
+ GroupName: [],
127
+ }));
128
128
  return new protocol_http_1.HttpRequest({
129
129
  protocol,
130
130
  hostname,
@@ -160,10 +160,10 @@ const se_GroupResourcesCommand = async (input, context) => {
160
160
  };
161
161
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/group-resources";
162
162
  let body;
163
- body = JSON.stringify({
164
- ...(input.Group != null && { Group: input.Group }),
165
- ...(input.ResourceArns != null && { ResourceArns: se_ResourceArnList(input.ResourceArns, context) }),
166
- });
163
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
164
+ Group: [],
165
+ ResourceArns: (_) => (0, smithy_client_1._json)(_),
166
+ }));
167
167
  return new protocol_http_1.HttpRequest({
168
168
  protocol,
169
169
  hostname,
@@ -182,13 +182,13 @@ const se_ListGroupResourcesCommand = async (input, context) => {
182
182
  };
183
183
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-group-resources";
184
184
  let body;
185
- body = JSON.stringify({
186
- ...(input.Filters != null && { Filters: se_ResourceFilterList(input.Filters, context) }),
187
- ...(input.Group != null && { Group: input.Group }),
188
- ...(input.GroupName != null && { GroupName: input.GroupName }),
189
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
190
- ...(input.NextToken != null && { NextToken: input.NextToken }),
191
- });
185
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
186
+ Filters: (_) => (0, smithy_client_1._json)(_),
187
+ Group: [],
188
+ GroupName: [],
189
+ MaxResults: [],
190
+ NextToken: [],
191
+ }));
192
192
  return new protocol_http_1.HttpRequest({
193
193
  protocol,
194
194
  hostname,
@@ -206,14 +206,14 @@ const se_ListGroupsCommand = async (input, context) => {
206
206
  "content-type": "application/json",
207
207
  };
208
208
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/groups-list";
209
- const query = map({
209
+ const query = (0, smithy_client_1.map)({
210
210
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
211
211
  nextToken: [, input.NextToken],
212
212
  });
213
213
  let body;
214
- body = JSON.stringify({
215
- ...(input.Filters != null && { Filters: se_GroupFilterList(input.Filters, context) }),
216
- });
214
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
215
+ Filters: (_) => (0, smithy_client_1._json)(_),
216
+ }));
217
217
  return new protocol_http_1.HttpRequest({
218
218
  protocol,
219
219
  hostname,
@@ -233,10 +233,10 @@ const se_PutGroupConfigurationCommand = async (input, context) => {
233
233
  };
234
234
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/put-group-configuration";
235
235
  let body;
236
- body = JSON.stringify({
237
- ...(input.Configuration != null && { Configuration: se_GroupConfigurationList(input.Configuration, context) }),
238
- ...(input.Group != null && { Group: input.Group }),
239
- });
236
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
237
+ Configuration: (_) => (0, smithy_client_1._json)(_),
238
+ Group: [],
239
+ }));
240
240
  return new protocol_http_1.HttpRequest({
241
241
  protocol,
242
242
  hostname,
@@ -255,11 +255,11 @@ const se_SearchResourcesCommand = async (input, context) => {
255
255
  };
256
256
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resources/search";
257
257
  let body;
258
- body = JSON.stringify({
259
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
260
- ...(input.NextToken != null && { NextToken: input.NextToken }),
261
- ...(input.ResourceQuery != null && { ResourceQuery: se_ResourceQuery(input.ResourceQuery, context) }),
262
- });
258
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
259
+ MaxResults: [],
260
+ NextToken: [],
261
+ ResourceQuery: (_) => (0, smithy_client_1._json)(_),
262
+ }));
263
263
  return new protocol_http_1.HttpRequest({
264
264
  protocol,
265
265
  hostname,
@@ -279,9 +279,9 @@ const se_TagCommand = async (input, context) => {
279
279
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resources/{Arn}/tags";
280
280
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Arn", () => input.Arn, "{Arn}", false);
281
281
  let body;
282
- body = JSON.stringify({
283
- ...(input.Tags != null && { Tags: se_Tags(input.Tags, context) }),
284
- });
282
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
283
+ Tags: (_) => (0, smithy_client_1._json)(_),
284
+ }));
285
285
  return new protocol_http_1.HttpRequest({
286
286
  protocol,
287
287
  hostname,
@@ -300,10 +300,10 @@ const se_UngroupResourcesCommand = async (input, context) => {
300
300
  };
301
301
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ungroup-resources";
302
302
  let body;
303
- body = JSON.stringify({
304
- ...(input.Group != null && { Group: input.Group }),
305
- ...(input.ResourceArns != null && { ResourceArns: se_ResourceArnList(input.ResourceArns, context) }),
306
- });
303
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
304
+ Group: [],
305
+ ResourceArns: (_) => (0, smithy_client_1._json)(_),
306
+ }));
307
307
  return new protocol_http_1.HttpRequest({
308
308
  protocol,
309
309
  hostname,
@@ -323,9 +323,9 @@ const se_UntagCommand = async (input, context) => {
323
323
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resources/{Arn}/tags";
324
324
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Arn", () => input.Arn, "{Arn}", false);
325
325
  let body;
326
- body = JSON.stringify({
327
- ...(input.Keys != null && { Keys: se_TagKeyList(input.Keys, context) }),
328
- });
326
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
327
+ Keys: (_) => (0, smithy_client_1._json)(_),
328
+ }));
329
329
  return new protocol_http_1.HttpRequest({
330
330
  protocol,
331
331
  hostname,
@@ -344,11 +344,9 @@ const se_UpdateAccountSettingsCommand = async (input, context) => {
344
344
  };
345
345
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-account-settings";
346
346
  let body;
347
- body = JSON.stringify({
348
- ...(input.GroupLifecycleEventsDesiredStatus != null && {
349
- GroupLifecycleEventsDesiredStatus: input.GroupLifecycleEventsDesiredStatus,
350
- }),
351
- });
347
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
348
+ GroupLifecycleEventsDesiredStatus: [],
349
+ }));
352
350
  return new protocol_http_1.HttpRequest({
353
351
  protocol,
354
352
  hostname,
@@ -367,11 +365,11 @@ const se_UpdateGroupCommand = async (input, context) => {
367
365
  };
368
366
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-group";
369
367
  let body;
370
- body = JSON.stringify({
371
- ...(input.Description != null && { Description: input.Description }),
372
- ...(input.Group != null && { Group: input.Group }),
373
- ...(input.GroupName != null && { GroupName: input.GroupName }),
374
- });
368
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
369
+ Description: [],
370
+ Group: [],
371
+ GroupName: [],
372
+ }));
375
373
  return new protocol_http_1.HttpRequest({
376
374
  protocol,
377
375
  hostname,
@@ -390,11 +388,11 @@ const se_UpdateGroupQueryCommand = async (input, context) => {
390
388
  };
391
389
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-group-query";
392
390
  let body;
393
- body = JSON.stringify({
394
- ...(input.Group != null && { Group: input.Group }),
395
- ...(input.GroupName != null && { GroupName: input.GroupName }),
396
- ...(input.ResourceQuery != null && { ResourceQuery: se_ResourceQuery(input.ResourceQuery, context) }),
397
- });
391
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
392
+ Group: [],
393
+ GroupName: [],
394
+ ResourceQuery: (_) => (0, smithy_client_1._json)(_),
395
+ }));
398
396
  return new protocol_http_1.HttpRequest({
399
397
  protocol,
400
398
  hostname,
@@ -410,22 +408,17 @@ const de_CreateGroupCommand = async (output, context) => {
410
408
  if (output.statusCode !== 200 && output.statusCode >= 300) {
411
409
  return de_CreateGroupCommandError(output, context);
412
410
  }
413
- const contents = map({
411
+ const contents = (0, smithy_client_1.map)({
414
412
  $metadata: deserializeMetadata(output),
415
413
  });
416
414
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
417
- if (data.Group != null) {
418
- contents.Group = de_Group(data.Group, context);
419
- }
420
- if (data.GroupConfiguration != null) {
421
- contents.GroupConfiguration = de_GroupConfiguration(data.GroupConfiguration, context);
422
- }
423
- if (data.ResourceQuery != null) {
424
- contents.ResourceQuery = de_ResourceQuery(data.ResourceQuery, context);
425
- }
426
- if (data.Tags != null) {
427
- contents.Tags = de_Tags(data.Tags, context);
428
- }
415
+ const doc = (0, smithy_client_1.take)(data, {
416
+ Group: smithy_client_1._json,
417
+ GroupConfiguration: smithy_client_1._json,
418
+ ResourceQuery: smithy_client_1._json,
419
+ Tags: smithy_client_1._json,
420
+ });
421
+ Object.assign(contents, doc);
429
422
  return contents;
430
423
  };
431
424
  exports.de_CreateGroupCommand = de_CreateGroupCommand;
@@ -453,10 +446,9 @@ const de_CreateGroupCommandError = async (output, context) => {
453
446
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
454
447
  default:
455
448
  const parsedBody = parsedOutput.body;
456
- (0, smithy_client_1.throwDefaultError)({
449
+ return throwDefaultError({
457
450
  output,
458
451
  parsedBody,
459
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
460
452
  errorCode,
461
453
  });
462
454
  }
@@ -465,13 +457,14 @@ const de_DeleteGroupCommand = async (output, context) => {
465
457
  if (output.statusCode !== 200 && output.statusCode >= 300) {
466
458
  return de_DeleteGroupCommandError(output, context);
467
459
  }
468
- const contents = map({
460
+ const contents = (0, smithy_client_1.map)({
469
461
  $metadata: deserializeMetadata(output),
470
462
  });
471
463
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
472
- if (data.Group != null) {
473
- contents.Group = de_Group(data.Group, context);
474
- }
464
+ const doc = (0, smithy_client_1.take)(data, {
465
+ Group: smithy_client_1._json,
466
+ });
467
+ Object.assign(contents, doc);
475
468
  return contents;
476
469
  };
477
470
  exports.de_DeleteGroupCommand = de_DeleteGroupCommand;
@@ -502,10 +495,9 @@ const de_DeleteGroupCommandError = async (output, context) => {
502
495
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
503
496
  default:
504
497
  const parsedBody = parsedOutput.body;
505
- (0, smithy_client_1.throwDefaultError)({
498
+ return throwDefaultError({
506
499
  output,
507
500
  parsedBody,
508
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
509
501
  errorCode,
510
502
  });
511
503
  }
@@ -514,13 +506,14 @@ const de_GetAccountSettingsCommand = async (output, context) => {
514
506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
515
507
  return de_GetAccountSettingsCommandError(output, context);
516
508
  }
517
- const contents = map({
509
+ const contents = (0, smithy_client_1.map)({
518
510
  $metadata: deserializeMetadata(output),
519
511
  });
520
512
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
521
- if (data.AccountSettings != null) {
522
- contents.AccountSettings = de_AccountSettings(data.AccountSettings, context);
523
- }
513
+ const doc = (0, smithy_client_1.take)(data, {
514
+ AccountSettings: smithy_client_1._json,
515
+ });
516
+ Object.assign(contents, doc);
524
517
  return contents;
525
518
  };
526
519
  exports.de_GetAccountSettingsCommand = de_GetAccountSettingsCommand;
@@ -548,10 +541,9 @@ const de_GetAccountSettingsCommandError = async (output, context) => {
548
541
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
549
542
  default:
550
543
  const parsedBody = parsedOutput.body;
551
- (0, smithy_client_1.throwDefaultError)({
544
+ return throwDefaultError({
552
545
  output,
553
546
  parsedBody,
554
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
555
547
  errorCode,
556
548
  });
557
549
  }
@@ -560,13 +552,14 @@ const de_GetGroupCommand = async (output, context) => {
560
552
  if (output.statusCode !== 200 && output.statusCode >= 300) {
561
553
  return de_GetGroupCommandError(output, context);
562
554
  }
563
- const contents = map({
555
+ const contents = (0, smithy_client_1.map)({
564
556
  $metadata: deserializeMetadata(output),
565
557
  });
566
558
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
567
- if (data.Group != null) {
568
- contents.Group = de_Group(data.Group, context);
569
- }
559
+ const doc = (0, smithy_client_1.take)(data, {
560
+ Group: smithy_client_1._json,
561
+ });
562
+ Object.assign(contents, doc);
570
563
  return contents;
571
564
  };
572
565
  exports.de_GetGroupCommand = de_GetGroupCommand;
@@ -597,10 +590,9 @@ const de_GetGroupCommandError = async (output, context) => {
597
590
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
598
591
  default:
599
592
  const parsedBody = parsedOutput.body;
600
- (0, smithy_client_1.throwDefaultError)({
593
+ return throwDefaultError({
601
594
  output,
602
595
  parsedBody,
603
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
604
596
  errorCode,
605
597
  });
606
598
  }
@@ -609,13 +601,14 @@ const de_GetGroupConfigurationCommand = async (output, context) => {
609
601
  if (output.statusCode !== 200 && output.statusCode >= 300) {
610
602
  return de_GetGroupConfigurationCommandError(output, context);
611
603
  }
612
- const contents = map({
604
+ const contents = (0, smithy_client_1.map)({
613
605
  $metadata: deserializeMetadata(output),
614
606
  });
615
607
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
616
- if (data.GroupConfiguration != null) {
617
- contents.GroupConfiguration = de_GroupConfiguration(data.GroupConfiguration, context);
618
- }
608
+ const doc = (0, smithy_client_1.take)(data, {
609
+ GroupConfiguration: smithy_client_1._json,
610
+ });
611
+ Object.assign(contents, doc);
619
612
  return contents;
620
613
  };
621
614
  exports.de_GetGroupConfigurationCommand = de_GetGroupConfigurationCommand;
@@ -646,10 +639,9 @@ const de_GetGroupConfigurationCommandError = async (output, context) => {
646
639
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
647
640
  default:
648
641
  const parsedBody = parsedOutput.body;
649
- (0, smithy_client_1.throwDefaultError)({
642
+ return throwDefaultError({
650
643
  output,
651
644
  parsedBody,
652
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
653
645
  errorCode,
654
646
  });
655
647
  }
@@ -658,13 +650,14 @@ const de_GetGroupQueryCommand = async (output, context) => {
658
650
  if (output.statusCode !== 200 && output.statusCode >= 300) {
659
651
  return de_GetGroupQueryCommandError(output, context);
660
652
  }
661
- const contents = map({
653
+ const contents = (0, smithy_client_1.map)({
662
654
  $metadata: deserializeMetadata(output),
663
655
  });
664
656
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
665
- if (data.GroupQuery != null) {
666
- contents.GroupQuery = de_GroupQuery(data.GroupQuery, context);
667
- }
657
+ const doc = (0, smithy_client_1.take)(data, {
658
+ GroupQuery: smithy_client_1._json,
659
+ });
660
+ Object.assign(contents, doc);
668
661
  return contents;
669
662
  };
670
663
  exports.de_GetGroupQueryCommand = de_GetGroupQueryCommand;
@@ -695,10 +688,9 @@ const de_GetGroupQueryCommandError = async (output, context) => {
695
688
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
696
689
  default:
697
690
  const parsedBody = parsedOutput.body;
698
- (0, smithy_client_1.throwDefaultError)({
691
+ return throwDefaultError({
699
692
  output,
700
693
  parsedBody,
701
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
702
694
  errorCode,
703
695
  });
704
696
  }
@@ -707,16 +699,15 @@ const de_GetTagsCommand = async (output, context) => {
707
699
  if (output.statusCode !== 200 && output.statusCode >= 300) {
708
700
  return de_GetTagsCommandError(output, context);
709
701
  }
710
- const contents = map({
702
+ const contents = (0, smithy_client_1.map)({
711
703
  $metadata: deserializeMetadata(output),
712
704
  });
713
705
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
714
- if (data.Arn != null) {
715
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
716
- }
717
- if (data.Tags != null) {
718
- contents.Tags = de_Tags(data.Tags, context);
719
- }
706
+ const doc = (0, smithy_client_1.take)(data, {
707
+ Arn: smithy_client_1.expectString,
708
+ Tags: smithy_client_1._json,
709
+ });
710
+ Object.assign(contents, doc);
720
711
  return contents;
721
712
  };
722
713
  exports.de_GetTagsCommand = de_GetTagsCommand;
@@ -747,10 +738,9 @@ const de_GetTagsCommandError = async (output, context) => {
747
738
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
748
739
  default:
749
740
  const parsedBody = parsedOutput.body;
750
- (0, smithy_client_1.throwDefaultError)({
741
+ return throwDefaultError({
751
742
  output,
752
743
  parsedBody,
753
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
754
744
  errorCode,
755
745
  });
756
746
  }
@@ -759,19 +749,16 @@ const de_GroupResourcesCommand = async (output, context) => {
759
749
  if (output.statusCode !== 200 && output.statusCode >= 300) {
760
750
  return de_GroupResourcesCommandError(output, context);
761
751
  }
762
- const contents = map({
752
+ const contents = (0, smithy_client_1.map)({
763
753
  $metadata: deserializeMetadata(output),
764
754
  });
765
755
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
766
- if (data.Failed != null) {
767
- contents.Failed = de_FailedResourceList(data.Failed, context);
768
- }
769
- if (data.Pending != null) {
770
- contents.Pending = de_PendingResourceList(data.Pending, context);
771
- }
772
- if (data.Succeeded != null) {
773
- contents.Succeeded = de_ResourceArnList(data.Succeeded, context);
774
- }
756
+ const doc = (0, smithy_client_1.take)(data, {
757
+ Failed: smithy_client_1._json,
758
+ Pending: smithy_client_1._json,
759
+ Succeeded: smithy_client_1._json,
760
+ });
761
+ Object.assign(contents, doc);
775
762
  return contents;
776
763
  };
777
764
  exports.de_GroupResourcesCommand = de_GroupResourcesCommand;
@@ -802,10 +789,9 @@ const de_GroupResourcesCommandError = async (output, context) => {
802
789
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
803
790
  default:
804
791
  const parsedBody = parsedOutput.body;
805
- (0, smithy_client_1.throwDefaultError)({
792
+ return throwDefaultError({
806
793
  output,
807
794
  parsedBody,
808
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
809
795
  errorCode,
810
796
  });
811
797
  }
@@ -814,22 +800,17 @@ const de_ListGroupResourcesCommand = async (output, context) => {
814
800
  if (output.statusCode !== 200 && output.statusCode >= 300) {
815
801
  return de_ListGroupResourcesCommandError(output, context);
816
802
  }
817
- const contents = map({
803
+ const contents = (0, smithy_client_1.map)({
818
804
  $metadata: deserializeMetadata(output),
819
805
  });
820
806
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
821
- if (data.NextToken != null) {
822
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
823
- }
824
- if (data.QueryErrors != null) {
825
- contents.QueryErrors = de_QueryErrorList(data.QueryErrors, context);
826
- }
827
- if (data.ResourceIdentifiers != null) {
828
- contents.ResourceIdentifiers = de_ResourceIdentifierList(data.ResourceIdentifiers, context);
829
- }
830
- if (data.Resources != null) {
831
- contents.Resources = de_ListGroupResourcesItemList(data.Resources, context);
832
- }
807
+ const doc = (0, smithy_client_1.take)(data, {
808
+ NextToken: smithy_client_1.expectString,
809
+ QueryErrors: smithy_client_1._json,
810
+ ResourceIdentifiers: smithy_client_1._json,
811
+ Resources: smithy_client_1._json,
812
+ });
813
+ Object.assign(contents, doc);
833
814
  return contents;
834
815
  };
835
816
  exports.de_ListGroupResourcesCommand = de_ListGroupResourcesCommand;
@@ -863,10 +844,9 @@ const de_ListGroupResourcesCommandError = async (output, context) => {
863
844
  throw await de_UnauthorizedExceptionRes(parsedOutput, context);
864
845
  default:
865
846
  const parsedBody = parsedOutput.body;
866
- (0, smithy_client_1.throwDefaultError)({
847
+ return throwDefaultError({
867
848
  output,
868
849
  parsedBody,
869
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
870
850
  errorCode,
871
851
  });
872
852
  }
@@ -875,19 +855,16 @@ const de_ListGroupsCommand = async (output, context) => {
875
855
  if (output.statusCode !== 200 && output.statusCode >= 300) {
876
856
  return de_ListGroupsCommandError(output, context);
877
857
  }
878
- const contents = map({
858
+ const contents = (0, smithy_client_1.map)({
879
859
  $metadata: deserializeMetadata(output),
880
860
  });
881
861
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
882
- if (data.GroupIdentifiers != null) {
883
- contents.GroupIdentifiers = de_GroupIdentifierList(data.GroupIdentifiers, context);
884
- }
885
- if (data.Groups != null) {
886
- contents.Groups = de_GroupList(data.Groups, context);
887
- }
888
- if (data.NextToken != null) {
889
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
890
- }
862
+ const doc = (0, smithy_client_1.take)(data, {
863
+ GroupIdentifiers: smithy_client_1._json,
864
+ Groups: smithy_client_1._json,
865
+ NextToken: smithy_client_1.expectString,
866
+ });
867
+ Object.assign(contents, doc);
891
868
  return contents;
892
869
  };
893
870
  exports.de_ListGroupsCommand = de_ListGroupsCommand;
@@ -915,10 +892,9 @@ const de_ListGroupsCommandError = async (output, context) => {
915
892
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
916
893
  default:
917
894
  const parsedBody = parsedOutput.body;
918
- (0, smithy_client_1.throwDefaultError)({
895
+ return throwDefaultError({
919
896
  output,
920
897
  parsedBody,
921
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
922
898
  errorCode,
923
899
  });
924
900
  }
@@ -927,7 +903,7 @@ const de_PutGroupConfigurationCommand = async (output, context) => {
927
903
  if (output.statusCode !== 202 && output.statusCode >= 300) {
928
904
  return de_PutGroupConfigurationCommandError(output, context);
929
905
  }
930
- const contents = map({
906
+ const contents = (0, smithy_client_1.map)({
931
907
  $metadata: deserializeMetadata(output),
932
908
  });
933
909
  await collectBody(output.body, context);
@@ -961,10 +937,9 @@ const de_PutGroupConfigurationCommandError = async (output, context) => {
961
937
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
962
938
  default:
963
939
  const parsedBody = parsedOutput.body;
964
- (0, smithy_client_1.throwDefaultError)({
940
+ return throwDefaultError({
965
941
  output,
966
942
  parsedBody,
967
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
968
943
  errorCode,
969
944
  });
970
945
  }
@@ -973,19 +948,16 @@ const de_SearchResourcesCommand = async (output, context) => {
973
948
  if (output.statusCode !== 200 && output.statusCode >= 300) {
974
949
  return de_SearchResourcesCommandError(output, context);
975
950
  }
976
- const contents = map({
951
+ const contents = (0, smithy_client_1.map)({
977
952
  $metadata: deserializeMetadata(output),
978
953
  });
979
954
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
980
- if (data.NextToken != null) {
981
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
982
- }
983
- if (data.QueryErrors != null) {
984
- contents.QueryErrors = de_QueryErrorList(data.QueryErrors, context);
985
- }
986
- if (data.ResourceIdentifiers != null) {
987
- contents.ResourceIdentifiers = de_ResourceIdentifierList(data.ResourceIdentifiers, context);
988
- }
955
+ const doc = (0, smithy_client_1.take)(data, {
956
+ NextToken: smithy_client_1.expectString,
957
+ QueryErrors: smithy_client_1._json,
958
+ ResourceIdentifiers: smithy_client_1._json,
959
+ });
960
+ Object.assign(contents, doc);
989
961
  return contents;
990
962
  };
991
963
  exports.de_SearchResourcesCommand = de_SearchResourcesCommand;
@@ -1016,10 +988,9 @@ const de_SearchResourcesCommandError = async (output, context) => {
1016
988
  throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1017
989
  default:
1018
990
  const parsedBody = parsedOutput.body;
1019
- (0, smithy_client_1.throwDefaultError)({
991
+ return throwDefaultError({
1020
992
  output,
1021
993
  parsedBody,
1022
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1023
994
  errorCode,
1024
995
  });
1025
996
  }
@@ -1028,16 +999,15 @@ const de_TagCommand = async (output, context) => {
1028
999
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1029
1000
  return de_TagCommandError(output, context);
1030
1001
  }
1031
- const contents = map({
1002
+ const contents = (0, smithy_client_1.map)({
1032
1003
  $metadata: deserializeMetadata(output),
1033
1004
  });
1034
1005
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1035
- if (data.Arn != null) {
1036
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1037
- }
1038
- if (data.Tags != null) {
1039
- contents.Tags = de_Tags(data.Tags, context);
1040
- }
1006
+ const doc = (0, smithy_client_1.take)(data, {
1007
+ Arn: smithy_client_1.expectString,
1008
+ Tags: smithy_client_1._json,
1009
+ });
1010
+ Object.assign(contents, doc);
1041
1011
  return contents;
1042
1012
  };
1043
1013
  exports.de_TagCommand = de_TagCommand;
@@ -1068,10 +1038,9 @@ const de_TagCommandError = async (output, context) => {
1068
1038
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1069
1039
  default:
1070
1040
  const parsedBody = parsedOutput.body;
1071
- (0, smithy_client_1.throwDefaultError)({
1041
+ return throwDefaultError({
1072
1042
  output,
1073
1043
  parsedBody,
1074
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1075
1044
  errorCode,
1076
1045
  });
1077
1046
  }
@@ -1080,19 +1049,16 @@ const de_UngroupResourcesCommand = async (output, context) => {
1080
1049
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1081
1050
  return de_UngroupResourcesCommandError(output, context);
1082
1051
  }
1083
- const contents = map({
1052
+ const contents = (0, smithy_client_1.map)({
1084
1053
  $metadata: deserializeMetadata(output),
1085
1054
  });
1086
1055
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1087
- if (data.Failed != null) {
1088
- contents.Failed = de_FailedResourceList(data.Failed, context);
1089
- }
1090
- if (data.Pending != null) {
1091
- contents.Pending = de_PendingResourceList(data.Pending, context);
1092
- }
1093
- if (data.Succeeded != null) {
1094
- contents.Succeeded = de_ResourceArnList(data.Succeeded, context);
1095
- }
1056
+ const doc = (0, smithy_client_1.take)(data, {
1057
+ Failed: smithy_client_1._json,
1058
+ Pending: smithy_client_1._json,
1059
+ Succeeded: smithy_client_1._json,
1060
+ });
1061
+ Object.assign(contents, doc);
1096
1062
  return contents;
1097
1063
  };
1098
1064
  exports.de_UngroupResourcesCommand = de_UngroupResourcesCommand;
@@ -1123,10 +1089,9 @@ const de_UngroupResourcesCommandError = async (output, context) => {
1123
1089
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1124
1090
  default:
1125
1091
  const parsedBody = parsedOutput.body;
1126
- (0, smithy_client_1.throwDefaultError)({
1092
+ return throwDefaultError({
1127
1093
  output,
1128
1094
  parsedBody,
1129
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1130
1095
  errorCode,
1131
1096
  });
1132
1097
  }
@@ -1135,16 +1100,15 @@ const de_UntagCommand = async (output, context) => {
1135
1100
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1136
1101
  return de_UntagCommandError(output, context);
1137
1102
  }
1138
- const contents = map({
1103
+ const contents = (0, smithy_client_1.map)({
1139
1104
  $metadata: deserializeMetadata(output),
1140
1105
  });
1141
1106
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1142
- if (data.Arn != null) {
1143
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1144
- }
1145
- if (data.Keys != null) {
1146
- contents.Keys = de_TagKeyList(data.Keys, context);
1147
- }
1107
+ const doc = (0, smithy_client_1.take)(data, {
1108
+ Arn: smithy_client_1.expectString,
1109
+ Keys: smithy_client_1._json,
1110
+ });
1111
+ Object.assign(contents, doc);
1148
1112
  return contents;
1149
1113
  };
1150
1114
  exports.de_UntagCommand = de_UntagCommand;
@@ -1175,10 +1139,9 @@ const de_UntagCommandError = async (output, context) => {
1175
1139
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1176
1140
  default:
1177
1141
  const parsedBody = parsedOutput.body;
1178
- (0, smithy_client_1.throwDefaultError)({
1142
+ return throwDefaultError({
1179
1143
  output,
1180
1144
  parsedBody,
1181
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1182
1145
  errorCode,
1183
1146
  });
1184
1147
  }
@@ -1187,13 +1150,14 @@ const de_UpdateAccountSettingsCommand = async (output, context) => {
1187
1150
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1188
1151
  return de_UpdateAccountSettingsCommandError(output, context);
1189
1152
  }
1190
- const contents = map({
1153
+ const contents = (0, smithy_client_1.map)({
1191
1154
  $metadata: deserializeMetadata(output),
1192
1155
  });
1193
1156
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1194
- if (data.AccountSettings != null) {
1195
- contents.AccountSettings = de_AccountSettings(data.AccountSettings, context);
1196
- }
1157
+ const doc = (0, smithy_client_1.take)(data, {
1158
+ AccountSettings: smithy_client_1._json,
1159
+ });
1160
+ Object.assign(contents, doc);
1197
1161
  return contents;
1198
1162
  };
1199
1163
  exports.de_UpdateAccountSettingsCommand = de_UpdateAccountSettingsCommand;
@@ -1221,10 +1185,9 @@ const de_UpdateAccountSettingsCommandError = async (output, context) => {
1221
1185
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1222
1186
  default:
1223
1187
  const parsedBody = parsedOutput.body;
1224
- (0, smithy_client_1.throwDefaultError)({
1188
+ return throwDefaultError({
1225
1189
  output,
1226
1190
  parsedBody,
1227
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1228
1191
  errorCode,
1229
1192
  });
1230
1193
  }
@@ -1233,13 +1196,14 @@ const de_UpdateGroupCommand = async (output, context) => {
1233
1196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1234
1197
  return de_UpdateGroupCommandError(output, context);
1235
1198
  }
1236
- const contents = map({
1199
+ const contents = (0, smithy_client_1.map)({
1237
1200
  $metadata: deserializeMetadata(output),
1238
1201
  });
1239
1202
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1240
- if (data.Group != null) {
1241
- contents.Group = de_Group(data.Group, context);
1242
- }
1203
+ const doc = (0, smithy_client_1.take)(data, {
1204
+ Group: smithy_client_1._json,
1205
+ });
1206
+ Object.assign(contents, doc);
1243
1207
  return contents;
1244
1208
  };
1245
1209
  exports.de_UpdateGroupCommand = de_UpdateGroupCommand;
@@ -1270,10 +1234,9 @@ const de_UpdateGroupCommandError = async (output, context) => {
1270
1234
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1271
1235
  default:
1272
1236
  const parsedBody = parsedOutput.body;
1273
- (0, smithy_client_1.throwDefaultError)({
1237
+ return throwDefaultError({
1274
1238
  output,
1275
1239
  parsedBody,
1276
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1277
1240
  errorCode,
1278
1241
  });
1279
1242
  }
@@ -1282,13 +1245,14 @@ const de_UpdateGroupQueryCommand = async (output, context) => {
1282
1245
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1283
1246
  return de_UpdateGroupQueryCommandError(output, context);
1284
1247
  }
1285
- const contents = map({
1248
+ const contents = (0, smithy_client_1.map)({
1286
1249
  $metadata: deserializeMetadata(output),
1287
1250
  });
1288
1251
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1289
- if (data.GroupQuery != null) {
1290
- contents.GroupQuery = de_GroupQuery(data.GroupQuery, context);
1291
- }
1252
+ const doc = (0, smithy_client_1.take)(data, {
1253
+ GroupQuery: smithy_client_1._json,
1254
+ });
1255
+ Object.assign(contents, doc);
1292
1256
  return contents;
1293
1257
  };
1294
1258
  exports.de_UpdateGroupQueryCommand = de_UpdateGroupQueryCommand;
@@ -1319,21 +1283,21 @@ const de_UpdateGroupQueryCommandError = async (output, context) => {
1319
1283
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1320
1284
  default:
1321
1285
  const parsedBody = parsedOutput.body;
1322
- (0, smithy_client_1.throwDefaultError)({
1286
+ return throwDefaultError({
1323
1287
  output,
1324
1288
  parsedBody,
1325
- exceptionCtor: ResourceGroupsServiceException_1.ResourceGroupsServiceException,
1326
1289
  errorCode,
1327
1290
  });
1328
1291
  }
1329
1292
  };
1330
- const map = smithy_client_1.map;
1293
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(ResourceGroupsServiceException_1.ResourceGroupsServiceException);
1331
1294
  const de_BadRequestExceptionRes = async (parsedOutput, context) => {
1332
- const contents = map({});
1295
+ const contents = (0, smithy_client_1.map)({});
1333
1296
  const data = parsedOutput.body;
1334
- if (data.Message != null) {
1335
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1336
- }
1297
+ const doc = (0, smithy_client_1.take)(data, {
1298
+ Message: smithy_client_1.expectString,
1299
+ });
1300
+ Object.assign(contents, doc);
1337
1301
  const exception = new models_0_1.BadRequestException({
1338
1302
  $metadata: deserializeMetadata(parsedOutput),
1339
1303
  ...contents,
@@ -1341,11 +1305,12 @@ const de_BadRequestExceptionRes = async (parsedOutput, context) => {
1341
1305
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1342
1306
  };
1343
1307
  const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
1344
- const contents = map({});
1308
+ const contents = (0, smithy_client_1.map)({});
1345
1309
  const data = parsedOutput.body;
1346
- if (data.Message != null) {
1347
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1348
- }
1310
+ const doc = (0, smithy_client_1.take)(data, {
1311
+ Message: smithy_client_1.expectString,
1312
+ });
1313
+ Object.assign(contents, doc);
1349
1314
  const exception = new models_0_1.ForbiddenException({
1350
1315
  $metadata: deserializeMetadata(parsedOutput),
1351
1316
  ...contents,
@@ -1353,11 +1318,12 @@ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
1353
1318
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1354
1319
  };
1355
1320
  const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
1356
- const contents = map({});
1321
+ const contents = (0, smithy_client_1.map)({});
1357
1322
  const data = parsedOutput.body;
1358
- if (data.Message != null) {
1359
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1360
- }
1323
+ const doc = (0, smithy_client_1.take)(data, {
1324
+ Message: smithy_client_1.expectString,
1325
+ });
1326
+ Object.assign(contents, doc);
1361
1327
  const exception = new models_0_1.InternalServerErrorException({
1362
1328
  $metadata: deserializeMetadata(parsedOutput),
1363
1329
  ...contents,
@@ -1365,11 +1331,12 @@ const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
1365
1331
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1366
1332
  };
1367
1333
  const de_MethodNotAllowedExceptionRes = async (parsedOutput, context) => {
1368
- const contents = map({});
1334
+ const contents = (0, smithy_client_1.map)({});
1369
1335
  const data = parsedOutput.body;
1370
- if (data.Message != null) {
1371
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1372
- }
1336
+ const doc = (0, smithy_client_1.take)(data, {
1337
+ Message: smithy_client_1.expectString,
1338
+ });
1339
+ Object.assign(contents, doc);
1373
1340
  const exception = new models_0_1.MethodNotAllowedException({
1374
1341
  $metadata: deserializeMetadata(parsedOutput),
1375
1342
  ...contents,
@@ -1377,11 +1344,12 @@ const de_MethodNotAllowedExceptionRes = async (parsedOutput, context) => {
1377
1344
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1378
1345
  };
1379
1346
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
1380
- const contents = map({});
1347
+ const contents = (0, smithy_client_1.map)({});
1381
1348
  const data = parsedOutput.body;
1382
- if (data.Message != null) {
1383
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1384
- }
1349
+ const doc = (0, smithy_client_1.take)(data, {
1350
+ Message: smithy_client_1.expectString,
1351
+ });
1352
+ Object.assign(contents, doc);
1385
1353
  const exception = new models_0_1.NotFoundException({
1386
1354
  $metadata: deserializeMetadata(parsedOutput),
1387
1355
  ...contents,
@@ -1389,11 +1357,12 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
1389
1357
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1390
1358
  };
1391
1359
  const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1392
- const contents = map({});
1360
+ const contents = (0, smithy_client_1.map)({});
1393
1361
  const data = parsedOutput.body;
1394
- if (data.Message != null) {
1395
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1396
- }
1362
+ const doc = (0, smithy_client_1.take)(data, {
1363
+ Message: smithy_client_1.expectString,
1364
+ });
1365
+ Object.assign(contents, doc);
1397
1366
  const exception = new models_0_1.TooManyRequestsException({
1398
1367
  $metadata: deserializeMetadata(parsedOutput),
1399
1368
  ...contents,
@@ -1401,349 +1370,18 @@ const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1401
1370
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1402
1371
  };
1403
1372
  const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
1404
- const contents = map({});
1373
+ const contents = (0, smithy_client_1.map)({});
1405
1374
  const data = parsedOutput.body;
1406
- if (data.Message != null) {
1407
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1408
- }
1375
+ const doc = (0, smithy_client_1.take)(data, {
1376
+ Message: smithy_client_1.expectString,
1377
+ });
1378
+ Object.assign(contents, doc);
1409
1379
  const exception = new models_0_1.UnauthorizedException({
1410
1380
  $metadata: deserializeMetadata(parsedOutput),
1411
1381
  ...contents,
1412
1382
  });
1413
1383
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1414
1384
  };
1415
- const se_GroupConfigurationItem = (input, context) => {
1416
- return {
1417
- ...(input.Parameters != null && { Parameters: se_GroupParameterList(input.Parameters, context) }),
1418
- ...(input.Type != null && { Type: input.Type }),
1419
- };
1420
- };
1421
- const se_GroupConfigurationList = (input, context) => {
1422
- return input
1423
- .filter((e) => e != null)
1424
- .map((entry) => {
1425
- return se_GroupConfigurationItem(entry, context);
1426
- });
1427
- };
1428
- const se_GroupConfigurationParameter = (input, context) => {
1429
- return {
1430
- ...(input.Name != null && { Name: input.Name }),
1431
- ...(input.Values != null && { Values: se_GroupConfigurationParameterValueList(input.Values, context) }),
1432
- };
1433
- };
1434
- const se_GroupConfigurationParameterValueList = (input, context) => {
1435
- return input
1436
- .filter((e) => e != null)
1437
- .map((entry) => {
1438
- return entry;
1439
- });
1440
- };
1441
- const se_GroupFilter = (input, context) => {
1442
- return {
1443
- ...(input.Name != null && { Name: input.Name }),
1444
- ...(input.Values != null && { Values: se_GroupFilterValues(input.Values, context) }),
1445
- };
1446
- };
1447
- const se_GroupFilterList = (input, context) => {
1448
- return input
1449
- .filter((e) => e != null)
1450
- .map((entry) => {
1451
- return se_GroupFilter(entry, context);
1452
- });
1453
- };
1454
- const se_GroupFilterValues = (input, context) => {
1455
- return input
1456
- .filter((e) => e != null)
1457
- .map((entry) => {
1458
- return entry;
1459
- });
1460
- };
1461
- const se_GroupParameterList = (input, context) => {
1462
- return input
1463
- .filter((e) => e != null)
1464
- .map((entry) => {
1465
- return se_GroupConfigurationParameter(entry, context);
1466
- });
1467
- };
1468
- const se_ResourceArnList = (input, context) => {
1469
- return input
1470
- .filter((e) => e != null)
1471
- .map((entry) => {
1472
- return entry;
1473
- });
1474
- };
1475
- const se_ResourceFilter = (input, context) => {
1476
- return {
1477
- ...(input.Name != null && { Name: input.Name }),
1478
- ...(input.Values != null && { Values: se_ResourceFilterValues(input.Values, context) }),
1479
- };
1480
- };
1481
- const se_ResourceFilterList = (input, context) => {
1482
- return input
1483
- .filter((e) => e != null)
1484
- .map((entry) => {
1485
- return se_ResourceFilter(entry, context);
1486
- });
1487
- };
1488
- const se_ResourceFilterValues = (input, context) => {
1489
- return input
1490
- .filter((e) => e != null)
1491
- .map((entry) => {
1492
- return entry;
1493
- });
1494
- };
1495
- const se_ResourceQuery = (input, context) => {
1496
- return {
1497
- ...(input.Query != null && { Query: input.Query }),
1498
- ...(input.Type != null && { Type: input.Type }),
1499
- };
1500
- };
1501
- const se_TagKeyList = (input, context) => {
1502
- return input
1503
- .filter((e) => e != null)
1504
- .map((entry) => {
1505
- return entry;
1506
- });
1507
- };
1508
- const se_Tags = (input, context) => {
1509
- return Object.entries(input).reduce((acc, [key, value]) => {
1510
- if (value === null) {
1511
- return acc;
1512
- }
1513
- acc[key] = value;
1514
- return acc;
1515
- }, {});
1516
- };
1517
- const de_AccountSettings = (output, context) => {
1518
- return {
1519
- GroupLifecycleEventsDesiredStatus: (0, smithy_client_1.expectString)(output.GroupLifecycleEventsDesiredStatus),
1520
- GroupLifecycleEventsStatus: (0, smithy_client_1.expectString)(output.GroupLifecycleEventsStatus),
1521
- GroupLifecycleEventsStatusMessage: (0, smithy_client_1.expectString)(output.GroupLifecycleEventsStatusMessage),
1522
- };
1523
- };
1524
- const de_FailedResource = (output, context) => {
1525
- return {
1526
- ErrorCode: (0, smithy_client_1.expectString)(output.ErrorCode),
1527
- ErrorMessage: (0, smithy_client_1.expectString)(output.ErrorMessage),
1528
- ResourceArn: (0, smithy_client_1.expectString)(output.ResourceArn),
1529
- };
1530
- };
1531
- const de_FailedResourceList = (output, context) => {
1532
- const retVal = (output || [])
1533
- .filter((e) => e != null)
1534
- .map((entry) => {
1535
- if (entry === null) {
1536
- return null;
1537
- }
1538
- return de_FailedResource(entry, context);
1539
- });
1540
- return retVal;
1541
- };
1542
- const de_Group = (output, context) => {
1543
- return {
1544
- Description: (0, smithy_client_1.expectString)(output.Description),
1545
- GroupArn: (0, smithy_client_1.expectString)(output.GroupArn),
1546
- Name: (0, smithy_client_1.expectString)(output.Name),
1547
- };
1548
- };
1549
- const de_GroupConfiguration = (output, context) => {
1550
- return {
1551
- Configuration: output.Configuration != null ? de_GroupConfigurationList(output.Configuration, context) : undefined,
1552
- FailureReason: (0, smithy_client_1.expectString)(output.FailureReason),
1553
- ProposedConfiguration: output.ProposedConfiguration != null
1554
- ? de_GroupConfigurationList(output.ProposedConfiguration, context)
1555
- : undefined,
1556
- Status: (0, smithy_client_1.expectString)(output.Status),
1557
- };
1558
- };
1559
- const de_GroupConfigurationItem = (output, context) => {
1560
- return {
1561
- Parameters: output.Parameters != null ? de_GroupParameterList(output.Parameters, context) : undefined,
1562
- Type: (0, smithy_client_1.expectString)(output.Type),
1563
- };
1564
- };
1565
- const de_GroupConfigurationList = (output, context) => {
1566
- const retVal = (output || [])
1567
- .filter((e) => e != null)
1568
- .map((entry) => {
1569
- if (entry === null) {
1570
- return null;
1571
- }
1572
- return de_GroupConfigurationItem(entry, context);
1573
- });
1574
- return retVal;
1575
- };
1576
- const de_GroupConfigurationParameter = (output, context) => {
1577
- return {
1578
- Name: (0, smithy_client_1.expectString)(output.Name),
1579
- Values: output.Values != null ? de_GroupConfigurationParameterValueList(output.Values, context) : undefined,
1580
- };
1581
- };
1582
- const de_GroupConfigurationParameterValueList = (output, context) => {
1583
- const retVal = (output || [])
1584
- .filter((e) => e != null)
1585
- .map((entry) => {
1586
- if (entry === null) {
1587
- return null;
1588
- }
1589
- return (0, smithy_client_1.expectString)(entry);
1590
- });
1591
- return retVal;
1592
- };
1593
- const de_GroupIdentifier = (output, context) => {
1594
- return {
1595
- GroupArn: (0, smithy_client_1.expectString)(output.GroupArn),
1596
- GroupName: (0, smithy_client_1.expectString)(output.GroupName),
1597
- };
1598
- };
1599
- const de_GroupIdentifierList = (output, context) => {
1600
- const retVal = (output || [])
1601
- .filter((e) => e != null)
1602
- .map((entry) => {
1603
- if (entry === null) {
1604
- return null;
1605
- }
1606
- return de_GroupIdentifier(entry, context);
1607
- });
1608
- return retVal;
1609
- };
1610
- const de_GroupList = (output, context) => {
1611
- const retVal = (output || [])
1612
- .filter((e) => e != null)
1613
- .map((entry) => {
1614
- if (entry === null) {
1615
- return null;
1616
- }
1617
- return de_Group(entry, context);
1618
- });
1619
- return retVal;
1620
- };
1621
- const de_GroupParameterList = (output, context) => {
1622
- const retVal = (output || [])
1623
- .filter((e) => e != null)
1624
- .map((entry) => {
1625
- if (entry === null) {
1626
- return null;
1627
- }
1628
- return de_GroupConfigurationParameter(entry, context);
1629
- });
1630
- return retVal;
1631
- };
1632
- const de_GroupQuery = (output, context) => {
1633
- return {
1634
- GroupName: (0, smithy_client_1.expectString)(output.GroupName),
1635
- ResourceQuery: output.ResourceQuery != null ? de_ResourceQuery(output.ResourceQuery, context) : undefined,
1636
- };
1637
- };
1638
- const de_ListGroupResourcesItem = (output, context) => {
1639
- return {
1640
- Identifier: output.Identifier != null ? de_ResourceIdentifier(output.Identifier, context) : undefined,
1641
- Status: output.Status != null ? de_ResourceStatus(output.Status, context) : undefined,
1642
- };
1643
- };
1644
- const de_ListGroupResourcesItemList = (output, context) => {
1645
- const retVal = (output || [])
1646
- .filter((e) => e != null)
1647
- .map((entry) => {
1648
- if (entry === null) {
1649
- return null;
1650
- }
1651
- return de_ListGroupResourcesItem(entry, context);
1652
- });
1653
- return retVal;
1654
- };
1655
- const de_PendingResource = (output, context) => {
1656
- return {
1657
- ResourceArn: (0, smithy_client_1.expectString)(output.ResourceArn),
1658
- };
1659
- };
1660
- const de_PendingResourceList = (output, context) => {
1661
- const retVal = (output || [])
1662
- .filter((e) => e != null)
1663
- .map((entry) => {
1664
- if (entry === null) {
1665
- return null;
1666
- }
1667
- return de_PendingResource(entry, context);
1668
- });
1669
- return retVal;
1670
- };
1671
- const de_QueryError = (output, context) => {
1672
- return {
1673
- ErrorCode: (0, smithy_client_1.expectString)(output.ErrorCode),
1674
- Message: (0, smithy_client_1.expectString)(output.Message),
1675
- };
1676
- };
1677
- const de_QueryErrorList = (output, context) => {
1678
- const retVal = (output || [])
1679
- .filter((e) => e != null)
1680
- .map((entry) => {
1681
- if (entry === null) {
1682
- return null;
1683
- }
1684
- return de_QueryError(entry, context);
1685
- });
1686
- return retVal;
1687
- };
1688
- const de_ResourceArnList = (output, context) => {
1689
- const retVal = (output || [])
1690
- .filter((e) => e != null)
1691
- .map((entry) => {
1692
- if (entry === null) {
1693
- return null;
1694
- }
1695
- return (0, smithy_client_1.expectString)(entry);
1696
- });
1697
- return retVal;
1698
- };
1699
- const de_ResourceIdentifier = (output, context) => {
1700
- return {
1701
- ResourceArn: (0, smithy_client_1.expectString)(output.ResourceArn),
1702
- ResourceType: (0, smithy_client_1.expectString)(output.ResourceType),
1703
- };
1704
- };
1705
- const de_ResourceIdentifierList = (output, context) => {
1706
- const retVal = (output || [])
1707
- .filter((e) => e != null)
1708
- .map((entry) => {
1709
- if (entry === null) {
1710
- return null;
1711
- }
1712
- return de_ResourceIdentifier(entry, context);
1713
- });
1714
- return retVal;
1715
- };
1716
- const de_ResourceQuery = (output, context) => {
1717
- return {
1718
- Query: (0, smithy_client_1.expectString)(output.Query),
1719
- Type: (0, smithy_client_1.expectString)(output.Type),
1720
- };
1721
- };
1722
- const de_ResourceStatus = (output, context) => {
1723
- return {
1724
- Name: (0, smithy_client_1.expectString)(output.Name),
1725
- };
1726
- };
1727
- const de_TagKeyList = (output, context) => {
1728
- const retVal = (output || [])
1729
- .filter((e) => e != null)
1730
- .map((entry) => {
1731
- if (entry === null) {
1732
- return null;
1733
- }
1734
- return (0, smithy_client_1.expectString)(entry);
1735
- });
1736
- return retVal;
1737
- };
1738
- const de_Tags = (output, context) => {
1739
- return Object.entries(output).reduce((acc, [key, value]) => {
1740
- if (value === null) {
1741
- return acc;
1742
- }
1743
- acc[key] = (0, smithy_client_1.expectString)(value);
1744
- return acc;
1745
- }, {});
1746
- };
1747
1385
  const deserializeMetadata = (output) => ({
1748
1386
  httpStatusCode: output.statusCode,
1749
1387
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],