@aws-sdk/client-finspace-data 3.105.0 → 3.111.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +7 -7
  3. package/dist-cjs/FinspaceData.js +75 -0
  4. package/dist-cjs/commands/AssociateUserToPermissionGroupCommand.js +36 -0
  5. package/dist-cjs/commands/DisassociateUserFromPermissionGroupCommand.js +36 -0
  6. package/dist-cjs/commands/GetPermissionGroupCommand.js +36 -0
  7. package/dist-cjs/commands/ListPermissionGroupsByUserCommand.js +36 -0
  8. package/dist-cjs/commands/ListUsersByPermissionGroupCommand.js +36 -0
  9. package/dist-cjs/commands/index.js +5 -0
  10. package/dist-cjs/models/models_0.js +128 -41
  11. package/dist-cjs/protocols/Aws_restJson1.js +477 -1
  12. package/dist-es/FinspaceData.js +75 -0
  13. package/dist-es/commands/AssociateUserToPermissionGroupCommand.js +39 -0
  14. package/dist-es/commands/DisassociateUserFromPermissionGroupCommand.js +39 -0
  15. package/dist-es/commands/GetPermissionGroupCommand.js +39 -0
  16. package/dist-es/commands/ListPermissionGroupsByUserCommand.js +39 -0
  17. package/dist-es/commands/ListUsersByPermissionGroupCommand.js +39 -0
  18. package/dist-es/commands/index.js +5 -0
  19. package/dist-es/models/models_0.js +86 -30
  20. package/dist-es/protocols/Aws_restJson1.js +615 -10
  21. package/dist-types/FinspaceData.d.ts +35 -0
  22. package/dist-types/FinspaceDataClient.d.ts +7 -2
  23. package/dist-types/commands/AssociateUserToPermissionGroupCommand.d.ts +35 -0
  24. package/dist-types/commands/DisassociateUserFromPermissionGroupCommand.d.ts +35 -0
  25. package/dist-types/commands/GetPermissionGroupCommand.d.ts +35 -0
  26. package/dist-types/commands/ListPermissionGroupsByUserCommand.d.ts +35 -0
  27. package/dist-types/commands/ListUsersByPermissionGroupCommand.d.ts +35 -0
  28. package/dist-types/commands/index.d.ts +5 -0
  29. package/dist-types/models/models_0.d.ts +411 -96
  30. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  31. package/dist-types/ts3.4/FinspaceData.d.ts +25 -0
  32. package/dist-types/ts3.4/FinspaceDataClient.d.ts +7 -2
  33. package/dist-types/ts3.4/commands/AssociateUserToPermissionGroupCommand.d.ts +17 -0
  34. package/dist-types/ts3.4/commands/DisassociateUserFromPermissionGroupCommand.d.ts +17 -0
  35. package/dist-types/ts3.4/commands/GetPermissionGroupCommand.d.ts +17 -0
  36. package/dist-types/ts3.4/commands/ListPermissionGroupsByUserCommand.d.ts +17 -0
  37. package/dist-types/ts3.4/commands/ListUsersByPermissionGroupCommand.d.ts +17 -0
  38. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  39. package/dist-types/ts3.4/models/models_0.d.ts +189 -44
  40. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
  41. package/package.json +29 -29
