@aws-sdk/client-grafana 3.312.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, LazyJsonString as __LazyJsonString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { GrafanaServiceException as __BaseException } from "../models/GrafanaServiceException";
5
- import { AccessDeniedException, ConflictException, IdpMetadata, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export const se_AssociateLicenseCommand = async (input, context) => {
7
7
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
8
  const headers = {};
@@ -28,34 +28,24 @@ export const se_CreateWorkspaceCommand = async (input, context) => {
28
28
  };
29
29
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces";
30
30
  let body;
31
- body = JSON.stringify({
32
- ...(input.accountAccessType != null && { accountAccessType: input.accountAccessType }),
33
- ...(input.authenticationProviders != null && {
34
- authenticationProviders: se_AuthenticationProviders(input.authenticationProviders, context),
35
- }),
36
- clientToken: input.clientToken ?? generateIdempotencyToken(),
37
- ...(input.configuration != null && { configuration: __LazyJsonString.fromObject(input.configuration) }),
38
- ...(input.networkAccessControl != null && {
39
- networkAccessControl: se_NetworkAccessConfiguration(input.networkAccessControl, context),
40
- }),
41
- ...(input.organizationRoleName != null && { organizationRoleName: input.organizationRoleName }),
42
- ...(input.permissionType != null && { permissionType: input.permissionType }),
43
- ...(input.stackSetName != null && { stackSetName: input.stackSetName }),
44
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
45
- ...(input.vpcConfiguration != null && { vpcConfiguration: se_VpcConfiguration(input.vpcConfiguration, context) }),
46
- ...(input.workspaceDataSources != null && {
47
- workspaceDataSources: se_DataSourceTypesList(input.workspaceDataSources, context),
48
- }),
49
- ...(input.workspaceDescription != null && { workspaceDescription: input.workspaceDescription }),
50
- ...(input.workspaceName != null && { workspaceName: input.workspaceName }),
51
- ...(input.workspaceNotificationDestinations != null && {
52
- workspaceNotificationDestinations: se_NotificationDestinationsList(input.workspaceNotificationDestinations, context),
53
- }),
54
- ...(input.workspaceOrganizationalUnits != null && {
55
- workspaceOrganizationalUnits: se_OrganizationalUnitList(input.workspaceOrganizationalUnits, context),
56
- }),
57
- ...(input.workspaceRoleArn != null && { workspaceRoleArn: input.workspaceRoleArn }),
58
- });
31
+ body = JSON.stringify(take(input, {
32
+ accountAccessType: [],
33
+ authenticationProviders: (_) => _json(_),
34
+ clientToken: (_) => _ ?? generateIdempotencyToken(),
35
+ configuration: (_) => __LazyJsonString.fromObject(_),
36
+ networkAccessControl: (_) => _json(_),
37
+ organizationRoleName: [],
38
+ permissionType: [],
39
+ stackSetName: [],
40
+ tags: (_) => _json(_),
41
+ vpcConfiguration: (_) => _json(_),
42
+ workspaceDataSources: (_) => _json(_),
43
+ workspaceDescription: [],
44
+ workspaceName: [],
45
+ workspaceNotificationDestinations: (_) => _json(_),
46
+ workspaceOrganizationalUnits: (_) => _json(_),
47
+ workspaceRoleArn: [],
48
+ }));
59
49
  return new __HttpRequest({
60
50
  protocol,
61
51
  hostname,
@@ -74,11 +64,11 @@ export const se_CreateWorkspaceApiKeyCommand = async (input, context) => {
74
64
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/apikeys";
75
65
  resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
76
66
  let body;
77
- body = JSON.stringify({
78
- ...(input.keyName != null && { keyName: input.keyName }),
79
- ...(input.keyRole != null && { keyRole: input.keyRole }),
80
- ...(input.secondsToLive != null && { secondsToLive: input.secondsToLive }),
81
- });
67
+ body = JSON.stringify(take(input, {
68
+ keyName: [],
69
+ keyRole: [],
70
+ secondsToLive: [],
71
+ }));
82
72
  return new __HttpRequest({
83
73
  protocol,
84
74
  hostname,
@@ -257,9 +247,9 @@ export const se_TagResourceCommand = async (input, context) => {
257
247
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
258
248
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
259
249
  let body;
260
- body = JSON.stringify({
261
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
262
- });
250
+ body = JSON.stringify(take(input, {
251
+ tags: (_) => _json(_),
252
+ }));
263
253
  return new __HttpRequest({
264
254
  protocol,
265
255
  hostname,
@@ -301,11 +291,9 @@ export const se_UpdatePermissionsCommand = async (input, context) => {
301
291
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/permissions";
302
292
  resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
303
293
  let body;
304
- body = JSON.stringify({
305
- ...(input.updateInstructionBatch != null && {
306
- updateInstructionBatch: se_UpdateInstructionBatch(input.updateInstructionBatch, context),
307
- }),
308
- });
294
+ body = JSON.stringify(take(input, {
295
+ updateInstructionBatch: (_) => _json(_),
296
+ }));
309
297
  return new __HttpRequest({
310
298
  protocol,
311
299
  hostname,
@@ -324,32 +312,22 @@ export const se_UpdateWorkspaceCommand = async (input, context) => {
324
312
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
325
313
  resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
326
314
  let body;
327
- body = JSON.stringify({
328
- ...(input.accountAccessType != null && { accountAccessType: input.accountAccessType }),
329
- ...(input.networkAccessControl != null && {
330
- networkAccessControl: se_NetworkAccessConfiguration(input.networkAccessControl, context),
331
- }),
332
- ...(input.organizationRoleName != null && { organizationRoleName: input.organizationRoleName }),
333
- ...(input.permissionType != null && { permissionType: input.permissionType }),
334
- ...(input.removeNetworkAccessConfiguration != null && {
335
- removeNetworkAccessConfiguration: input.removeNetworkAccessConfiguration,
336
- }),
337
- ...(input.removeVpcConfiguration != null && { removeVpcConfiguration: input.removeVpcConfiguration }),
338
- ...(input.stackSetName != null && { stackSetName: input.stackSetName }),
339
- ...(input.vpcConfiguration != null && { vpcConfiguration: se_VpcConfiguration(input.vpcConfiguration, context) }),
340
- ...(input.workspaceDataSources != null && {
341
- workspaceDataSources: se_DataSourceTypesList(input.workspaceDataSources, context),
342
- }),
343
- ...(input.workspaceDescription != null && { workspaceDescription: input.workspaceDescription }),
344
- ...(input.workspaceName != null && { workspaceName: input.workspaceName }),
345
- ...(input.workspaceNotificationDestinations != null && {
346
- workspaceNotificationDestinations: se_NotificationDestinationsList(input.workspaceNotificationDestinations, context),
347
- }),
348
- ...(input.workspaceOrganizationalUnits != null && {
349
- workspaceOrganizationalUnits: se_OrganizationalUnitList(input.workspaceOrganizationalUnits, context),
350
- }),
351
- ...(input.workspaceRoleArn != null && { workspaceRoleArn: input.workspaceRoleArn }),
352
- });
315
+ body = JSON.stringify(take(input, {
316
+ accountAccessType: [],
317
+ networkAccessControl: (_) => _json(_),
318
+ organizationRoleName: [],
319
+ permissionType: [],
320
+ removeNetworkAccessConfiguration: [],
321
+ removeVpcConfiguration: [],
322
+ stackSetName: [],
323
+ vpcConfiguration: (_) => _json(_),
324
+ workspaceDataSources: (_) => _json(_),
325
+ workspaceDescription: [],
326
+ workspaceName: [],
327
+ workspaceNotificationDestinations: (_) => _json(_),
328
+ workspaceOrganizationalUnits: (_) => _json(_),
329
+ workspaceRoleArn: [],
330
+ }));
353
331
  return new __HttpRequest({
354
332
  protocol,
355
333
  hostname,
@@ -368,14 +346,10 @@ export const se_UpdateWorkspaceAuthenticationCommand = async (input, context) =>
368
346
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/authentication";
369
347
  resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
370
348
  let body;
371
- body = JSON.stringify({
372
- ...(input.authenticationProviders != null && {
373
- authenticationProviders: se_AuthenticationProviders(input.authenticationProviders, context),
374
- }),
375
- ...(input.samlConfiguration != null && {
376
- samlConfiguration: se_SamlConfiguration(input.samlConfiguration, context),
377
- }),
378
- });
349
+ body = JSON.stringify(take(input, {
350
+ authenticationProviders: (_) => _json(_),
351
+ samlConfiguration: (_) => _json(_),
352
+ }));
379
353
  return new __HttpRequest({
380
354
  protocol,
381
355
  hostname,
@@ -394,9 +368,9 @@ export const se_UpdateWorkspaceConfigurationCommand = async (input, context) =>
394
368
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/configuration";
395
369
  resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
396
370
  let body;
397
- body = JSON.stringify({
398
- ...(input.configuration != null && { configuration: __LazyJsonString.fromObject(input.configuration) }),
399
- });
371
+ body = JSON.stringify(take(input, {
372
+ configuration: (_) => __LazyJsonString.fromObject(_),
373
+ }));
400
374
  return new __HttpRequest({
401
375
  protocol,
402
376
  hostname,
@@ -415,9 +389,10 @@ export const de_AssociateLicenseCommand = async (output, context) => {
415
389
  $metadata: deserializeMetadata(output),
416
390
  });
417
391
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
418
- if (data.workspace != null) {
419
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
420
- }
392
+ const doc = take(data, {
393
+ workspace: (_) => de_WorkspaceDescription(_, context),
394
+ });
395
+ Object.assign(contents, doc);
421
396
  return contents;
422
397
  };
423
398
  const de_AssociateLicenseCommandError = async (output, context) => {
@@ -444,10 +419,9 @@ const de_AssociateLicenseCommandError = async (output, context) => {
444
419
  throw await de_ValidationExceptionRes(parsedOutput, context);
445
420
  default:
446
421
  const parsedBody = parsedOutput.body;
447
- throwDefaultError({
422
+ return throwDefaultError({
448
423
  output,
449
424
  parsedBody,
450
- exceptionCtor: __BaseException,
451
425
  errorCode,
452
426
  });
453
427
  }
@@ -460,9 +434,10 @@ export const de_CreateWorkspaceCommand = async (output, context) => {
460
434
  $metadata: deserializeMetadata(output),
461
435
  });
462
436
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
463
- if (data.workspace != null) {
464
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
465
- }
437
+ const doc = take(data, {
438
+ workspace: (_) => de_WorkspaceDescription(_, context),
439
+ });
440
+ Object.assign(contents, doc);
466
441
  return contents;
467
442
  };
468
443
  const de_CreateWorkspaceCommandError = async (output, context) => {
@@ -492,10 +467,9 @@ const de_CreateWorkspaceCommandError = async (output, context) => {
492
467
  throw await de_ValidationExceptionRes(parsedOutput, context);
493
468
  default:
494
469
  const parsedBody = parsedOutput.body;
495
- throwDefaultError({
470
+ return throwDefaultError({
496
471
  output,
497
472
  parsedBody,
498
- exceptionCtor: __BaseException,
499
473
  errorCode,
500
474
  });
501
475
  }
@@ -508,15 +482,12 @@ export const de_CreateWorkspaceApiKeyCommand = async (output, context) => {
508
482
  $metadata: deserializeMetadata(output),
509
483
  });
510
484
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
511
- if (data.key != null) {
512
- contents.key = __expectString(data.key);
513
- }
514
- if (data.keyName != null) {
515
- contents.keyName = __expectString(data.keyName);
516
- }
517
- if (data.workspaceId != null) {
518
- contents.workspaceId = __expectString(data.workspaceId);
519
- }
485
+ const doc = take(data, {
486
+ key: __expectString,
487
+ keyName: __expectString,
488
+ workspaceId: __expectString,
489
+ });
490
+ Object.assign(contents, doc);
520
491
  return contents;
521
492
  };
522
493
  const de_CreateWorkspaceApiKeyCommandError = async (output, context) => {
@@ -549,10 +520,9 @@ const de_CreateWorkspaceApiKeyCommandError = async (output, context) => {
549
520
  throw await de_ValidationExceptionRes(parsedOutput, context);
550
521
  default:
551
522
  const parsedBody = parsedOutput.body;
552
- throwDefaultError({
523
+ return throwDefaultError({
553
524
  output,
554
525
  parsedBody,
555
- exceptionCtor: __BaseException,
556
526
  errorCode,
557
527
  });
558
528
  }
@@ -565,9 +535,10 @@ export const de_DeleteWorkspaceCommand = async (output, context) => {
565
535
  $metadata: deserializeMetadata(output),
566
536
  });
567
537
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
568
- if (data.workspace != null) {
569
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
570
- }
538
+ const doc = take(data, {
539
+ workspace: (_) => de_WorkspaceDescription(_, context),
540
+ });
541
+ Object.assign(contents, doc);
571
542
  return contents;
572
543
  };
573
544
  const de_DeleteWorkspaceCommandError = async (output, context) => {
@@ -597,10 +568,9 @@ const de_DeleteWorkspaceCommandError = async (output, context) => {
597
568
  throw await de_ValidationExceptionRes(parsedOutput, context);
598
569
  default:
599
570
  const parsedBody = parsedOutput.body;
600
- throwDefaultError({
571
+ return throwDefaultError({
601
572
  output,
602
573
  parsedBody,
603
- exceptionCtor: __BaseException,
604
574
  errorCode,
605
575
  });
606
576
  }
@@ -613,12 +583,11 @@ export const de_DeleteWorkspaceApiKeyCommand = async (output, context) => {
613
583
  $metadata: deserializeMetadata(output),
614
584
  });
615
585
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
616
- if (data.keyName != null) {
617
- contents.keyName = __expectString(data.keyName);
618
- }
619
- if (data.workspaceId != null) {
620
- contents.workspaceId = __expectString(data.workspaceId);
621
- }
586
+ const doc = take(data, {
587
+ keyName: __expectString,
588
+ workspaceId: __expectString,
589
+ });
590
+ Object.assign(contents, doc);
622
591
  return contents;
623
592
  };
624
593
  const de_DeleteWorkspaceApiKeyCommandError = async (output, context) => {
@@ -648,10 +617,9 @@ const de_DeleteWorkspaceApiKeyCommandError = async (output, context) => {
648
617
  throw await de_ValidationExceptionRes(parsedOutput, context);
649
618
  default:
650
619
  const parsedBody = parsedOutput.body;
651
- throwDefaultError({
620
+ return throwDefaultError({
652
621
  output,
653
622
  parsedBody,
654
- exceptionCtor: __BaseException,
655
623
  errorCode,
656
624
  });
657
625
  }
@@ -664,9 +632,10 @@ export const de_DescribeWorkspaceCommand = async (output, context) => {
664
632
  $metadata: deserializeMetadata(output),
665
633
  });
666
634
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
667
- if (data.workspace != null) {
668
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
669
- }
635
+ const doc = take(data, {
636
+ workspace: (_) => de_WorkspaceDescription(_, context),
637
+ });
638
+ Object.assign(contents, doc);
670
639
  return contents;
671
640
  };
672
641
  const de_DescribeWorkspaceCommandError = async (output, context) => {
@@ -693,10 +662,9 @@ const de_DescribeWorkspaceCommandError = async (output, context) => {
693
662
  throw await de_ValidationExceptionRes(parsedOutput, context);
694
663
  default:
695
664
  const parsedBody = parsedOutput.body;
696
- throwDefaultError({
665
+ return throwDefaultError({
697
666
  output,
698
667
  parsedBody,
699
- exceptionCtor: __BaseException,
700
668
  errorCode,
701
669
  });
702
670
  }
@@ -709,9 +677,10 @@ export const de_DescribeWorkspaceAuthenticationCommand = async (output, context)
709
677
  $metadata: deserializeMetadata(output),
710
678
  });
711
679
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
712
- if (data.authentication != null) {
713
- contents.authentication = de_AuthenticationDescription(data.authentication, context);
714
- }
680
+ const doc = take(data, {
681
+ authentication: _json,
682
+ });
683
+ Object.assign(contents, doc);
715
684
  return contents;
716
685
  };
717
686
  const de_DescribeWorkspaceAuthenticationCommandError = async (output, context) => {
@@ -738,10 +707,9 @@ const de_DescribeWorkspaceAuthenticationCommandError = async (output, context) =
738
707
  throw await de_ValidationExceptionRes(parsedOutput, context);
739
708
  default:
740
709
  const parsedBody = parsedOutput.body;
741
- throwDefaultError({
710
+ return throwDefaultError({
742
711
  output,
743
712
  parsedBody,
744
- exceptionCtor: __BaseException,
745
713
  errorCode,
746
714
  });
747
715
  }
@@ -754,9 +722,10 @@ export const de_DescribeWorkspaceConfigurationCommand = async (output, context)
754
722
  $metadata: deserializeMetadata(output),
755
723
  });
756
724
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
757
- if (data.configuration != null) {
758
- contents.configuration = new __LazyJsonString(data.configuration);
759
- }
725
+ const doc = take(data, {
726
+ configuration: (_) => new __LazyJsonString(_),
727
+ });
728
+ Object.assign(contents, doc);
760
729
  return contents;
761
730
  };
762
731
  const de_DescribeWorkspaceConfigurationCommandError = async (output, context) => {
@@ -780,10 +749,9 @@ const de_DescribeWorkspaceConfigurationCommandError = async (output, context) =>
780
749
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
781
750
  default:
782
751
  const parsedBody = parsedOutput.body;
783
- throwDefaultError({
752
+ return throwDefaultError({
784
753
  output,
785
754
  parsedBody,
786
- exceptionCtor: __BaseException,
787
755
  errorCode,
788
756
  });
789
757
  }
@@ -796,9 +764,10 @@ export const de_DisassociateLicenseCommand = async (output, context) => {
796
764
  $metadata: deserializeMetadata(output),
797
765
  });
798
766
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
799
- if (data.workspace != null) {
800
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
801
- }
767
+ const doc = take(data, {
768
+ workspace: (_) => de_WorkspaceDescription(_, context),
769
+ });
770
+ Object.assign(contents, doc);
802
771
  return contents;
803
772
  };
804
773
  const de_DisassociateLicenseCommandError = async (output, context) => {
@@ -825,10 +794,9 @@ const de_DisassociateLicenseCommandError = async (output, context) => {
825
794
  throw await de_ValidationExceptionRes(parsedOutput, context);
826
795
  default:
827
796
  const parsedBody = parsedOutput.body;
828
- throwDefaultError({
797
+ return throwDefaultError({
829
798
  output,
830
799
  parsedBody,
831
- exceptionCtor: __BaseException,
832
800
  errorCode,
833
801
  });
834
802
  }
@@ -841,12 +809,11 @@ export const de_ListPermissionsCommand = async (output, context) => {
841
809
  $metadata: deserializeMetadata(output),
842
810
  });
843
811
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
844
- if (data.nextToken != null) {
845
- contents.nextToken = __expectString(data.nextToken);
846
- }
847
- if (data.permissions != null) {
848
- contents.permissions = de_PermissionEntryList(data.permissions, context);
849
- }
812
+ const doc = take(data, {
813
+ nextToken: __expectString,
814
+ permissions: _json,
815
+ });
816
+ Object.assign(contents, doc);
850
817
  return contents;
851
818
  };
852
819
  const de_ListPermissionsCommandError = async (output, context) => {
@@ -873,10 +840,9 @@ const de_ListPermissionsCommandError = async (output, context) => {
873
840
  throw await de_ValidationExceptionRes(parsedOutput, context);
874
841
  default:
875
842
  const parsedBody = parsedOutput.body;
876
- throwDefaultError({
843
+ return throwDefaultError({
877
844
  output,
878
845
  parsedBody,
879
- exceptionCtor: __BaseException,
880
846
  errorCode,
881
847
  });
882
848
  }
@@ -889,9 +855,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
889
855
  $metadata: deserializeMetadata(output),
890
856
  });
891
857
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
892
- if (data.tags != null) {
893
- contents.tags = de_TagMap(data.tags, context);
894
- }
858
+ const doc = take(data, {
859
+ tags: _json,
860
+ });
861
+ Object.assign(contents, doc);
895
862
  return contents;
896
863
  };
897
864
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -918,10 +885,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
918
885
  throw await de_ValidationExceptionRes(parsedOutput, context);
919
886
  default:
920
887
  const parsedBody = parsedOutput.body;
921
- throwDefaultError({
888
+ return throwDefaultError({
922
889
  output,
923
890
  parsedBody,
924
- exceptionCtor: __BaseException,
925
891
  errorCode,
926
892
  });
927
893
  }
@@ -934,12 +900,11 @@ export const de_ListWorkspacesCommand = async (output, context) => {
934
900
  $metadata: deserializeMetadata(output),
935
901
  });
936
902
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
937
- if (data.nextToken != null) {
938
- contents.nextToken = __expectString(data.nextToken);
939
- }
940
- if (data.workspaces != null) {
941
- contents.workspaces = de_WorkspaceList(data.workspaces, context);
942
- }
903
+ const doc = take(data, {
904
+ nextToken: __expectString,
905
+ workspaces: (_) => de_WorkspaceList(_, context),
906
+ });
907
+ Object.assign(contents, doc);
943
908
  return contents;
944
909
  };
945
910
  const de_ListWorkspacesCommandError = async (output, context) => {
@@ -960,10 +925,9 @@ const de_ListWorkspacesCommandError = async (output, context) => {
960
925
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
961
926
  default:
962
927
  const parsedBody = parsedOutput.body;
963
- throwDefaultError({
928
+ return throwDefaultError({
964
929
  output,
965
930
  parsedBody,
966
- exceptionCtor: __BaseException,
967
931
  errorCode,
968
932
  });
969
933
  }
@@ -1002,10 +966,9 @@ const de_TagResourceCommandError = async (output, context) => {
1002
966
  throw await de_ValidationExceptionRes(parsedOutput, context);
1003
967
  default:
1004
968
  const parsedBody = parsedOutput.body;
1005
- throwDefaultError({
969
+ return throwDefaultError({
1006
970
  output,
1007
971
  parsedBody,
1008
- exceptionCtor: __BaseException,
1009
972
  errorCode,
1010
973
  });
1011
974
  }
@@ -1044,10 +1007,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1044
1007
  throw await de_ValidationExceptionRes(parsedOutput, context);
1045
1008
  default:
1046
1009
  const parsedBody = parsedOutput.body;
1047
- throwDefaultError({
1010
+ return throwDefaultError({
1048
1011
  output,
1049
1012
  parsedBody,
1050
- exceptionCtor: __BaseException,
1051
1013
  errorCode,
1052
1014
  });
1053
1015
  }
@@ -1060,9 +1022,10 @@ export const de_UpdatePermissionsCommand = async (output, context) => {
1060
1022
  $metadata: deserializeMetadata(output),
1061
1023
  });
1062
1024
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1063
- if (data.errors != null) {
1064
- contents.errors = de_UpdateErrorList(data.errors, context);
1065
- }
1025
+ const doc = take(data, {
1026
+ errors: _json,
1027
+ });
1028
+ Object.assign(contents, doc);
1066
1029
  return contents;
1067
1030
  };
1068
1031
  const de_UpdatePermissionsCommandError = async (output, context) => {
@@ -1089,10 +1052,9 @@ const de_UpdatePermissionsCommandError = async (output, context) => {
1089
1052
  throw await de_ValidationExceptionRes(parsedOutput, context);
1090
1053
  default:
1091
1054
  const parsedBody = parsedOutput.body;
1092
- throwDefaultError({
1055
+ return throwDefaultError({
1093
1056
  output,
1094
1057
  parsedBody,
1095
- exceptionCtor: __BaseException,
1096
1058
  errorCode,
1097
1059
  });
1098
1060
  }
@@ -1105,9 +1067,10 @@ export const de_UpdateWorkspaceCommand = async (output, context) => {
1105
1067
  $metadata: deserializeMetadata(output),
1106
1068
  });
1107
1069
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1108
- if (data.workspace != null) {
1109
- contents.workspace = de_WorkspaceDescription(data.workspace, context);
1110
- }
1070
+ const doc = take(data, {
1071
+ workspace: (_) => de_WorkspaceDescription(_, context),
1072
+ });
1073
+ Object.assign(contents, doc);
1111
1074
  return contents;
1112
1075
  };
1113
1076
  const de_UpdateWorkspaceCommandError = async (output, context) => {
@@ -1137,10 +1100,9 @@ const de_UpdateWorkspaceCommandError = async (output, context) => {
1137
1100
  throw await de_ValidationExceptionRes(parsedOutput, context);
1138
1101
  default:
1139
1102
  const parsedBody = parsedOutput.body;
1140
- throwDefaultError({
1103
+ return throwDefaultError({
1141
1104
  output,
1142
1105
  parsedBody,
1143
- exceptionCtor: __BaseException,
1144
1106
  errorCode,
1145
1107
  });
1146
1108
  }
@@ -1153,9 +1115,10 @@ export const de_UpdateWorkspaceAuthenticationCommand = async (output, context) =
1153
1115
  $metadata: deserializeMetadata(output),
1154
1116
  });
1155
1117
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1156
- if (data.authentication != null) {
1157
- contents.authentication = de_AuthenticationDescription(data.authentication, context);
1158
- }
1118
+ const doc = take(data, {
1119
+ authentication: _json,
1120
+ });
1121
+ Object.assign(contents, doc);
1159
1122
  return contents;
1160
1123
  };
1161
1124
  const de_UpdateWorkspaceAuthenticationCommandError = async (output, context) => {
@@ -1185,10 +1148,9 @@ const de_UpdateWorkspaceAuthenticationCommandError = async (output, context) =>
1185
1148
  throw await de_ValidationExceptionRes(parsedOutput, context);
1186
1149
  default:
1187
1150
  const parsedBody = parsedOutput.body;
1188
- throwDefaultError({
1151
+ return throwDefaultError({
1189
1152
  output,
1190
1153
  parsedBody,
1191
- exceptionCtor: __BaseException,
1192
1154
  errorCode,
1193
1155
  });
1194
1156
  }
@@ -1230,21 +1192,21 @@ const de_UpdateWorkspaceConfigurationCommandError = async (output, context) => {
1230
1192
  throw await de_ValidationExceptionRes(parsedOutput, context);
1231
1193
  default:
1232
1194
  const parsedBody = parsedOutput.body;
1233
- throwDefaultError({
1195
+ return throwDefaultError({
1234
1196
  output,
1235
1197
  parsedBody,
1236
- exceptionCtor: __BaseException,
1237
1198
  errorCode,
1238
1199
  });
1239
1200
  }
1240
1201
  };
1241
- const map = __map;
1202
+ const throwDefaultError = withBaseException(__BaseException);
1242
1203
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1243
1204
  const contents = map({});
1244
1205
  const data = parsedOutput.body;
1245
- if (data.message != null) {
1246
- contents.message = __expectString(data.message);
1247
- }
1206
+ const doc = take(data, {
1207
+ message: __expectString,
1208
+ });
1209
+ Object.assign(contents, doc);
1248
1210
  const exception = new AccessDeniedException({
1249
1211
  $metadata: deserializeMetadata(parsedOutput),
1250
1212
  ...contents,
@@ -1254,15 +1216,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1254
1216
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
1255
1217
  const contents = map({});
1256
1218
  const data = parsedOutput.body;
1257
- if (data.message != null) {
1258
- contents.message = __expectString(data.message);
1259
- }
1260
- if (data.resourceId != null) {
1261
- contents.resourceId = __expectString(data.resourceId);
1262
- }
1263
- if (data.resourceType != null) {
1264
- contents.resourceType = __expectString(data.resourceType);
1265
- }
1219
+ const doc = take(data, {
1220
+ message: __expectString,
1221
+ resourceId: __expectString,
1222
+ resourceType: __expectString,
1223
+ });
1224
+ Object.assign(contents, doc);
1266
1225
  const exception = new ConflictException({
1267
1226
  $metadata: deserializeMetadata(parsedOutput),
1268
1227
  ...contents,
@@ -1277,9 +1236,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1277
1236
  ],
1278
1237
  });
1279
1238
  const data = parsedOutput.body;
1280
- if (data.message != null) {
1281
- contents.message = __expectString(data.message);
1282
- }
1239
+ const doc = take(data, {
1240
+ message: __expectString,
1241
+ });
1242
+ Object.assign(contents, doc);
1283
1243
  const exception = new InternalServerException({
1284
1244
  $metadata: deserializeMetadata(parsedOutput),
1285
1245
  ...contents,
@@ -1289,15 +1249,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1289
1249
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1290
1250
  const contents = map({});
1291
1251
  const data = parsedOutput.body;
1292
- if (data.message != null) {
1293
- contents.message = __expectString(data.message);
1294
- }
1295
- if (data.resourceId != null) {
1296
- contents.resourceId = __expectString(data.resourceId);
1297
- }
1298
- if (data.resourceType != null) {
1299
- contents.resourceType = __expectString(data.resourceType);
1300
- }
1252
+ const doc = take(data, {
1253
+ message: __expectString,
1254
+ resourceId: __expectString,
1255
+ resourceType: __expectString,
1256
+ });
1257
+ Object.assign(contents, doc);
1301
1258
  const exception = new ResourceNotFoundException({
1302
1259
  $metadata: deserializeMetadata(parsedOutput),
1303
1260
  ...contents,
@@ -1307,21 +1264,14 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1307
1264
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1308
1265
  const contents = map({});
1309
1266
  const data = parsedOutput.body;
1310
- if (data.message != null) {
1311
- contents.message = __expectString(data.message);
1312
- }
1313
- if (data.quotaCode != null) {
1314
- contents.quotaCode = __expectString(data.quotaCode);
1315
- }
1316
- if (data.resourceId != null) {
1317
- contents.resourceId = __expectString(data.resourceId);
1318
- }
1319
- if (data.resourceType != null) {
1320
- contents.resourceType = __expectString(data.resourceType);
1321
- }
1322
- if (data.serviceCode != null) {
1323
- contents.serviceCode = __expectString(data.serviceCode);
1324
- }
1267
+ const doc = take(data, {
1268
+ message: __expectString,
1269
+ quotaCode: __expectString,
1270
+ resourceId: __expectString,
1271
+ resourceType: __expectString,
1272
+ serviceCode: __expectString,
1273
+ });
1274
+ Object.assign(contents, doc);
1325
1275
  const exception = new ServiceQuotaExceededException({
1326
1276
  $metadata: deserializeMetadata(parsedOutput),
1327
1277
  ...contents,
@@ -1336,15 +1286,12 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1336
1286
  ],
1337
1287
  });
1338
1288
  const data = parsedOutput.body;
1339
- if (data.message != null) {
1340
- contents.message = __expectString(data.message);
1341
- }
1342
- if (data.quotaCode != null) {
1343
- contents.quotaCode = __expectString(data.quotaCode);
1344
- }
1345
- if (data.serviceCode != null) {
1346
- contents.serviceCode = __expectString(data.serviceCode);
1347
- }
1289
+ const doc = take(data, {
1290
+ message: __expectString,
1291
+ quotaCode: __expectString,
1292
+ serviceCode: __expectString,
1293
+ });
1294
+ Object.assign(contents, doc);
1348
1295
  const exception = new ThrottlingException({
1349
1296
  $metadata: deserializeMetadata(parsedOutput),
1350
1297
  ...contents,
@@ -1354,503 +1301,68 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1354
1301
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1355
1302
  const contents = map({});
1356
1303
  const data = parsedOutput.body;
1357
- if (data.fieldList != null) {
1358
- contents.fieldList = de_ValidationExceptionFieldList(data.fieldList, context);
1359
- }
1360
- if (data.message != null) {
1361
- contents.message = __expectString(data.message);
1362
- }
1363
- if (data.reason != null) {
1364
- contents.reason = __expectString(data.reason);
1365
- }
1304
+ const doc = take(data, {
1305
+ fieldList: _json,
1306
+ message: __expectString,
1307
+ reason: __expectString,
1308
+ });
1309
+ Object.assign(contents, doc);
1366
1310
  const exception = new ValidationException({
1367
1311
  $metadata: deserializeMetadata(parsedOutput),
1368
1312
  ...contents,
1369
1313
  });
1370
1314
  return __decorateServiceException(exception, parsedOutput.body);
1371
1315
  };
1372
- const se_AllowedOrganizations = (input, context) => {
1373
- return input
1374
- .filter((e) => e != null)
1375
- .map((entry) => {
1376
- return entry;
1377
- });
1378
- };
1379
- const se_AssertionAttributes = (input, context) => {
1380
- return {
1381
- ...(input.email != null && { email: input.email }),
1382
- ...(input.groups != null && { groups: input.groups }),
1383
- ...(input.login != null && { login: input.login }),
1384
- ...(input.name != null && { name: input.name }),
1385
- ...(input.org != null && { org: input.org }),
1386
- ...(input.role != null && { role: input.role }),
1387
- };
1388
- };
1389
- const se_AuthenticationProviders = (input, context) => {
1390
- return input
1391
- .filter((e) => e != null)
1392
- .map((entry) => {
1393
- return entry;
1394
- });
1395
- };
1396
- const se_DataSourceTypesList = (input, context) => {
1397
- return input
1398
- .filter((e) => e != null)
1399
- .map((entry) => {
1400
- return entry;
1401
- });
1402
- };
1403
- const se_IdpMetadata = (input, context) => {
1404
- return IdpMetadata.visit(input, {
1405
- url: (value) => ({ url: value }),
1406
- xml: (value) => ({ xml: value }),
1407
- _: (name, value) => ({ name: value }),
1408
- });
1409
- };
1410
- const se_NetworkAccessConfiguration = (input, context) => {
1411
- return {
1412
- ...(input.prefixListIds != null && { prefixListIds: se_PrefixListIds(input.prefixListIds, context) }),
1413
- ...(input.vpceIds != null && { vpceIds: se_VpceIds(input.vpceIds, context) }),
1414
- };
1415
- };
1416
- const se_NotificationDestinationsList = (input, context) => {
1417
- return input
1418
- .filter((e) => e != null)
1419
- .map((entry) => {
1420
- return entry;
1421
- });
1422
- };
1423
- const se_OrganizationalUnitList = (input, context) => {
1424
- return input
1425
- .filter((e) => e != null)
1426
- .map((entry) => {
1427
- return entry;
1428
- });
1429
- };
1430
- const se_PrefixListIds = (input, context) => {
1431
- return input
1432
- .filter((e) => e != null)
1433
- .map((entry) => {
1434
- return entry;
1435
- });
1436
- };
1437
- const se_RoleValueList = (input, context) => {
1438
- return input
1439
- .filter((e) => e != null)
1440
- .map((entry) => {
1441
- return entry;
1442
- });
1443
- };
1444
- const se_RoleValues = (input, context) => {
1445
- return {
1446
- ...(input.admin != null && { admin: se_RoleValueList(input.admin, context) }),
1447
- ...(input.editor != null && { editor: se_RoleValueList(input.editor, context) }),
1448
- };
1449
- };
1450
- const se_SamlConfiguration = (input, context) => {
1451
- return {
1452
- ...(input.allowedOrganizations != null && {
1453
- allowedOrganizations: se_AllowedOrganizations(input.allowedOrganizations, context),
1454
- }),
1455
- ...(input.assertionAttributes != null && {
1456
- assertionAttributes: se_AssertionAttributes(input.assertionAttributes, context),
1457
- }),
1458
- ...(input.idpMetadata != null && { idpMetadata: se_IdpMetadata(input.idpMetadata, context) }),
1459
- ...(input.loginValidityDuration != null && { loginValidityDuration: input.loginValidityDuration }),
1460
- ...(input.roleValues != null && { roleValues: se_RoleValues(input.roleValues, context) }),
1461
- };
1462
- };
1463
- const se_SecurityGroupIds = (input, context) => {
1464
- return input
1465
- .filter((e) => e != null)
1466
- .map((entry) => {
1467
- return entry;
1468
- });
1469
- };
1470
- const se_SubnetIds = (input, context) => {
1471
- return input
1472
- .filter((e) => e != null)
1473
- .map((entry) => {
1474
- return entry;
1475
- });
1476
- };
1477
- const se_TagMap = (input, context) => {
1478
- return Object.entries(input).reduce((acc, [key, value]) => {
1479
- if (value === null) {
1480
- return acc;
1481
- }
1482
- acc[key] = value;
1483
- return acc;
1484
- }, {});
1485
- };
1486
- const se_UpdateInstruction = (input, context) => {
1487
- return {
1488
- ...(input.action != null && { action: input.action }),
1489
- ...(input.role != null && { role: input.role }),
1490
- ...(input.users != null && { users: se_UserList(input.users, context) }),
1491
- };
1492
- };
1493
- const se_UpdateInstructionBatch = (input, context) => {
1494
- return input
1495
- .filter((e) => e != null)
1496
- .map((entry) => {
1497
- return se_UpdateInstruction(entry, context);
1498
- });
1499
- };
1500
- const se_User = (input, context) => {
1501
- return {
1502
- ...(input.id != null && { id: input.id }),
1503
- ...(input.type != null && { type: input.type }),
1504
- };
1505
- };
1506
- const se_UserList = (input, context) => {
1507
- return input
1508
- .filter((e) => e != null)
1509
- .map((entry) => {
1510
- return se_User(entry, context);
1511
- });
1512
- };
1513
- const se_VpcConfiguration = (input, context) => {
1514
- return {
1515
- ...(input.securityGroupIds != null && { securityGroupIds: se_SecurityGroupIds(input.securityGroupIds, context) }),
1516
- ...(input.subnetIds != null && { subnetIds: se_SubnetIds(input.subnetIds, context) }),
1517
- };
1518
- };
1519
- const se_VpceIds = (input, context) => {
1520
- return input
1521
- .filter((e) => e != null)
1522
- .map((entry) => {
1523
- return entry;
1524
- });
1525
- };
1526
- const de_AllowedOrganizations = (output, context) => {
1527
- const retVal = (output || [])
1528
- .filter((e) => e != null)
1529
- .map((entry) => {
1530
- if (entry === null) {
1531
- return null;
1532
- }
1533
- return __expectString(entry);
1534
- });
1535
- return retVal;
1536
- };
1537
- const de_AssertionAttributes = (output, context) => {
1538
- return {
1539
- email: __expectString(output.email),
1540
- groups: __expectString(output.groups),
1541
- login: __expectString(output.login),
1542
- name: __expectString(output.name),
1543
- org: __expectString(output.org),
1544
- role: __expectString(output.role),
1545
- };
1546
- };
1547
- const de_AuthenticationDescription = (output, context) => {
1548
- return {
1549
- awsSso: output.awsSso != null ? de_AwsSsoAuthentication(output.awsSso, context) : undefined,
1550
- providers: output.providers != null ? de_AuthenticationProviders(output.providers, context) : undefined,
1551
- saml: output.saml != null ? de_SamlAuthentication(output.saml, context) : undefined,
1552
- };
1553
- };
1554
- const de_AuthenticationProviders = (output, context) => {
1555
- const retVal = (output || [])
1556
- .filter((e) => e != null)
1557
- .map((entry) => {
1558
- if (entry === null) {
1559
- return null;
1560
- }
1561
- return __expectString(entry);
1562
- });
1563
- return retVal;
1564
- };
1565
- const de_AuthenticationSummary = (output, context) => {
1566
- return {
1567
- providers: output.providers != null ? de_AuthenticationProviders(output.providers, context) : undefined,
1568
- samlConfigurationStatus: __expectString(output.samlConfigurationStatus),
1569
- };
1570
- };
1571
- const de_AwsSsoAuthentication = (output, context) => {
1572
- return {
1573
- ssoClientId: __expectString(output.ssoClientId),
1574
- };
1575
- };
1576
- const de_DataSourceTypesList = (output, context) => {
1577
- const retVal = (output || [])
1578
- .filter((e) => e != null)
1579
- .map((entry) => {
1580
- if (entry === null) {
1581
- return null;
1582
- }
1583
- return __expectString(entry);
1584
- });
1585
- return retVal;
1586
- };
1587
- const de_IdpMetadata = (output, context) => {
1588
- if (__expectString(output.url) !== undefined) {
1589
- return { url: __expectString(output.url) };
1590
- }
1591
- if (__expectString(output.xml) !== undefined) {
1592
- return { xml: __expectString(output.xml) };
1593
- }
1594
- return { $unknown: Object.entries(output)[0] };
1595
- };
1596
- const de_NetworkAccessConfiguration = (output, context) => {
1597
- return {
1598
- prefixListIds: output.prefixListIds != null ? de_PrefixListIds(output.prefixListIds, context) : undefined,
1599
- vpceIds: output.vpceIds != null ? de_VpceIds(output.vpceIds, context) : undefined,
1600
- };
1601
- };
1602
- const de_NotificationDestinationsList = (output, context) => {
1603
- const retVal = (output || [])
1604
- .filter((e) => e != null)
1605
- .map((entry) => {
1606
- if (entry === null) {
1607
- return null;
1608
- }
1609
- return __expectString(entry);
1610
- });
1611
- return retVal;
1612
- };
1613
- const de_OrganizationalUnitList = (output, context) => {
1614
- const retVal = (output || [])
1615
- .filter((e) => e != null)
1616
- .map((entry) => {
1617
- if (entry === null) {
1618
- return null;
1619
- }
1620
- return __expectString(entry);
1621
- });
1622
- return retVal;
1623
- };
1624
- const de_PermissionEntry = (output, context) => {
1625
- return {
1626
- role: __expectString(output.role),
1627
- user: output.user != null ? de_User(output.user, context) : undefined,
1628
- };
1629
- };
1630
- const de_PermissionEntryList = (output, context) => {
1631
- const retVal = (output || [])
1632
- .filter((e) => e != null)
1633
- .map((entry) => {
1634
- if (entry === null) {
1635
- return null;
1636
- }
1637
- return de_PermissionEntry(entry, context);
1638
- });
1639
- return retVal;
1640
- };
1641
- const de_PrefixListIds = (output, context) => {
1642
- const retVal = (output || [])
1643
- .filter((e) => e != null)
1644
- .map((entry) => {
1645
- if (entry === null) {
1646
- return null;
1647
- }
1648
- return __expectString(entry);
1649
- });
1650
- return retVal;
1651
- };
1652
- const de_RoleValueList = (output, context) => {
1653
- const retVal = (output || [])
1654
- .filter((e) => e != null)
1655
- .map((entry) => {
1656
- if (entry === null) {
1657
- return null;
1658
- }
1659
- return __expectString(entry);
1660
- });
1661
- return retVal;
1662
- };
1663
- const de_RoleValues = (output, context) => {
1664
- return {
1665
- admin: output.admin != null ? de_RoleValueList(output.admin, context) : undefined,
1666
- editor: output.editor != null ? de_RoleValueList(output.editor, context) : undefined,
1667
- };
1668
- };
1669
- const de_SamlAuthentication = (output, context) => {
1670
- return {
1671
- configuration: output.configuration != null ? de_SamlConfiguration(output.configuration, context) : undefined,
1672
- status: __expectString(output.status),
1673
- };
1674
- };
1675
- const de_SamlConfiguration = (output, context) => {
1676
- return {
1677
- allowedOrganizations: output.allowedOrganizations != null ? de_AllowedOrganizations(output.allowedOrganizations, context) : undefined,
1678
- assertionAttributes: output.assertionAttributes != null ? de_AssertionAttributes(output.assertionAttributes, context) : undefined,
1679
- idpMetadata: output.idpMetadata != null ? de_IdpMetadata(__expectUnion(output.idpMetadata), context) : undefined,
1680
- loginValidityDuration: __expectInt32(output.loginValidityDuration),
1681
- roleValues: output.roleValues != null ? de_RoleValues(output.roleValues, context) : undefined,
1682
- };
1683
- };
1684
- const de_SecurityGroupIds = (output, context) => {
1685
- const retVal = (output || [])
1686
- .filter((e) => e != null)
1687
- .map((entry) => {
1688
- if (entry === null) {
1689
- return null;
1690
- }
1691
- return __expectString(entry);
1692
- });
1693
- return retVal;
1694
- };
1695
- const de_SubnetIds = (output, context) => {
1696
- const retVal = (output || [])
1697
- .filter((e) => e != null)
1698
- .map((entry) => {
1699
- if (entry === null) {
1700
- return null;
1701
- }
1702
- return __expectString(entry);
1703
- });
1704
- return retVal;
1705
- };
1706
- const de_TagMap = (output, context) => {
1707
- return Object.entries(output).reduce((acc, [key, value]) => {
1708
- if (value === null) {
1709
- return acc;
1710
- }
1711
- acc[key] = __expectString(value);
1712
- return acc;
1713
- }, {});
1714
- };
1715
- const de_UpdateError = (output, context) => {
1716
- return {
1717
- causedBy: output.causedBy != null ? de_UpdateInstruction(output.causedBy, context) : undefined,
1718
- code: __expectInt32(output.code),
1719
- message: __expectString(output.message),
1720
- };
1721
- };
1722
- const de_UpdateErrorList = (output, context) => {
1723
- const retVal = (output || [])
1724
- .filter((e) => e != null)
1725
- .map((entry) => {
1726
- if (entry === null) {
1727
- return null;
1728
- }
1729
- return de_UpdateError(entry, context);
1730
- });
1731
- return retVal;
1732
- };
1733
- const de_UpdateInstruction = (output, context) => {
1734
- return {
1735
- action: __expectString(output.action),
1736
- role: __expectString(output.role),
1737
- users: output.users != null ? de_UserList(output.users, context) : undefined,
1738
- };
1739
- };
1740
- const de_User = (output, context) => {
1741
- return {
1742
- id: __expectString(output.id),
1743
- type: __expectString(output.type),
1744
- };
1745
- };
1746
- const de_UserList = (output, context) => {
1747
- const retVal = (output || [])
1748
- .filter((e) => e != null)
1749
- .map((entry) => {
1750
- if (entry === null) {
1751
- return null;
1752
- }
1753
- return de_User(entry, context);
1754
- });
1755
- return retVal;
1756
- };
1757
- const de_ValidationExceptionField = (output, context) => {
1758
- return {
1759
- message: __expectString(output.message),
1760
- name: __expectString(output.name),
1761
- };
1762
- };
1763
- const de_ValidationExceptionFieldList = (output, context) => {
1764
- const retVal = (output || [])
1765
- .filter((e) => e != null)
1766
- .map((entry) => {
1767
- if (entry === null) {
1768
- return null;
1769
- }
1770
- return de_ValidationExceptionField(entry, context);
1771
- });
1772
- return retVal;
1773
- };
1774
- const de_VpcConfiguration = (output, context) => {
1775
- return {
1776
- securityGroupIds: output.securityGroupIds != null ? de_SecurityGroupIds(output.securityGroupIds, context) : undefined,
1777
- subnetIds: output.subnetIds != null ? de_SubnetIds(output.subnetIds, context) : undefined,
1778
- };
1779
- };
1780
- const de_VpceIds = (output, context) => {
1781
- const retVal = (output || [])
1782
- .filter((e) => e != null)
1783
- .map((entry) => {
1784
- if (entry === null) {
1785
- return null;
1786
- }
1787
- return __expectString(entry);
1788
- });
1789
- return retVal;
1790
- };
1791
1316
  const de_WorkspaceDescription = (output, context) => {
1792
- return {
1793
- accountAccessType: __expectString(output.accountAccessType),
1794
- authentication: output.authentication != null ? de_AuthenticationSummary(output.authentication, context) : undefined,
1795
- created: output.created != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.created))) : undefined,
1796
- dataSources: output.dataSources != null ? de_DataSourceTypesList(output.dataSources, context) : undefined,
1797
- description: __expectString(output.description),
1798
- endpoint: __expectString(output.endpoint),
1799
- freeTrialConsumed: __expectBoolean(output.freeTrialConsumed),
1800
- freeTrialExpiration: output.freeTrialExpiration != null
1801
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.freeTrialExpiration)))
1802
- : undefined,
1803
- grafanaVersion: __expectString(output.grafanaVersion),
1804
- id: __expectString(output.id),
1805
- licenseExpiration: output.licenseExpiration != null
1806
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.licenseExpiration)))
1807
- : undefined,
1808
- licenseType: __expectString(output.licenseType),
1809
- modified: output.modified != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modified))) : undefined,
1810
- name: __expectString(output.name),
1811
- networkAccessControl: output.networkAccessControl != null
1812
- ? de_NetworkAccessConfiguration(output.networkAccessControl, context)
1813
- : undefined,
1814
- notificationDestinations: output.notificationDestinations != null
1815
- ? de_NotificationDestinationsList(output.notificationDestinations, context)
1816
- : undefined,
1817
- organizationRoleName: __expectString(output.organizationRoleName),
1818
- organizationalUnits: output.organizationalUnits != null ? de_OrganizationalUnitList(output.organizationalUnits, context) : undefined,
1819
- permissionType: __expectString(output.permissionType),
1820
- stackSetName: __expectString(output.stackSetName),
1821
- status: __expectString(output.status),
1822
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1823
- vpcConfiguration: output.vpcConfiguration != null ? de_VpcConfiguration(output.vpcConfiguration, context) : undefined,
1824
- workspaceRoleArn: __expectString(output.workspaceRoleArn),
1825
- };
1317
+ return take(output, {
1318
+ accountAccessType: __expectString,
1319
+ authentication: _json,
1320
+ created: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1321
+ dataSources: _json,
1322
+ description: __expectString,
1323
+ endpoint: __expectString,
1324
+ freeTrialConsumed: __expectBoolean,
1325
+ freeTrialExpiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1326
+ grafanaVersion: __expectString,
1327
+ id: __expectString,
1328
+ licenseExpiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1329
+ licenseType: __expectString,
1330
+ modified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1331
+ name: __expectString,
1332
+ networkAccessControl: _json,
1333
+ notificationDestinations: _json,
1334
+ organizationRoleName: __expectString,
1335
+ organizationalUnits: _json,
1336
+ permissionType: __expectString,
1337
+ stackSetName: __expectString,
1338
+ status: __expectString,
1339
+ tags: _json,
1340
+ vpcConfiguration: _json,
1341
+ workspaceRoleArn: __expectString,
1342
+ });
1826
1343
  };
1827
1344
  const de_WorkspaceList = (output, context) => {
1828
1345
  const retVal = (output || [])
1829
1346
  .filter((e) => e != null)
1830
1347
  .map((entry) => {
1831
- if (entry === null) {
1832
- return null;
1833
- }
1834
1348
  return de_WorkspaceSummary(entry, context);
1835
1349
  });
1836
1350
  return retVal;
1837
1351
  };
1838
1352
  const de_WorkspaceSummary = (output, context) => {
1839
- return {
1840
- authentication: output.authentication != null ? de_AuthenticationSummary(output.authentication, context) : undefined,
1841
- created: output.created != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.created))) : undefined,
1842
- description: __expectString(output.description),
1843
- endpoint: __expectString(output.endpoint),
1844
- grafanaVersion: __expectString(output.grafanaVersion),
1845
- id: __expectString(output.id),
1846
- modified: output.modified != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modified))) : undefined,
1847
- name: __expectString(output.name),
1848
- notificationDestinations: output.notificationDestinations != null
1849
- ? de_NotificationDestinationsList(output.notificationDestinations, context)
1850
- : undefined,
1851
- status: __expectString(output.status),
1852
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1853
- };
1353
+ return take(output, {
1354
+ authentication: _json,
1355
+ created: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1356
+ description: __expectString,
1357
+ endpoint: __expectString,
1358
+ grafanaVersion: __expectString,
1359
+ id: __expectString,
1360
+ modified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1361
+ name: __expectString,
1362
+ notificationDestinations: _json,
1363
+ status: __expectString,
1364
+ tags: _json,
1365
+ });
1854
1366
  };
1855
1367
  const deserializeMetadata = (output) => ({
1856
1368
  httpStatusCode: output.statusCode,