@aws-sdk/client-license-manager-user-subscriptions 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.
@@ -1,7 +1,7 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { LicenseManagerUserSubscriptionsServiceException as __BaseException } from "../models/LicenseManagerUserSubscriptionsServiceException";
4
- import { AccessDeniedException, ConflictException, IdentityProvider, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
4
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
5
  export const se_AssociateUserCommand = async (input, context) => {
6
6
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
7
  const headers = {
@@ -9,12 +9,12 @@ export const se_AssociateUserCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/AssociateUser";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.Domain != null && { Domain: input.Domain }),
14
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
15
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
16
- ...(input.Username != null && { Username: input.Username }),
17
- });
12
+ body = JSON.stringify(take(input, {
13
+ Domain: [],
14
+ IdentityProvider: (_) => _json(_),
15
+ InstanceId: [],
16
+ Username: [],
17
+ }));
18
18
  return new __HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -33,10 +33,10 @@ export const se_DeregisterIdentityProviderCommand = async (input, context) => {
33
33
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
34
34
  "/identity-provider/DeregisterIdentityProvider";
35
35
  let body;
36
- body = JSON.stringify({
37
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
38
- ...(input.Product != null && { Product: input.Product }),
39
- });
36
+ body = JSON.stringify(take(input, {
37
+ IdentityProvider: (_) => _json(_),
38
+ Product: [],
39
+ }));
40
40
  return new __HttpRequest({
41
41
  protocol,
42
42
  hostname,
@@ -54,12 +54,12 @@ export const se_DisassociateUserCommand = async (input, context) => {
54
54
  };
55
55
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/DisassociateUser";
56
56
  let body;
57
- body = JSON.stringify({
58
- ...(input.Domain != null && { Domain: input.Domain }),
59
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
60
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
61
- ...(input.Username != null && { Username: input.Username }),
62
- });
57
+ body = JSON.stringify(take(input, {
58
+ Domain: [],
59
+ IdentityProvider: (_) => _json(_),
60
+ InstanceId: [],
61
+ Username: [],
62
+ }));
63
63
  return new __HttpRequest({
64
64
  protocol,
65
65
  hostname,
@@ -77,10 +77,10 @@ export const se_ListIdentityProvidersCommand = async (input, context) => {
77
77
  };
78
78
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identity-provider/ListIdentityProviders";
79
79
  let body;
80
- body = JSON.stringify({
81
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
82
- ...(input.NextToken != null && { NextToken: input.NextToken }),
83
- });
80
+ body = JSON.stringify(take(input, {
81
+ MaxResults: [],
82
+ NextToken: [],
83
+ }));
84
84
  return new __HttpRequest({
85
85
  protocol,
86
86
  hostname,
@@ -98,11 +98,11 @@ export const se_ListInstancesCommand = async (input, context) => {
98
98
  };
99
99
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/instance/ListInstances";
100
100
  let body;
101
- body = JSON.stringify({
102
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
103
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
104
- ...(input.NextToken != null && { NextToken: input.NextToken }),
105
- });
101
+ body = JSON.stringify(take(input, {
102
+ Filters: (_) => _json(_),
103
+ MaxResults: [],
104
+ NextToken: [],
105
+ }));
106
106
  return new __HttpRequest({
107
107
  protocol,
108
108
  hostname,
@@ -120,13 +120,13 @@ export const se_ListProductSubscriptionsCommand = async (input, context) => {
120
120
  };
121
121
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/ListProductSubscriptions";
122
122
  let body;
123
- body = JSON.stringify({
124
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
125
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
126
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
127
- ...(input.NextToken != null && { NextToken: input.NextToken }),
128
- ...(input.Product != null && { Product: input.Product }),
129
- });
123
+ body = JSON.stringify(take(input, {
124
+ Filters: (_) => _json(_),
125
+ IdentityProvider: (_) => _json(_),
126
+ MaxResults: [],
127
+ NextToken: [],
128
+ Product: [],
129
+ }));
130
130
  return new __HttpRequest({
131
131
  protocol,
132
132
  hostname,
@@ -144,13 +144,13 @@ export const se_ListUserAssociationsCommand = async (input, context) => {
144
144
  };
145
145
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/ListUserAssociations";
146
146
  let body;
147
- body = JSON.stringify({
148
- ...(input.Filters != null && { Filters: se_FilterList(input.Filters, context) }),
149
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
150
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
151
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
152
- ...(input.NextToken != null && { NextToken: input.NextToken }),
153
- });
147
+ body = JSON.stringify(take(input, {
148
+ Filters: (_) => _json(_),
149
+ IdentityProvider: (_) => _json(_),
150
+ InstanceId: [],
151
+ MaxResults: [],
152
+ NextToken: [],
153
+ }));
154
154
  return new __HttpRequest({
155
155
  protocol,
156
156
  hostname,
@@ -169,11 +169,11 @@ export const se_RegisterIdentityProviderCommand = async (input, context) => {
169
169
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
170
170
  "/identity-provider/RegisterIdentityProvider";
171
171
  let body;
172
- body = JSON.stringify({
173
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
174
- ...(input.Product != null && { Product: input.Product }),
175
- ...(input.Settings != null && { Settings: se_Settings(input.Settings, context) }),
176
- });
172
+ body = JSON.stringify(take(input, {
173
+ IdentityProvider: (_) => _json(_),
174
+ Product: [],
175
+ Settings: (_) => _json(_),
176
+ }));
177
177
  return new __HttpRequest({
178
178
  protocol,
179
179
  hostname,
@@ -191,12 +191,12 @@ export const se_StartProductSubscriptionCommand = async (input, context) => {
191
191
  };
192
192
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/StartProductSubscription";
193
193
  let body;
194
- body = JSON.stringify({
195
- ...(input.Domain != null && { Domain: input.Domain }),
196
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
197
- ...(input.Product != null && { Product: input.Product }),
198
- ...(input.Username != null && { Username: input.Username }),
199
- });
194
+ body = JSON.stringify(take(input, {
195
+ Domain: [],
196
+ IdentityProvider: (_) => _json(_),
197
+ Product: [],
198
+ Username: [],
199
+ }));
200
200
  return new __HttpRequest({
201
201
  protocol,
202
202
  hostname,
@@ -214,12 +214,12 @@ export const se_StopProductSubscriptionCommand = async (input, context) => {
214
214
  };
215
215
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/user/StopProductSubscription";
216
216
  let body;
217
- body = JSON.stringify({
218
- ...(input.Domain != null && { Domain: input.Domain }),
219
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
220
- ...(input.Product != null && { Product: input.Product }),
221
- ...(input.Username != null && { Username: input.Username }),
222
- });
217
+ body = JSON.stringify(take(input, {
218
+ Domain: [],
219
+ IdentityProvider: (_) => _json(_),
220
+ Product: [],
221
+ Username: [],
222
+ }));
223
223
  return new __HttpRequest({
224
224
  protocol,
225
225
  hostname,
@@ -238,11 +238,11 @@ export const se_UpdateIdentityProviderSettingsCommand = async (input, context) =
238
238
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
239
239
  "/identity-provider/UpdateIdentityProviderSettings";
240
240
  let body;
241
- body = JSON.stringify({
242
- ...(input.IdentityProvider != null && { IdentityProvider: se_IdentityProvider(input.IdentityProvider, context) }),
243
- ...(input.Product != null && { Product: input.Product }),
244
- ...(input.UpdateSettings != null && { UpdateSettings: se_UpdateSettings(input.UpdateSettings, context) }),
245
- });
241
+ body = JSON.stringify(take(input, {
242
+ IdentityProvider: (_) => _json(_),
243
+ Product: [],
244
+ UpdateSettings: (_) => _json(_),
245
+ }));
246
246
  return new __HttpRequest({
247
247
  protocol,
248
248
  hostname,
@@ -261,9 +261,10 @@ export const de_AssociateUserCommand = async (output, context) => {
261
261
  $metadata: deserializeMetadata(output),
262
262
  });
263
263
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
264
- if (data.InstanceUserSummary != null) {
265
- contents.InstanceUserSummary = de_InstanceUserSummary(data.InstanceUserSummary, context);
266
- }
264
+ const doc = take(data, {
265
+ InstanceUserSummary: _json,
266
+ });
267
+ Object.assign(contents, doc);
267
268
  return contents;
268
269
  };
269
270
  const de_AssociateUserCommandError = async (output, context) => {
@@ -296,10 +297,9 @@ const de_AssociateUserCommandError = async (output, context) => {
296
297
  throw await de_ValidationExceptionRes(parsedOutput, context);
297
298
  default:
298
299
  const parsedBody = parsedOutput.body;
299
- throwDefaultError({
300
+ return throwDefaultError({
300
301
  output,
301
302
  parsedBody,
302
- exceptionCtor: __BaseException,
303
303
  errorCode,
304
304
  });
305
305
  }
@@ -312,9 +312,10 @@ export const de_DeregisterIdentityProviderCommand = async (output, context) => {
312
312
  $metadata: deserializeMetadata(output),
313
313
  });
314
314
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
315
- if (data.IdentityProviderSummary != null) {
316
- contents.IdentityProviderSummary = de_IdentityProviderSummary(data.IdentityProviderSummary, context);
317
- }
315
+ const doc = take(data, {
316
+ IdentityProviderSummary: _json,
317
+ });
318
+ Object.assign(contents, doc);
318
319
  return contents;
319
320
  };
320
321
  const de_DeregisterIdentityProviderCommandError = async (output, context) => {
@@ -347,10 +348,9 @@ const de_DeregisterIdentityProviderCommandError = async (output, context) => {
347
348
  throw await de_ValidationExceptionRes(parsedOutput, context);
348
349
  default:
349
350
  const parsedBody = parsedOutput.body;
350
- throwDefaultError({
351
+ return throwDefaultError({
351
352
  output,
352
353
  parsedBody,
353
- exceptionCtor: __BaseException,
354
354
  errorCode,
355
355
  });
356
356
  }
@@ -363,9 +363,10 @@ export const de_DisassociateUserCommand = async (output, context) => {
363
363
  $metadata: deserializeMetadata(output),
364
364
  });
365
365
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
366
- if (data.InstanceUserSummary != null) {
367
- contents.InstanceUserSummary = de_InstanceUserSummary(data.InstanceUserSummary, context);
368
- }
366
+ const doc = take(data, {
367
+ InstanceUserSummary: _json,
368
+ });
369
+ Object.assign(contents, doc);
369
370
  return contents;
370
371
  };
371
372
  const de_DisassociateUserCommandError = async (output, context) => {
@@ -398,10 +399,9 @@ const de_DisassociateUserCommandError = async (output, context) => {
398
399
  throw await de_ValidationExceptionRes(parsedOutput, context);
399
400
  default:
400
401
  const parsedBody = parsedOutput.body;
401
- throwDefaultError({
402
+ return throwDefaultError({
402
403
  output,
403
404
  parsedBody,
404
- exceptionCtor: __BaseException,
405
405
  errorCode,
406
406
  });
407
407
  }
@@ -414,12 +414,11 @@ export const de_ListIdentityProvidersCommand = async (output, context) => {
414
414
  $metadata: deserializeMetadata(output),
415
415
  });
416
416
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
417
- if (data.IdentityProviderSummaries != null) {
418
- contents.IdentityProviderSummaries = de_IdentityProviderSummaryList(data.IdentityProviderSummaries, context);
419
- }
420
- if (data.NextToken != null) {
421
- contents.NextToken = __expectString(data.NextToken);
422
- }
417
+ const doc = take(data, {
418
+ IdentityProviderSummaries: _json,
419
+ NextToken: __expectString,
420
+ });
421
+ Object.assign(contents, doc);
423
422
  return contents;
424
423
  };
425
424
  const de_ListIdentityProvidersCommandError = async (output, context) => {
@@ -452,10 +451,9 @@ const de_ListIdentityProvidersCommandError = async (output, context) => {
452
451
  throw await de_ValidationExceptionRes(parsedOutput, context);
453
452
  default:
454
453
  const parsedBody = parsedOutput.body;
455
- throwDefaultError({
454
+ return throwDefaultError({
456
455
  output,
457
456
  parsedBody,
458
- exceptionCtor: __BaseException,
459
457
  errorCode,
460
458
  });
461
459
  }
@@ -468,12 +466,11 @@ export const de_ListInstancesCommand = async (output, context) => {
468
466
  $metadata: deserializeMetadata(output),
469
467
  });
470
468
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
471
- if (data.InstanceSummaries != null) {
472
- contents.InstanceSummaries = de_InstanceSummaryList(data.InstanceSummaries, context);
473
- }
474
- if (data.NextToken != null) {
475
- contents.NextToken = __expectString(data.NextToken);
476
- }
469
+ const doc = take(data, {
470
+ InstanceSummaries: _json,
471
+ NextToken: __expectString,
472
+ });
473
+ Object.assign(contents, doc);
477
474
  return contents;
478
475
  };
479
476
  const de_ListInstancesCommandError = async (output, context) => {
@@ -506,10 +503,9 @@ const de_ListInstancesCommandError = async (output, context) => {
506
503
  throw await de_ValidationExceptionRes(parsedOutput, context);
507
504
  default:
508
505
  const parsedBody = parsedOutput.body;
509
- throwDefaultError({
506
+ return throwDefaultError({
510
507
  output,
511
508
  parsedBody,
512
- exceptionCtor: __BaseException,
513
509
  errorCode,
514
510
  });
515
511
  }
@@ -522,12 +518,11 @@ export const de_ListProductSubscriptionsCommand = async (output, context) => {
522
518
  $metadata: deserializeMetadata(output),
523
519
  });
524
520
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
525
- if (data.NextToken != null) {
526
- contents.NextToken = __expectString(data.NextToken);
527
- }
528
- if (data.ProductUserSummaries != null) {
529
- contents.ProductUserSummaries = de_ProductUserSummaryList(data.ProductUserSummaries, context);
530
- }
521
+ const doc = take(data, {
522
+ NextToken: __expectString,
523
+ ProductUserSummaries: _json,
524
+ });
525
+ Object.assign(contents, doc);
531
526
  return contents;
532
527
  };
533
528
  const de_ListProductSubscriptionsCommandError = async (output, context) => {
@@ -560,10 +555,9 @@ const de_ListProductSubscriptionsCommandError = async (output, context) => {
560
555
  throw await de_ValidationExceptionRes(parsedOutput, context);
561
556
  default:
562
557
  const parsedBody = parsedOutput.body;
563
- throwDefaultError({
558
+ return throwDefaultError({
564
559
  output,
565
560
  parsedBody,
566
- exceptionCtor: __BaseException,
567
561
  errorCode,
568
562
  });
569
563
  }
@@ -576,12 +570,11 @@ export const de_ListUserAssociationsCommand = async (output, context) => {
576
570
  $metadata: deserializeMetadata(output),
577
571
  });
578
572
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
579
- if (data.InstanceUserSummaries != null) {
580
- contents.InstanceUserSummaries = de_InstanceUserSummaryList(data.InstanceUserSummaries, context);
581
- }
582
- if (data.NextToken != null) {
583
- contents.NextToken = __expectString(data.NextToken);
584
- }
573
+ const doc = take(data, {
574
+ InstanceUserSummaries: _json,
575
+ NextToken: __expectString,
576
+ });
577
+ Object.assign(contents, doc);
585
578
  return contents;
586
579
  };
587
580
  const de_ListUserAssociationsCommandError = async (output, context) => {
@@ -614,10 +607,9 @@ const de_ListUserAssociationsCommandError = async (output, context) => {
614
607
  throw await de_ValidationExceptionRes(parsedOutput, context);
615
608
  default:
616
609
  const parsedBody = parsedOutput.body;
617
- throwDefaultError({
610
+ return throwDefaultError({
618
611
  output,
619
612
  parsedBody,
620
- exceptionCtor: __BaseException,
621
613
  errorCode,
622
614
  });
623
615
  }
@@ -630,9 +622,10 @@ export const de_RegisterIdentityProviderCommand = async (output, context) => {
630
622
  $metadata: deserializeMetadata(output),
631
623
  });
632
624
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
633
- if (data.IdentityProviderSummary != null) {
634
- contents.IdentityProviderSummary = de_IdentityProviderSummary(data.IdentityProviderSummary, context);
635
- }
625
+ const doc = take(data, {
626
+ IdentityProviderSummary: _json,
627
+ });
628
+ Object.assign(contents, doc);
636
629
  return contents;
637
630
  };
638
631
  const de_RegisterIdentityProviderCommandError = async (output, context) => {
@@ -665,10 +658,9 @@ const de_RegisterIdentityProviderCommandError = async (output, context) => {
665
658
  throw await de_ValidationExceptionRes(parsedOutput, context);
666
659
  default:
667
660
  const parsedBody = parsedOutput.body;
668
- throwDefaultError({
661
+ return throwDefaultError({
669
662
  output,
670
663
  parsedBody,
671
- exceptionCtor: __BaseException,
672
664
  errorCode,
673
665
  });
674
666
  }
@@ -681,9 +673,10 @@ export const de_StartProductSubscriptionCommand = async (output, context) => {
681
673
  $metadata: deserializeMetadata(output),
682
674
  });
683
675
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
684
- if (data.ProductUserSummary != null) {
685
- contents.ProductUserSummary = de_ProductUserSummary(data.ProductUserSummary, context);
686
- }
676
+ const doc = take(data, {
677
+ ProductUserSummary: _json,
678
+ });
679
+ Object.assign(contents, doc);
687
680
  return contents;
688
681
  };
689
682
  const de_StartProductSubscriptionCommandError = async (output, context) => {
@@ -716,10 +709,9 @@ const de_StartProductSubscriptionCommandError = async (output, context) => {
716
709
  throw await de_ValidationExceptionRes(parsedOutput, context);
717
710
  default:
718
711
  const parsedBody = parsedOutput.body;
719
- throwDefaultError({
712
+ return throwDefaultError({
720
713
  output,
721
714
  parsedBody,
722
- exceptionCtor: __BaseException,
723
715
  errorCode,
724
716
  });
725
717
  }
@@ -732,9 +724,10 @@ export const de_StopProductSubscriptionCommand = async (output, context) => {
732
724
  $metadata: deserializeMetadata(output),
733
725
  });
734
726
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
735
- if (data.ProductUserSummary != null) {
736
- contents.ProductUserSummary = de_ProductUserSummary(data.ProductUserSummary, context);
737
- }
727
+ const doc = take(data, {
728
+ ProductUserSummary: _json,
729
+ });
730
+ Object.assign(contents, doc);
738
731
  return contents;
739
732
  };
740
733
  const de_StopProductSubscriptionCommandError = async (output, context) => {
@@ -767,10 +760,9 @@ const de_StopProductSubscriptionCommandError = async (output, context) => {
767
760
  throw await de_ValidationExceptionRes(parsedOutput, context);
768
761
  default:
769
762
  const parsedBody = parsedOutput.body;
770
- throwDefaultError({
763
+ return throwDefaultError({
771
764
  output,
772
765
  parsedBody,
773
- exceptionCtor: __BaseException,
774
766
  errorCode,
775
767
  });
776
768
  }
@@ -783,9 +775,10 @@ export const de_UpdateIdentityProviderSettingsCommand = async (output, context)
783
775
  $metadata: deserializeMetadata(output),
784
776
  });
785
777
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
786
- if (data.IdentityProviderSummary != null) {
787
- contents.IdentityProviderSummary = de_IdentityProviderSummary(data.IdentityProviderSummary, context);
788
- }
778
+ const doc = take(data, {
779
+ IdentityProviderSummary: _json,
780
+ });
781
+ Object.assign(contents, doc);
789
782
  return contents;
790
783
  };
791
784
  const de_UpdateIdentityProviderSettingsCommandError = async (output, context) => {
@@ -809,21 +802,21 @@ const de_UpdateIdentityProviderSettingsCommandError = async (output, context) =>
809
802
  throw await de_ValidationExceptionRes(parsedOutput, context);
810
803
  default:
811
804
  const parsedBody = parsedOutput.body;
812
- throwDefaultError({
805
+ return throwDefaultError({
813
806
  output,
814
807
  parsedBody,
815
- exceptionCtor: __BaseException,
816
808
  errorCode,
817
809
  });
818
810
  }
819
811
  };
820
- const map = __map;
812
+ const throwDefaultError = withBaseException(__BaseException);
821
813
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
822
814
  const contents = map({});
823
815
  const data = parsedOutput.body;
824
- if (data.message != null) {
825
- contents.message = __expectString(data.message);
826
- }
816
+ const doc = take(data, {
817
+ message: __expectString,
818
+ });
819
+ Object.assign(contents, doc);
827
820
  const exception = new AccessDeniedException({
828
821
  $metadata: deserializeMetadata(parsedOutput),
829
822
  ...contents,
@@ -833,9 +826,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
833
826
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
834
827
  const contents = map({});
835
828
  const data = parsedOutput.body;
836
- if (data.message != null) {
837
- contents.message = __expectString(data.message);
838
- }
829
+ const doc = take(data, {
830
+ message: __expectString,
831
+ });
832
+ Object.assign(contents, doc);
839
833
  const exception = new ConflictException({
840
834
  $metadata: deserializeMetadata(parsedOutput),
841
835
  ...contents,
@@ -845,9 +839,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
845
839
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
846
840
  const contents = map({});
847
841
  const data = parsedOutput.body;
848
- if (data.message != null) {
849
- contents.message = __expectString(data.message);
850
- }
842
+ const doc = take(data, {
843
+ message: __expectString,
844
+ });
845
+ Object.assign(contents, doc);
851
846
  const exception = new InternalServerException({
852
847
  $metadata: deserializeMetadata(parsedOutput),
853
848
  ...contents,
@@ -857,9 +852,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
857
852
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
858
853
  const contents = map({});
859
854
  const data = parsedOutput.body;
860
- if (data.message != null) {
861
- contents.message = __expectString(data.message);
862
- }
855
+ const doc = take(data, {
856
+ message: __expectString,
857
+ });
858
+ Object.assign(contents, doc);
863
859
  const exception = new ResourceNotFoundException({
864
860
  $metadata: deserializeMetadata(parsedOutput),
865
861
  ...contents,
@@ -869,9 +865,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
869
865
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
870
866
  const contents = map({});
871
867
  const data = parsedOutput.body;
872
- if (data.message != null) {
873
- contents.message = __expectString(data.message);
874
- }
868
+ const doc = take(data, {
869
+ message: __expectString,
870
+ });
871
+ Object.assign(contents, doc);
875
872
  const exception = new ServiceQuotaExceededException({
876
873
  $metadata: deserializeMetadata(parsedOutput),
877
874
  ...contents,
@@ -881,9 +878,10 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
881
878
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
882
879
  const contents = map({});
883
880
  const data = parsedOutput.body;
884
- if (data.message != null) {
885
- contents.message = __expectString(data.message);
886
- }
881
+ const doc = take(data, {
882
+ message: __expectString,
883
+ });
884
+ Object.assign(contents, doc);
887
885
  const exception = new ThrottlingException({
888
886
  $metadata: deserializeMetadata(parsedOutput),
889
887
  ...contents,
@@ -893,195 +891,16 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
893
891
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
894
892
  const contents = map({});
895
893
  const data = parsedOutput.body;
896
- if (data.message != null) {
897
- contents.message = __expectString(data.message);
898
- }
894
+ const doc = take(data, {
895
+ message: __expectString,
896
+ });
897
+ Object.assign(contents, doc);
899
898
  const exception = new ValidationException({
900
899
  $metadata: deserializeMetadata(parsedOutput),
901
900
  ...contents,
902
901
  });
903
902
  return __decorateServiceException(exception, parsedOutput.body);
904
903
  };
905
- const se_ActiveDirectoryIdentityProvider = (input, context) => {
906
- return {
907
- ...(input.DirectoryId != null && { DirectoryId: input.DirectoryId }),
908
- };
909
- };
910
- const se_Filter = (input, context) => {
911
- return {
912
- ...(input.Attribute != null && { Attribute: input.Attribute }),
913
- ...(input.Operation != null && { Operation: input.Operation }),
914
- ...(input.Value != null && { Value: input.Value }),
915
- };
916
- };
917
- const se_FilterList = (input, context) => {
918
- return input
919
- .filter((e) => e != null)
920
- .map((entry) => {
921
- return se_Filter(entry, context);
922
- });
923
- };
924
- const se_IdentityProvider = (input, context) => {
925
- return IdentityProvider.visit(input, {
926
- ActiveDirectoryIdentityProvider: (value) => ({
927
- ActiveDirectoryIdentityProvider: se_ActiveDirectoryIdentityProvider(value, context),
928
- }),
929
- _: (name, value) => ({ name: value }),
930
- });
931
- };
932
- const se_Settings = (input, context) => {
933
- return {
934
- ...(input.SecurityGroupId != null && { SecurityGroupId: input.SecurityGroupId }),
935
- ...(input.Subnets != null && { Subnets: se_Subnets(input.Subnets, context) }),
936
- };
937
- };
938
- const se_Subnets = (input, context) => {
939
- return input
940
- .filter((e) => e != null)
941
- .map((entry) => {
942
- return entry;
943
- });
944
- };
945
- const se_UpdateSettings = (input, context) => {
946
- return {
947
- ...(input.AddSubnets != null && { AddSubnets: se_Subnets(input.AddSubnets, context) }),
948
- ...(input.RemoveSubnets != null && { RemoveSubnets: se_Subnets(input.RemoveSubnets, context) }),
949
- ...(input.SecurityGroupId != null && { SecurityGroupId: input.SecurityGroupId }),
950
- };
951
- };
952
- const de_ActiveDirectoryIdentityProvider = (output, context) => {
953
- return {
954
- DirectoryId: __expectString(output.DirectoryId),
955
- };
956
- };
957
- const de_IdentityProvider = (output, context) => {
958
- if (output.ActiveDirectoryIdentityProvider != null) {
959
- return {
960
- ActiveDirectoryIdentityProvider: de_ActiveDirectoryIdentityProvider(output.ActiveDirectoryIdentityProvider, context),
961
- };
962
- }
963
- return { $unknown: Object.entries(output)[0] };
964
- };
965
- const de_IdentityProviderSummary = (output, context) => {
966
- return {
967
- FailureMessage: __expectString(output.FailureMessage),
968
- IdentityProvider: output.IdentityProvider != null
969
- ? de_IdentityProvider(__expectUnion(output.IdentityProvider), context)
970
- : undefined,
971
- Product: __expectString(output.Product),
972
- Settings: output.Settings != null ? de_Settings(output.Settings, context) : undefined,
973
- Status: __expectString(output.Status),
974
- };
975
- };
976
- const de_IdentityProviderSummaryList = (output, context) => {
977
- const retVal = (output || [])
978
- .filter((e) => e != null)
979
- .map((entry) => {
980
- if (entry === null) {
981
- return null;
982
- }
983
- return de_IdentityProviderSummary(entry, context);
984
- });
985
- return retVal;
986
- };
987
- const de_InstanceSummary = (output, context) => {
988
- return {
989
- InstanceId: __expectString(output.InstanceId),
990
- LastStatusCheckDate: __expectString(output.LastStatusCheckDate),
991
- Products: output.Products != null ? de_StringList(output.Products, context) : undefined,
992
- Status: __expectString(output.Status),
993
- StatusMessage: __expectString(output.StatusMessage),
994
- };
995
- };
996
- const de_InstanceSummaryList = (output, context) => {
997
- const retVal = (output || [])
998
- .filter((e) => e != null)
999
- .map((entry) => {
1000
- if (entry === null) {
1001
- return null;
1002
- }
1003
- return de_InstanceSummary(entry, context);
1004
- });
1005
- return retVal;
1006
- };
1007
- const de_InstanceUserSummary = (output, context) => {
1008
- return {
1009
- AssociationDate: __expectString(output.AssociationDate),
1010
- DisassociationDate: __expectString(output.DisassociationDate),
1011
- Domain: __expectString(output.Domain),
1012
- IdentityProvider: output.IdentityProvider != null
1013
- ? de_IdentityProvider(__expectUnion(output.IdentityProvider), context)
1014
- : undefined,
1015
- InstanceId: __expectString(output.InstanceId),
1016
- Status: __expectString(output.Status),
1017
- StatusMessage: __expectString(output.StatusMessage),
1018
- Username: __expectString(output.Username),
1019
- };
1020
- };
1021
- const de_InstanceUserSummaryList = (output, context) => {
1022
- const retVal = (output || [])
1023
- .filter((e) => e != null)
1024
- .map((entry) => {
1025
- if (entry === null) {
1026
- return null;
1027
- }
1028
- return de_InstanceUserSummary(entry, context);
1029
- });
1030
- return retVal;
1031
- };
1032
- const de_ProductUserSummary = (output, context) => {
1033
- return {
1034
- Domain: __expectString(output.Domain),
1035
- IdentityProvider: output.IdentityProvider != null
1036
- ? de_IdentityProvider(__expectUnion(output.IdentityProvider), context)
1037
- : undefined,
1038
- Product: __expectString(output.Product),
1039
- Status: __expectString(output.Status),
1040
- StatusMessage: __expectString(output.StatusMessage),
1041
- SubscriptionEndDate: __expectString(output.SubscriptionEndDate),
1042
- SubscriptionStartDate: __expectString(output.SubscriptionStartDate),
1043
- Username: __expectString(output.Username),
1044
- };
1045
- };
1046
- const de_ProductUserSummaryList = (output, context) => {
1047
- const retVal = (output || [])
1048
- .filter((e) => e != null)
1049
- .map((entry) => {
1050
- if (entry === null) {
1051
- return null;
1052
- }
1053
- return de_ProductUserSummary(entry, context);
1054
- });
1055
- return retVal;
1056
- };
1057
- const de_Settings = (output, context) => {
1058
- return {
1059
- SecurityGroupId: __expectString(output.SecurityGroupId),
1060
- Subnets: output.Subnets != null ? de_Subnets(output.Subnets, context) : undefined,
1061
- };
1062
- };
1063
- const de_StringList = (output, context) => {
1064
- const retVal = (output || [])
1065
- .filter((e) => e != null)
1066
- .map((entry) => {
1067
- if (entry === null) {
1068
- return null;
1069
- }
1070
- return __expectString(entry);
1071
- });
1072
- return retVal;
1073
- };
1074
- const de_Subnets = (output, context) => {
1075
- const retVal = (output || [])
1076
- .filter((e) => e != null)
1077
- .map((entry) => {
1078
- if (entry === null) {
1079
- return null;
1080
- }
1081
- return __expectString(entry);
1082
- });
1083
- return retVal;
1084
- };
1085
904
  const deserializeMetadata = (output) => ({
1086
905
  httpStatusCode: output.statusCode,
1087
906
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],