@@ -1,11 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UpdateUserCommand = exports.deserializeAws_restJson1UpdatePermissionGroupCommand = exports.deserializeAws_restJson1UpdateDatasetCommand = exports.deserializeAws_restJson1UpdateChangesetCommand = exports.deserializeAws_restJson1ResetUserPasswordCommand = exports.deserializeAws_restJson1ListUsersCommand = exports.deserializeAws_restJson1ListPermissionGroupsCommand = exports.deserializeAws_restJson1ListDataViewsCommand = exports.deserializeAws_restJson1ListDatasetsCommand = exports.deserializeAws_restJson1ListChangesetsCommand = exports.deserializeAws_restJson1GetWorkingLocationCommand = exports.deserializeAws_restJson1GetUserCommand = exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.deserializeAws_restJson1GetDataViewCommand = exports.deserializeAws_restJson1GetDatasetCommand = exports.deserializeAws_restJson1GetChangesetCommand = exports.deserializeAws_restJson1EnableUserCommand = exports.deserializeAws_restJson1DisableUserCommand = exports.deserializeAws_restJson1DeletePermissionGroupCommand = exports.deserializeAws_restJson1DeleteDatasetCommand = exports.deserializeAws_restJson1CreateUserCommand = exports.deserializeAws_restJson1CreatePermissionGroupCommand = exports.deserializeAws_restJson1CreateDataViewCommand = exports.deserializeAws_restJson1CreateDatasetCommand = exports.deserializeAws_restJson1CreateChangesetCommand = exports.serializeAws_restJson1UpdateUserCommand = exports.serializeAws_restJson1UpdatePermissionGroupCommand = exports.serializeAws_restJson1UpdateDatasetCommand = exports.serializeAws_restJson1UpdateChangesetCommand = exports.serializeAws_restJson1ResetUserPasswordCommand = exports.serializeAws_restJson1ListUsersCommand = exports.serializeAws_restJson1ListPermissionGroupsCommand = exports.serializeAws_restJson1ListDataViewsCommand = exports.serializeAws_restJson1ListDatasetsCommand = exports.serializeAws_restJson1ListChangesetsCommand = exports.serializeAws_restJson1GetWorkingLocationCommand = exports.serializeAws_restJson1GetUserCommand = exports.serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.serializeAws_restJson1GetDataViewCommand = exports.serializeAws_restJson1GetDatasetCommand = exports.serializeAws_restJson1GetChangesetCommand = exports.serializeAws_restJson1EnableUserCommand = exports.serializeAws_restJson1DisableUserCommand = exports.serializeAws_restJson1DeletePermissionGroupCommand = exports.serializeAws_restJson1DeleteDatasetCommand = exports.serializeAws_restJson1CreateUserCommand = exports.serializeAws_restJson1CreatePermissionGroupCommand = exports.serializeAws_restJson1CreateDataViewCommand = exports.serializeAws_restJson1CreateDatasetCommand = exports.serializeAws_restJson1CreateChangesetCommand = void 0;
3
+ exports.deserializeAws_restJson1ListDatasetsCommand = exports.deserializeAws_restJson1ListChangesetsCommand = exports.deserializeAws_restJson1GetWorkingLocationCommand = exports.deserializeAws_restJson1GetUserCommand = exports.deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.deserializeAws_restJson1GetPermissionGroupCommand = exports.deserializeAws_restJson1GetDataViewCommand = exports.deserializeAws_restJson1GetDatasetCommand = exports.deserializeAws_restJson1GetChangesetCommand = exports.deserializeAws_restJson1EnableUserCommand = exports.deserializeAws_restJson1DisassociateUserFromPermissionGroupCommand = exports.deserializeAws_restJson1DisableUserCommand = exports.deserializeAws_restJson1DeletePermissionGroupCommand = exports.deserializeAws_restJson1DeleteDatasetCommand = exports.deserializeAws_restJson1CreateUserCommand = exports.deserializeAws_restJson1CreatePermissionGroupCommand = exports.deserializeAws_restJson1CreateDataViewCommand = exports.deserializeAws_restJson1CreateDatasetCommand = exports.deserializeAws_restJson1CreateChangesetCommand = exports.deserializeAws_restJson1AssociateUserToPermissionGroupCommand = exports.serializeAws_restJson1UpdateUserCommand = exports.serializeAws_restJson1UpdatePermissionGroupCommand = exports.serializeAws_restJson1UpdateDatasetCommand = exports.serializeAws_restJson1UpdateChangesetCommand = exports.serializeAws_restJson1ResetUserPasswordCommand = exports.serializeAws_restJson1ListUsersByPermissionGroupCommand = exports.serializeAws_restJson1ListUsersCommand = exports.serializeAws_restJson1ListPermissionGroupsByUserCommand = exports.serializeAws_restJson1ListPermissionGroupsCommand = exports.serializeAws_restJson1ListDataViewsCommand = exports.serializeAws_restJson1ListDatasetsCommand = exports.serializeAws_restJson1ListChangesetsCommand = exports.serializeAws_restJson1GetWorkingLocationCommand = exports.serializeAws_restJson1GetUserCommand = exports.serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = exports.serializeAws_restJson1GetPermissionGroupCommand = exports.serializeAws_restJson1GetDataViewCommand = exports.serializeAws_restJson1GetDatasetCommand = exports.serializeAws_restJson1GetChangesetCommand = exports.serializeAws_restJson1EnableUserCommand = exports.serializeAws_restJson1DisassociateUserFromPermissionGroupCommand = exports.serializeAws_restJson1DisableUserCommand = exports.serializeAws_restJson1DeletePermissionGroupCommand = exports.serializeAws_restJson1DeleteDatasetCommand = exports.serializeAws_restJson1CreateUserCommand = exports.serializeAws_restJson1CreatePermissionGroupCommand = exports.serializeAws_restJson1CreateDataViewCommand = exports.serializeAws_restJson1CreateDatasetCommand = exports.serializeAws_restJson1CreateChangesetCommand = exports.serializeAws_restJson1AssociateUserToPermissionGroupCommand = void 0;
4
+ exports.deserializeAws_restJson1UpdateUserCommand = exports.deserializeAws_restJson1UpdatePermissionGroupCommand = exports.deserializeAws_restJson1UpdateDatasetCommand = exports.deserializeAws_restJson1UpdateChangesetCommand = exports.deserializeAws_restJson1ResetUserPasswordCommand = exports.deserializeAws_restJson1ListUsersByPermissionGroupCommand = exports.deserializeAws_restJson1ListUsersCommand = exports.deserializeAws_restJson1ListPermissionGroupsByUserCommand = exports.deserializeAws_restJson1ListPermissionGroupsCommand = exports.deserializeAws_restJson1ListDataViewsCommand = void 0;
4
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
7
  const uuid_1 = require("uuid");
7
8
  const FinspaceDataServiceException_1 = require("../models/FinspaceDataServiceException");
8
9
  const models_0_1 = require("../models/models_0");
10
+ const serializeAws_restJson1AssociateUserToPermissionGroupCommand = async (input, context) => {
11
+ var _a;
12
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
13
+ const headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
17
+ "/permission-group/{permissionGroupId}/users/{userId}";
18
+ if (input.permissionGroupId !== undefined) {
19
+ const labelValue = input.permissionGroupId;
20
+ if (labelValue.length <= 0) {
21
+ throw new Error("Empty value provided for input HTTP label: permissionGroupId.");
22
+ }
23
+ resolvedPath = resolvedPath.replace("{permissionGroupId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
24
+ }
25
+ else {
26
+ throw new Error("No value provided for input HTTP label: permissionGroupId.");
27
+ }
28
+ if (input.userId !== undefined) {
29
+ const labelValue = input.userId;
30
+ if (labelValue.length <= 0) {
31
+ throw new Error("Empty value provided for input HTTP label: userId.");
32
+ }
33
+ resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
34
+ }
35
+ else {
36
+ throw new Error("No value provided for input HTTP label: userId.");
37
+ }
38
+ let body;
39
+ body = JSON.stringify({
40
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
41
+ });
42
+ return new protocol_http_1.HttpRequest({
43
+ protocol,
44
+ hostname,
45
+ port,
46
+ method: "POST",
47
+ headers,
48
+ path: resolvedPath,
49
+ body,
50
+ });
51
+ };
52
+ exports.serializeAws_restJson1AssociateUserToPermissionGroupCommand = serializeAws_restJson1AssociateUserToPermissionGroupCommand;
9
53
  const serializeAws_restJson1CreateChangesetCommand = async (input, context) => {
10
54
  var _a;
11
55
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -273,6 +317,47 @@ const serializeAws_restJson1DisableUserCommand = async (input, context) => {
273
317
  });
274
318
  };
275
319
  exports.serializeAws_restJson1DisableUserCommand = serializeAws_restJson1DisableUserCommand;
320
+ const serializeAws_restJson1DisassociateUserFromPermissionGroupCommand = async (input, context) => {
321
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
322
+ const headers = {};
323
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
324
+ "/permission-group/{permissionGroupId}/users/{userId}";
325
+ if (input.permissionGroupId !== undefined) {
326
+ const labelValue = input.permissionGroupId;
327
+ if (labelValue.length <= 0) {
328
+ throw new Error("Empty value provided for input HTTP label: permissionGroupId.");
329
+ }
330
+ resolvedPath = resolvedPath.replace("{permissionGroupId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
331
+ }
332
+ else {
333
+ throw new Error("No value provided for input HTTP label: permissionGroupId.");
334
+ }
335
+ if (input.userId !== undefined) {
336
+ const labelValue = input.userId;
337
+ if (labelValue.length <= 0) {
338
+ throw new Error("Empty value provided for input HTTP label: userId.");
339
+ }
340
+ resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
341
+ }
342
+ else {
343
+ throw new Error("No value provided for input HTTP label: userId.");
344
+ }
345
+ const query = {
346
+ ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
347
+ };
348
+ let body;
349
+ return new protocol_http_1.HttpRequest({
350
+ protocol,
351
+ hostname,
352
+ port,
353
+ method: "DELETE",
354
+ headers,
355
+ path: resolvedPath,
356
+ query,
357
+ body,
358
+ });
359
+ };
360
+ exports.serializeAws_restJson1DisassociateUserFromPermissionGroupCommand = serializeAws_restJson1DisassociateUserFromPermissionGroupCommand;
276
361
  const serializeAws_restJson1EnableUserCommand = async (input, context) => {
277
362
  var _a;
278
363
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -405,6 +490,32 @@ const serializeAws_restJson1GetDataViewCommand = async (input, context) => {
405
490
  });
406
491
  };
407
492
  exports.serializeAws_restJson1GetDataViewCommand = serializeAws_restJson1GetDataViewCommand;
493
+ const serializeAws_restJson1GetPermissionGroupCommand = async (input, context) => {
494
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
495
+ const headers = {};
496
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/permission-group/{permissionGroupId}";
497
+ if (input.permissionGroupId !== undefined) {
498
+ const labelValue = input.permissionGroupId;
499
+ if (labelValue.length <= 0) {
500
+ throw new Error("Empty value provided for input HTTP label: permissionGroupId.");
501
+ }
502
+ resolvedPath = resolvedPath.replace("{permissionGroupId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
503
+ }
504
+ else {
505
+ throw new Error("No value provided for input HTTP label: permissionGroupId.");
506
+ }
507
+ let body;
508
+ return new protocol_http_1.HttpRequest({
509
+ protocol,
510
+ hostname,
511
+ port,
512
+ method: "GET",
513
+ headers,
514
+ path: resolvedPath,
515
+ body,
516
+ });
517
+ };
518
+ exports.serializeAws_restJson1GetPermissionGroupCommand = serializeAws_restJson1GetPermissionGroupCommand;
408
519
  const serializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (input, context) => {
409
520
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
410
521
  const headers = {};
@@ -577,6 +688,37 @@ const serializeAws_restJson1ListPermissionGroupsCommand = async (input, context)
577
688
  });
578
689
  };
579
690
  exports.serializeAws_restJson1ListPermissionGroupsCommand = serializeAws_restJson1ListPermissionGroupsCommand;
691
+ const serializeAws_restJson1ListPermissionGroupsByUserCommand = async (input, context) => {
692
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
693
+ const headers = {};
694
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/user/{userId}/permission-groups";
695
+ if (input.userId !== undefined) {
696
+ const labelValue = input.userId;
697
+ if (labelValue.length <= 0) {
698
+ throw new Error("Empty value provided for input HTTP label: userId.");
699
+ }
700
+ resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
701
+ }
702
+ else {
703
+ throw new Error("No value provided for input HTTP label: userId.");
704
+ }
705
+ const query = {
706
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
707
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
708
+ };
709
+ let body;
710
+ return new protocol_http_1.HttpRequest({
711
+ protocol,
712
+ hostname,
713
+ port,
714
+ method: "GET",
715
+ headers,
716
+ path: resolvedPath,
717
+ query,
718
+ body,
719
+ });
720
+ };
721
+ exports.serializeAws_restJson1ListPermissionGroupsByUserCommand = serializeAws_restJson1ListPermissionGroupsByUserCommand;
580
722
  const serializeAws_restJson1ListUsersCommand = async (input, context) => {
581
723
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
582
724
  const headers = {};
@@ -598,6 +740,38 @@ const serializeAws_restJson1ListUsersCommand = async (input, context) => {
598
740
  });
599
741
  };
600
742
  exports.serializeAws_restJson1ListUsersCommand = serializeAws_restJson1ListUsersCommand;
743
+ const serializeAws_restJson1ListUsersByPermissionGroupCommand = async (input, context) => {
744
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
745
+ const headers = {};
746
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
747
+ "/permission-group/{permissionGroupId}/users";
748
+ if (input.permissionGroupId !== undefined) {
749
+ const labelValue = input.permissionGroupId;
750
+ if (labelValue.length <= 0) {
751
+ throw new Error("Empty value provided for input HTTP label: permissionGroupId.");
752
+ }
753
+ resolvedPath = resolvedPath.replace("{permissionGroupId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
754
+ }
755
+ else {
756
+ throw new Error("No value provided for input HTTP label: permissionGroupId.");
757
+ }
758
+ const query = {
759
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
760
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
761
+ };
762
+ let body;
763
+ return new protocol_http_1.HttpRequest({
764
+ protocol,
765
+ hostname,
766
+ port,
767
+ method: "GET",
768
+ headers,
769
+ path: resolvedPath,
770
+ query,
771
+ body,
772
+ });
773
+ };
774
+ exports.serializeAws_restJson1ListUsersByPermissionGroupCommand = serializeAws_restJson1ListUsersByPermissionGroupCommand;
601
775
  const serializeAws_restJson1ResetUserPasswordCommand = async (input, context) => {
602
776
  var _a;
603
777
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -794,6 +968,58 @@ const serializeAws_restJson1UpdateUserCommand = async (input, context) => {
794
968
  });
795
969
  };
796
970
  exports.serializeAws_restJson1UpdateUserCommand = serializeAws_restJson1UpdateUserCommand;
971
+ const deserializeAws_restJson1AssociateUserToPermissionGroupCommand = async (output, context) => {
972
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
973
+ return deserializeAws_restJson1AssociateUserToPermissionGroupCommandError(output, context);
974
+ }
975
+ const contents = {
976
+ $metadata: deserializeMetadata(output),
977
+ statusCode: undefined,
978
+ };
979
+ if (contents.statusCode === undefined) {
980
+ contents.statusCode = output.statusCode;
981
+ }
982
+ await collectBody(output.body, context);
983
+ return Promise.resolve(contents);
984
+ };
985
+ exports.deserializeAws_restJson1AssociateUserToPermissionGroupCommand = deserializeAws_restJson1AssociateUserToPermissionGroupCommand;
986
+ const deserializeAws_restJson1AssociateUserToPermissionGroupCommandError = async (output, context) => {
987
+ const parsedOutput = {
988
+ ...output,
989
+ body: await parseBody(output.body, context),
990
+ };
991
+ let response;
992
+ let errorCode = "UnknownError";
993
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
994
+ switch (errorCode) {
995
+ case "AccessDeniedException":
996
+ case "com.amazonaws.finspacedata#AccessDeniedException":
997
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
998
+ case "ConflictException":
999
+ case "com.amazonaws.finspacedata#ConflictException":
1000
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1001
+ case "InternalServerException":
1002
+ case "com.amazonaws.finspacedata#InternalServerException":
1003
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1004
+ case "ResourceNotFoundException":
1005
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1006
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1007
+ case "ThrottlingException":
1008
+ case "com.amazonaws.finspacedata#ThrottlingException":
1009
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1010
+ case "ValidationException":
1011
+ case "com.amazonaws.finspacedata#ValidationException":
1012
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1013
+ default:
1014
+ const parsedBody = parsedOutput.body;
1015
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1016
+ name: parsedBody.code || parsedBody.Code || errorCode,
1017
+ $fault: "client",
1018
+ $metadata: deserializeMetadata(output),
1019
+ });
1020
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1021
+ }
1022
+ };
797
1023
  const deserializeAws_restJson1CreateChangesetCommand = async (output, context) => {
798
1024
  if (output.statusCode !== 200 && output.statusCode >= 300) {
799
1025
  return deserializeAws_restJson1CreateChangesetCommandError(output, context);
@@ -1230,6 +1456,58 @@ const deserializeAws_restJson1DisableUserCommandError = async (output, context)
1230
1456
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1231
1457
  }
1232
1458
  };
1459
+ const deserializeAws_restJson1DisassociateUserFromPermissionGroupCommand = async (output, context) => {
1460
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1461
+ return deserializeAws_restJson1DisassociateUserFromPermissionGroupCommandError(output, context);
1462
+ }
1463
+ const contents = {
1464
+ $metadata: deserializeMetadata(output),
1465
+ statusCode: undefined,
1466
+ };
1467
+ if (contents.statusCode === undefined) {
1468
+ contents.statusCode = output.statusCode;
1469
+ }
1470
+ await collectBody(output.body, context);
1471
+ return Promise.resolve(contents);
1472
+ };
1473
+ exports.deserializeAws_restJson1DisassociateUserFromPermissionGroupCommand = deserializeAws_restJson1DisassociateUserFromPermissionGroupCommand;
1474
+ const deserializeAws_restJson1DisassociateUserFromPermissionGroupCommandError = async (output, context) => {
1475
+ const parsedOutput = {
1476
+ ...output,
1477
+ body: await parseBody(output.body, context),
1478
+ };
1479
+ let response;
1480
+ let errorCode = "UnknownError";
1481
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1482
+ switch (errorCode) {
1483
+ case "AccessDeniedException":
1484
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1485
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1486
+ case "ConflictException":
1487
+ case "com.amazonaws.finspacedata#ConflictException":
1488
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1489
+ case "InternalServerException":
1490
+ case "com.amazonaws.finspacedata#InternalServerException":
1491
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1492
+ case "ResourceNotFoundException":
1493
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1494
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1495
+ case "ThrottlingException":
1496
+ case "com.amazonaws.finspacedata#ThrottlingException":
1497
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1498
+ case "ValidationException":
1499
+ case "com.amazonaws.finspacedata#ValidationException":
1500
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1501
+ default:
1502
+ const parsedBody = parsedOutput.body;
1503
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1504
+ name: parsedBody.code || parsedBody.Code || errorCode,
1505
+ $fault: "client",
1506
+ $metadata: deserializeMetadata(output),
1507
+ });
1508
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1509
+ }
1510
+ };
1233
1511
  const deserializeAws_restJson1EnableUserCommand = async (output, context) => {
1234
1512
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1235
1513
  return deserializeAws_restJson1EnableUserCommandError(output, context);
@@ -1566,6 +1844,55 @@ const deserializeAws_restJson1GetDataViewCommandError = async (output, context)
1566
1844
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1567
1845
  }
1568
1846
  };
1847
+ const deserializeAws_restJson1GetPermissionGroupCommand = async (output, context) => {
1848
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1849
+ return deserializeAws_restJson1GetPermissionGroupCommandError(output, context);
1850
+ }
1851
+ const contents = {
1852
+ $metadata: deserializeMetadata(output),
1853
+ permissionGroup: undefined,
1854
+ };
1855
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1856
+ if (data.permissionGroup !== undefined && data.permissionGroup !== null) {
1857
+ contents.permissionGroup = deserializeAws_restJson1PermissionGroup(data.permissionGroup, context);
1858
+ }
1859
+ return Promise.resolve(contents);
1860
+ };
1861
+ exports.deserializeAws_restJson1GetPermissionGroupCommand = deserializeAws_restJson1GetPermissionGroupCommand;
1862
+ const deserializeAws_restJson1GetPermissionGroupCommandError = async (output, context) => {
1863
+ const parsedOutput = {
1864
+ ...output,
1865
+ body: await parseBody(output.body, context),
1866
+ };
1867
+ let response;
1868
+ let errorCode = "UnknownError";
1869
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1870
+ switch (errorCode) {
1871
+ case "AccessDeniedException":
1872
+ case "com.amazonaws.finspacedata#AccessDeniedException":
1873
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1874
+ case "InternalServerException":
1875
+ case "com.amazonaws.finspacedata#InternalServerException":
1876
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1877
+ case "ResourceNotFoundException":
1878
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
1879
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1880
+ case "ThrottlingException":
1881
+ case "com.amazonaws.finspacedata#ThrottlingException":
1882
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1883
+ case "ValidationException":
1884
+ case "com.amazonaws.finspacedata#ValidationException":
1885
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1886
+ default:
1887
+ const parsedBody = parsedOutput.body;
1888
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1889
+ name: parsedBody.code || parsedBody.Code || errorCode,
1890
+ $fault: "client",
1891
+ $metadata: deserializeMetadata(output),
1892
+ });
1893
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1894
+ }
1895
+ };
1569
1896
  const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (output, context) => {
1570
1897
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1571
1898
  return deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError(output, context);
@@ -1979,6 +2306,59 @@ const deserializeAws_restJson1ListPermissionGroupsCommandError = async (output,
1979
2306
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1980
2307
  }
1981
2308
  };
2309
+ const deserializeAws_restJson1ListPermissionGroupsByUserCommand = async (output, context) => {
2310
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2311
+ return deserializeAws_restJson1ListPermissionGroupsByUserCommandError(output, context);
2312
+ }
2313
+ const contents = {
2314
+ $metadata: deserializeMetadata(output),
2315
+ nextToken: undefined,
2316
+ permissionGroups: undefined,
2317
+ };
2318
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2319
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2320
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2321
+ }
2322
+ if (data.permissionGroups !== undefined && data.permissionGroups !== null) {
2323
+ contents.permissionGroups = deserializeAws_restJson1PermissionGroupByUserList(data.permissionGroups, context);
2324
+ }
2325
+ return Promise.resolve(contents);
2326
+ };
2327
+ exports.deserializeAws_restJson1ListPermissionGroupsByUserCommand = deserializeAws_restJson1ListPermissionGroupsByUserCommand;
2328
+ const deserializeAws_restJson1ListPermissionGroupsByUserCommandError = async (output, context) => {
2329
+ const parsedOutput = {
2330
+ ...output,
2331
+ body: await parseBody(output.body, context),
2332
+ };
2333
+ let response;
2334
+ let errorCode = "UnknownError";
2335
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2336
+ switch (errorCode) {
2337
+ case "AccessDeniedException":
2338
+ case "com.amazonaws.finspacedata#AccessDeniedException":
2339
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2340
+ case "InternalServerException":
2341
+ case "com.amazonaws.finspacedata#InternalServerException":
2342
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2343
+ case "ResourceNotFoundException":
2344
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
2345
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2346
+ case "ThrottlingException":
2347
+ case "com.amazonaws.finspacedata#ThrottlingException":
2348
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2349
+ case "ValidationException":
2350
+ case "com.amazonaws.finspacedata#ValidationException":
2351
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2352
+ default:
2353
+ const parsedBody = parsedOutput.body;
2354
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
2355
+ name: parsedBody.code || parsedBody.Code || errorCode,
2356
+ $fault: "client",
2357
+ $metadata: deserializeMetadata(output),
2358
+ });
2359
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2360
+ }
2361
+ };
1982
2362
  const deserializeAws_restJson1ListUsersCommand = async (output, context) => {
1983
2363
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1984
2364
  return deserializeAws_restJson1ListUsersCommandError(output, context);
@@ -2029,6 +2409,59 @@ const deserializeAws_restJson1ListUsersCommandError = async (output, context) =>
2029
2409
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2030
2410
  }
2031
2411
  };
2412
+ const deserializeAws_restJson1ListUsersByPermissionGroupCommand = async (output, context) => {
2413
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2414
+ return deserializeAws_restJson1ListUsersByPermissionGroupCommandError(output, context);
2415
+ }
2416
+ const contents = {
2417
+ $metadata: deserializeMetadata(output),
2418
+ nextToken: undefined,
2419
+ users: undefined,
2420
+ };
2421
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2422
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2423
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2424
+ }
2425
+ if (data.users !== undefined && data.users !== null) {
2426
+ contents.users = deserializeAws_restJson1UserByPermissionGroupList(data.users, context);
2427
+ }
2428
+ return Promise.resolve(contents);
2429
+ };
2430
+ exports.deserializeAws_restJson1ListUsersByPermissionGroupCommand = deserializeAws_restJson1ListUsersByPermissionGroupCommand;
2431
+ const deserializeAws_restJson1ListUsersByPermissionGroupCommandError = async (output, context) => {
2432
+ const parsedOutput = {
2433
+ ...output,
2434
+ body: await parseBody(output.body, context),
2435
+ };
2436
+ let response;
2437
+ let errorCode = "UnknownError";
2438
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2439
+ switch (errorCode) {
2440
+ case "AccessDeniedException":
2441
+ case "com.amazonaws.finspacedata#AccessDeniedException":
2442
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2443
+ case "InternalServerException":
2444
+ case "com.amazonaws.finspacedata#InternalServerException":
2445
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2446
+ case "ResourceNotFoundException":
2447
+ case "com.amazonaws.finspacedata#ResourceNotFoundException":
2448
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2449
+ case "ThrottlingException":
2450
+ case "com.amazonaws.finspacedata#ThrottlingException":
2451
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2452
+ case "ValidationException":
2453
+ case "com.amazonaws.finspacedata#ValidationException":
2454
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2455
+ default:
2456
+ const parsedBody = parsedOutput.body;
2457
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
2458
+ name: parsedBody.code || parsedBody.Code || errorCode,
2459
+ $fault: "client",
2460
+ $metadata: deserializeMetadata(output),
2461
+ });
2462
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2463
+ }
2464
+ };
2032
2465
  const deserializeAws_restJson1ResetUserPasswordCommand = async (output, context) => {
2033
2466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2034
2467
  return deserializeAws_restJson1ResetUserPasswordCommandError(output, context);
@@ -2745,10 +3178,29 @@ const deserializeAws_restJson1PermissionGroup = (output, context) => {
2745
3178
  createTime: (0, smithy_client_1.expectLong)(output.createTime),
2746
3179
  description: (0, smithy_client_1.expectString)(output.description),
2747
3180
  lastModifiedTime: (0, smithy_client_1.expectLong)(output.lastModifiedTime),
3181
+ membershipStatus: (0, smithy_client_1.expectString)(output.membershipStatus),
2748
3182
  name: (0, smithy_client_1.expectString)(output.name),
2749
3183
  permissionGroupId: (0, smithy_client_1.expectString)(output.permissionGroupId),
2750
3184
  };
2751
3185
  };
3186
+ const deserializeAws_restJson1PermissionGroupByUser = (output, context) => {
3187
+ return {
3188
+ membershipStatus: (0, smithy_client_1.expectString)(output.membershipStatus),
3189
+ name: (0, smithy_client_1.expectString)(output.name),
3190
+ permissionGroupId: (0, smithy_client_1.expectString)(output.permissionGroupId),
3191
+ };
3192
+ };
3193
+ const deserializeAws_restJson1PermissionGroupByUserList = (output, context) => {
3194
+ const retVal = (output || [])
3195
+ .filter((e) => e != null)
3196
+ .map((entry) => {
3197
+ if (entry === null) {
3198
+ return null;
3199
+ }
3200
+ return deserializeAws_restJson1PermissionGroupByUser(entry, context);
3201
+ });
3202
+ return retVal;
3203
+ };
2752
3204
  const deserializeAws_restJson1PermissionGroupList = (output, context) => {
2753
3205
  const retVal = (output || [])
2754
3206
  .filter((e) => e != null)
@@ -2827,6 +3279,30 @@ const deserializeAws_restJson1User = (output, context) => {
2827
3279
  userId: (0, smithy_client_1.expectString)(output.userId),
2828
3280
  };
2829
3281
  };
3282
+ const deserializeAws_restJson1UserByPermissionGroup = (output, context) => {
3283
+ return {
3284
+ apiAccess: (0, smithy_client_1.expectString)(output.apiAccess),
3285
+ apiAccessPrincipalArn: (0, smithy_client_1.expectString)(output.apiAccessPrincipalArn),
3286
+ emailAddress: (0, smithy_client_1.expectString)(output.emailAddress),
3287
+ firstName: (0, smithy_client_1.expectString)(output.firstName),
3288
+ lastName: (0, smithy_client_1.expectString)(output.lastName),
3289
+ membershipStatus: (0, smithy_client_1.expectString)(output.membershipStatus),
3290
+ status: (0, smithy_client_1.expectString)(output.status),
3291
+ type: (0, smithy_client_1.expectString)(output.type),
3292
+ userId: (0, smithy_client_1.expectString)(output.userId),
3293
+ };
3294
+ };
3295
+ const deserializeAws_restJson1UserByPermissionGroupList = (output, context) => {
3296
+ const retVal = (output || [])
3297
+ .filter((e) => e != null)
3298
+ .map((entry) => {
3299
+ if (entry === null) {
3300
+ return null;
3301
+ }
3302
+ return deserializeAws_restJson1UserByPermissionGroup(entry, context);
3303
+ });
3304
+ return retVal;
3305
+ };
2830
3306
  const deserializeAws_restJson1UserList = (output, context) => {
2831
3307
  const retVal = (output || [])
2832
3308
  .filter((e) => e != null)