@aws-sdk/client-detective 3.45.0 → 3.46.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 (60) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +41 -13
  3. package/dist-cjs/Detective.js +75 -0
  4. package/dist-cjs/commands/DescribeOrganizationConfigurationCommand.js +36 -0
  5. package/dist-cjs/commands/DisableOrganizationAdminAccountCommand.js +35 -0
  6. package/dist-cjs/commands/EnableOrganizationAdminAccountCommand.js +36 -0
  7. package/dist-cjs/commands/ListOrganizationAdminAccountsCommand.js +36 -0
  8. package/dist-cjs/commands/UpdateOrganizationConfigurationCommand.js +36 -0
  9. package/dist-cjs/commands/index.js +5 -0
  10. package/dist-cjs/models/models_0.js +54 -1
  11. package/dist-cjs/pagination/ListOrganizationAdminAccountsPaginator.js +35 -0
  12. package/dist-cjs/pagination/index.js +1 -0
  13. package/dist-cjs/protocols/Aws_restJson1.js +451 -1
  14. package/dist-cjs/runtimeConfig.js +0 -2
  15. package/dist-es/Detective.js +75 -0
  16. package/dist-es/commands/DescribeOrganizationConfigurationCommand.js +39 -0
  17. package/dist-es/commands/DisableOrganizationAdminAccountCommand.js +38 -0
  18. package/dist-es/commands/EnableOrganizationAdminAccountCommand.js +39 -0
  19. package/dist-es/commands/ListOrganizationAdminAccountsCommand.js +39 -0
  20. package/dist-es/commands/UpdateOrganizationConfigurationCommand.js +39 -0
  21. package/dist-es/commands/index.js +5 -0
  22. package/dist-es/models/models_0.js +37 -0
  23. package/dist-es/pagination/ListOrganizationAdminAccountsPaginator.js +74 -0
  24. package/dist-es/pagination/index.js +1 -0
  25. package/dist-es/protocols/Aws_restJson1.js +533 -1
  26. package/dist-es/runtimeConfig.js +0 -2
  27. package/dist-types/Detective.d.ts +154 -42
  28. package/dist-types/DetectiveClient.d.ts +49 -16
  29. package/dist-types/commands/CreateGraphCommand.d.ts +9 -9
  30. package/dist-types/commands/CreateMembersCommand.d.ts +17 -7
  31. package/dist-types/commands/DeleteGraphCommand.d.ts +1 -1
  32. package/dist-types/commands/DeleteMembersCommand.d.ts +13 -5
  33. package/dist-types/commands/DescribeOrganizationConfigurationCommand.d.ts +38 -0
  34. package/dist-types/commands/DisableOrganizationAdminAccountCommand.d.ts +38 -0
  35. package/dist-types/commands/DisassociateMembershipCommand.d.ts +6 -1
  36. package/dist-types/commands/EnableOrganizationAdminAccountCommand.d.ts +42 -0
  37. package/dist-types/commands/ListInvitationsCommand.d.ts +1 -1
  38. package/dist-types/commands/ListMembersCommand.d.ts +6 -2
  39. package/dist-types/commands/ListOrganizationAdminAccountsCommand.d.ts +36 -0
  40. package/dist-types/commands/RejectInvitationCommand.d.ts +6 -1
  41. package/dist-types/commands/StartMonitoringMemberCommand.d.ts +1 -1
  42. package/dist-types/commands/UpdateOrganizationConfigurationCommand.d.ts +37 -0
  43. package/dist-types/commands/index.d.ts +5 -0
  44. package/dist-types/models/models_0.d.ts +234 -71
  45. package/dist-types/pagination/ListOrganizationAdminAccountsPaginator.d.ts +4 -0
  46. package/dist-types/pagination/index.d.ts +1 -0
  47. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  48. package/dist-types/ts3.4/Detective.d.ts +25 -0
  49. package/dist-types/ts3.4/DetectiveClient.d.ts +7 -2
  50. package/dist-types/ts3.4/commands/DescribeOrganizationConfigurationCommand.d.ts +17 -0
  51. package/dist-types/ts3.4/commands/DisableOrganizationAdminAccountCommand.d.ts +16 -0
  52. package/dist-types/ts3.4/commands/EnableOrganizationAdminAccountCommand.d.ts +17 -0
  53. package/dist-types/ts3.4/commands/ListOrganizationAdminAccountsCommand.d.ts +17 -0
  54. package/dist-types/ts3.4/commands/UpdateOrganizationConfigurationCommand.d.ts +17 -0
  55. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  56. package/dist-types/ts3.4/models/models_0.d.ts +83 -0
  57. package/dist-types/ts3.4/pagination/ListOrganizationAdminAccountsPaginator.d.ts +4 -0
  58. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  59. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
  60. package/package.json +36 -43
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartMonitoringMemberCommand = exports.deserializeAws_restJson1RejectInvitationCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListMembersCommand = exports.deserializeAws_restJson1ListInvitationsCommand = exports.deserializeAws_restJson1ListGraphsCommand = exports.deserializeAws_restJson1GetMembersCommand = exports.deserializeAws_restJson1DisassociateMembershipCommand = exports.deserializeAws_restJson1DeleteMembersCommand = exports.deserializeAws_restJson1DeleteGraphCommand = exports.deserializeAws_restJson1CreateMembersCommand = exports.deserializeAws_restJson1CreateGraphCommand = exports.deserializeAws_restJson1AcceptInvitationCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StartMonitoringMemberCommand = exports.serializeAws_restJson1RejectInvitationCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListMembersCommand = exports.serializeAws_restJson1ListInvitationsCommand = exports.serializeAws_restJson1ListGraphsCommand = exports.serializeAws_restJson1GetMembersCommand = exports.serializeAws_restJson1DisassociateMembershipCommand = exports.serializeAws_restJson1DeleteMembersCommand = exports.serializeAws_restJson1DeleteGraphCommand = exports.serializeAws_restJson1CreateMembersCommand = exports.serializeAws_restJson1CreateGraphCommand = exports.serializeAws_restJson1AcceptInvitationCommand = void 0;
3
+ exports.deserializeAws_restJson1UpdateOrganizationConfigurationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartMonitoringMemberCommand = exports.deserializeAws_restJson1RejectInvitationCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListOrganizationAdminAccountsCommand = exports.deserializeAws_restJson1ListMembersCommand = exports.deserializeAws_restJson1ListInvitationsCommand = exports.deserializeAws_restJson1ListGraphsCommand = exports.deserializeAws_restJson1GetMembersCommand = exports.deserializeAws_restJson1EnableOrganizationAdminAccountCommand = exports.deserializeAws_restJson1DisassociateMembershipCommand = exports.deserializeAws_restJson1DisableOrganizationAdminAccountCommand = exports.deserializeAws_restJson1DescribeOrganizationConfigurationCommand = exports.deserializeAws_restJson1DeleteMembersCommand = exports.deserializeAws_restJson1DeleteGraphCommand = exports.deserializeAws_restJson1CreateMembersCommand = exports.deserializeAws_restJson1CreateGraphCommand = exports.deserializeAws_restJson1AcceptInvitationCommand = exports.serializeAws_restJson1UpdateOrganizationConfigurationCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StartMonitoringMemberCommand = exports.serializeAws_restJson1RejectInvitationCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListOrganizationAdminAccountsCommand = exports.serializeAws_restJson1ListMembersCommand = exports.serializeAws_restJson1ListInvitationsCommand = exports.serializeAws_restJson1ListGraphsCommand = exports.serializeAws_restJson1GetMembersCommand = exports.serializeAws_restJson1EnableOrganizationAdminAccountCommand = exports.serializeAws_restJson1DisassociateMembershipCommand = exports.serializeAws_restJson1DisableOrganizationAdminAccountCommand = exports.serializeAws_restJson1DescribeOrganizationConfigurationCommand = exports.serializeAws_restJson1DeleteMembersCommand = exports.serializeAws_restJson1DeleteGraphCommand = exports.serializeAws_restJson1CreateMembersCommand = exports.serializeAws_restJson1CreateGraphCommand = exports.serializeAws_restJson1AcceptInvitationCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const serializeAws_restJson1AcceptInvitationCommand = async (input, context) => {
@@ -115,6 +115,46 @@ const serializeAws_restJson1DeleteMembersCommand = async (input, context) => {
115
115
  });
116
116
  };
117
117
  exports.serializeAws_restJson1DeleteMembersCommand = serializeAws_restJson1DeleteMembersCommand;
118
+ const serializeAws_restJson1DescribeOrganizationConfigurationCommand = async (input, context) => {
119
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
120
+ const headers = {
121
+ "content-type": "application/json",
122
+ };
123
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/describeOrganizationConfiguration";
124
+ let body;
125
+ body = JSON.stringify({
126
+ ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }),
127
+ });
128
+ return new protocol_http_1.HttpRequest({
129
+ protocol,
130
+ hostname,
131
+ port,
132
+ method: "POST",
133
+ headers,
134
+ path: resolvedPath,
135
+ body,
136
+ });
137
+ };
138
+ exports.serializeAws_restJson1DescribeOrganizationConfigurationCommand = serializeAws_restJson1DescribeOrganizationConfigurationCommand;
139
+ const serializeAws_restJson1DisableOrganizationAdminAccountCommand = async (input, context) => {
140
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
141
+ const headers = {
142
+ "content-type": "application/json",
143
+ };
144
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/disableAdminAccount";
145
+ let body;
146
+ body = "";
147
+ return new protocol_http_1.HttpRequest({
148
+ protocol,
149
+ hostname,
150
+ port,
151
+ method: "POST",
152
+ headers,
153
+ path: resolvedPath,
154
+ body,
155
+ });
156
+ };
157
+ exports.serializeAws_restJson1DisableOrganizationAdminAccountCommand = serializeAws_restJson1DisableOrganizationAdminAccountCommand;
118
158
  const serializeAws_restJson1DisassociateMembershipCommand = async (input, context) => {
119
159
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
120
160
  const headers = {
@@ -136,6 +176,27 @@ const serializeAws_restJson1DisassociateMembershipCommand = async (input, contex
136
176
  });
137
177
  };
138
178
  exports.serializeAws_restJson1DisassociateMembershipCommand = serializeAws_restJson1DisassociateMembershipCommand;
179
+ const serializeAws_restJson1EnableOrganizationAdminAccountCommand = async (input, context) => {
180
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
+ const headers = {
182
+ "content-type": "application/json",
183
+ };
184
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/enableAdminAccount";
185
+ let body;
186
+ body = JSON.stringify({
187
+ ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),
188
+ });
189
+ return new protocol_http_1.HttpRequest({
190
+ protocol,
191
+ hostname,
192
+ port,
193
+ method: "POST",
194
+ headers,
195
+ path: resolvedPath,
196
+ body,
197
+ });
198
+ };
199
+ exports.serializeAws_restJson1EnableOrganizationAdminAccountCommand = serializeAws_restJson1EnableOrganizationAdminAccountCommand;
139
200
  const serializeAws_restJson1GetMembersCommand = async (input, context) => {
140
201
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
141
202
  const headers = {
@@ -226,6 +287,28 @@ const serializeAws_restJson1ListMembersCommand = async (input, context) => {
226
287
  });
227
288
  };
228
289
  exports.serializeAws_restJson1ListMembersCommand = serializeAws_restJson1ListMembersCommand;
290
+ const serializeAws_restJson1ListOrganizationAdminAccountsCommand = async (input, context) => {
291
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
292
+ const headers = {
293
+ "content-type": "application/json",
294
+ };
295
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/adminAccountslist";
296
+ let body;
297
+ body = JSON.stringify({
298
+ ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
299
+ ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
300
+ });
301
+ return new protocol_http_1.HttpRequest({
302
+ protocol,
303
+ hostname,
304
+ port,
305
+ method: "POST",
306
+ headers,
307
+ path: resolvedPath,
308
+ body,
309
+ });
310
+ };
311
+ exports.serializeAws_restJson1ListOrganizationAdminAccountsCommand = serializeAws_restJson1ListOrganizationAdminAccountsCommand;
229
312
  const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
230
313
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
231
314
  const headers = {};
@@ -356,6 +439,28 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
356
439
  });
357
440
  };
358
441
  exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
442
+ const serializeAws_restJson1UpdateOrganizationConfigurationCommand = async (input, context) => {
443
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
444
+ const headers = {
445
+ "content-type": "application/json",
446
+ };
447
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/updateOrganizationConfiguration";
448
+ let body;
449
+ body = JSON.stringify({
450
+ ...(input.AutoEnable !== undefined && input.AutoEnable !== null && { AutoEnable: input.AutoEnable }),
451
+ ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }),
452
+ });
453
+ return new protocol_http_1.HttpRequest({
454
+ protocol,
455
+ hostname,
456
+ port,
457
+ method: "POST",
458
+ headers,
459
+ path: resolvedPath,
460
+ body,
461
+ });
462
+ };
463
+ exports.serializeAws_restJson1UpdateOrganizationConfigurationCommand = serializeAws_restJson1UpdateOrganizationConfigurationCommand;
359
464
  const deserializeAws_restJson1AcceptInvitationCommand = async (output, context) => {
360
465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
361
466
  return deserializeAws_restJson1AcceptInvitationCommandError(output, context);
@@ -700,6 +805,130 @@ const deserializeAws_restJson1DeleteMembersCommandError = async (output, context
700
805
  delete response.Message;
701
806
  return Promise.reject(Object.assign(new Error(message), response));
702
807
  };
808
+ const deserializeAws_restJson1DescribeOrganizationConfigurationCommand = async (output, context) => {
809
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
810
+ return deserializeAws_restJson1DescribeOrganizationConfigurationCommandError(output, context);
811
+ }
812
+ const contents = {
813
+ $metadata: deserializeMetadata(output),
814
+ AutoEnable: undefined,
815
+ };
816
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
817
+ if (data.AutoEnable !== undefined && data.AutoEnable !== null) {
818
+ contents.AutoEnable = smithy_client_1.expectBoolean(data.AutoEnable);
819
+ }
820
+ return Promise.resolve(contents);
821
+ };
822
+ exports.deserializeAws_restJson1DescribeOrganizationConfigurationCommand = deserializeAws_restJson1DescribeOrganizationConfigurationCommand;
823
+ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = async (output, context) => {
824
+ const parsedOutput = {
825
+ ...output,
826
+ body: await parseBody(output.body, context),
827
+ };
828
+ let response;
829
+ let errorCode = "UnknownError";
830
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
831
+ switch (errorCode) {
832
+ case "InternalServerException":
833
+ case "com.amazonaws.detective#InternalServerException":
834
+ response = {
835
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
836
+ name: errorCode,
837
+ $metadata: deserializeMetadata(output),
838
+ };
839
+ break;
840
+ case "TooManyRequestsException":
841
+ case "com.amazonaws.detective#TooManyRequestsException":
842
+ response = {
843
+ ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
844
+ name: errorCode,
845
+ $metadata: deserializeMetadata(output),
846
+ };
847
+ break;
848
+ case "ValidationException":
849
+ case "com.amazonaws.detective#ValidationException":
850
+ response = {
851
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
852
+ name: errorCode,
853
+ $metadata: deserializeMetadata(output),
854
+ };
855
+ break;
856
+ default:
857
+ const parsedBody = parsedOutput.body;
858
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
859
+ response = {
860
+ ...parsedBody,
861
+ name: `${errorCode}`,
862
+ message: parsedBody.message || parsedBody.Message || errorCode,
863
+ $fault: "client",
864
+ $metadata: deserializeMetadata(output),
865
+ };
866
+ }
867
+ const message = response.message || response.Message || errorCode;
868
+ response.message = message;
869
+ delete response.Message;
870
+ return Promise.reject(Object.assign(new Error(message), response));
871
+ };
872
+ const deserializeAws_restJson1DisableOrganizationAdminAccountCommand = async (output, context) => {
873
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
874
+ return deserializeAws_restJson1DisableOrganizationAdminAccountCommandError(output, context);
875
+ }
876
+ const contents = {
877
+ $metadata: deserializeMetadata(output),
878
+ };
879
+ await collectBody(output.body, context);
880
+ return Promise.resolve(contents);
881
+ };
882
+ exports.deserializeAws_restJson1DisableOrganizationAdminAccountCommand = deserializeAws_restJson1DisableOrganizationAdminAccountCommand;
883
+ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = async (output, context) => {
884
+ const parsedOutput = {
885
+ ...output,
886
+ body: await parseBody(output.body, context),
887
+ };
888
+ let response;
889
+ let errorCode = "UnknownError";
890
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
891
+ switch (errorCode) {
892
+ case "InternalServerException":
893
+ case "com.amazonaws.detective#InternalServerException":
894
+ response = {
895
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
896
+ name: errorCode,
897
+ $metadata: deserializeMetadata(output),
898
+ };
899
+ break;
900
+ case "TooManyRequestsException":
901
+ case "com.amazonaws.detective#TooManyRequestsException":
902
+ response = {
903
+ ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
904
+ name: errorCode,
905
+ $metadata: deserializeMetadata(output),
906
+ };
907
+ break;
908
+ case "ValidationException":
909
+ case "com.amazonaws.detective#ValidationException":
910
+ response = {
911
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
912
+ name: errorCode,
913
+ $metadata: deserializeMetadata(output),
914
+ };
915
+ break;
916
+ default:
917
+ const parsedBody = parsedOutput.body;
918
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
919
+ response = {
920
+ ...parsedBody,
921
+ name: `${errorCode}`,
922
+ message: parsedBody.message || parsedBody.Message || errorCode,
923
+ $fault: "client",
924
+ $metadata: deserializeMetadata(output),
925
+ };
926
+ }
927
+ const message = response.message || response.Message || errorCode;
928
+ response.message = message;
929
+ delete response.Message;
930
+ return Promise.reject(Object.assign(new Error(message), response));
931
+ };
703
932
  const deserializeAws_restJson1DisassociateMembershipCommand = async (output, context) => {
704
933
  if (output.statusCode !== 200 && output.statusCode >= 300) {
705
934
  return deserializeAws_restJson1DisassociateMembershipCommandError(output, context);
@@ -768,6 +997,66 @@ const deserializeAws_restJson1DisassociateMembershipCommandError = async (output
768
997
  delete response.Message;
769
998
  return Promise.reject(Object.assign(new Error(message), response));
770
999
  };
1000
+ const deserializeAws_restJson1EnableOrganizationAdminAccountCommand = async (output, context) => {
1001
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1002
+ return deserializeAws_restJson1EnableOrganizationAdminAccountCommandError(output, context);
1003
+ }
1004
+ const contents = {
1005
+ $metadata: deserializeMetadata(output),
1006
+ };
1007
+ await collectBody(output.body, context);
1008
+ return Promise.resolve(contents);
1009
+ };
1010
+ exports.deserializeAws_restJson1EnableOrganizationAdminAccountCommand = deserializeAws_restJson1EnableOrganizationAdminAccountCommand;
1011
+ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async (output, context) => {
1012
+ const parsedOutput = {
1013
+ ...output,
1014
+ body: await parseBody(output.body, context),
1015
+ };
1016
+ let response;
1017
+ let errorCode = "UnknownError";
1018
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1019
+ switch (errorCode) {
1020
+ case "InternalServerException":
1021
+ case "com.amazonaws.detective#InternalServerException":
1022
+ response = {
1023
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1024
+ name: errorCode,
1025
+ $metadata: deserializeMetadata(output),
1026
+ };
1027
+ break;
1028
+ case "TooManyRequestsException":
1029
+ case "com.amazonaws.detective#TooManyRequestsException":
1030
+ response = {
1031
+ ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1032
+ name: errorCode,
1033
+ $metadata: deserializeMetadata(output),
1034
+ };
1035
+ break;
1036
+ case "ValidationException":
1037
+ case "com.amazonaws.detective#ValidationException":
1038
+ response = {
1039
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1040
+ name: errorCode,
1041
+ $metadata: deserializeMetadata(output),
1042
+ };
1043
+ break;
1044
+ default:
1045
+ const parsedBody = parsedOutput.body;
1046
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1047
+ response = {
1048
+ ...parsedBody,
1049
+ name: `${errorCode}`,
1050
+ message: parsedBody.message || parsedBody.Message || errorCode,
1051
+ $fault: "client",
1052
+ $metadata: deserializeMetadata(output),
1053
+ };
1054
+ }
1055
+ const message = response.message || response.Message || errorCode;
1056
+ response.message = message;
1057
+ delete response.Message;
1058
+ return Promise.reject(Object.assign(new Error(message), response));
1059
+ };
771
1060
  const deserializeAws_restJson1GetMembersCommand = async (output, context) => {
772
1061
  if (output.statusCode !== 200 && output.statusCode >= 300) {
773
1062
  return deserializeAws_restJson1GetMembersCommandError(output, context);
@@ -1024,6 +1313,74 @@ const deserializeAws_restJson1ListMembersCommandError = async (output, context)
1024
1313
  delete response.Message;
1025
1314
  return Promise.reject(Object.assign(new Error(message), response));
1026
1315
  };
1316
+ const deserializeAws_restJson1ListOrganizationAdminAccountsCommand = async (output, context) => {
1317
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1318
+ return deserializeAws_restJson1ListOrganizationAdminAccountsCommandError(output, context);
1319
+ }
1320
+ const contents = {
1321
+ $metadata: deserializeMetadata(output),
1322
+ Administrators: undefined,
1323
+ NextToken: undefined,
1324
+ };
1325
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1326
+ if (data.Administrators !== undefined && data.Administrators !== null) {
1327
+ contents.Administrators = deserializeAws_restJson1AdministratorList(data.Administrators, context);
1328
+ }
1329
+ if (data.NextToken !== undefined && data.NextToken !== null) {
1330
+ contents.NextToken = smithy_client_1.expectString(data.NextToken);
1331
+ }
1332
+ return Promise.resolve(contents);
1333
+ };
1334
+ exports.deserializeAws_restJson1ListOrganizationAdminAccountsCommand = deserializeAws_restJson1ListOrganizationAdminAccountsCommand;
1335
+ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async (output, context) => {
1336
+ const parsedOutput = {
1337
+ ...output,
1338
+ body: await parseBody(output.body, context),
1339
+ };
1340
+ let response;
1341
+ let errorCode = "UnknownError";
1342
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1343
+ switch (errorCode) {
1344
+ case "InternalServerException":
1345
+ case "com.amazonaws.detective#InternalServerException":
1346
+ response = {
1347
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1348
+ name: errorCode,
1349
+ $metadata: deserializeMetadata(output),
1350
+ };
1351
+ break;
1352
+ case "TooManyRequestsException":
1353
+ case "com.amazonaws.detective#TooManyRequestsException":
1354
+ response = {
1355
+ ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1356
+ name: errorCode,
1357
+ $metadata: deserializeMetadata(output),
1358
+ };
1359
+ break;
1360
+ case "ValidationException":
1361
+ case "com.amazonaws.detective#ValidationException":
1362
+ response = {
1363
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1364
+ name: errorCode,
1365
+ $metadata: deserializeMetadata(output),
1366
+ };
1367
+ break;
1368
+ default:
1369
+ const parsedBody = parsedOutput.body;
1370
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1371
+ response = {
1372
+ ...parsedBody,
1373
+ name: `${errorCode}`,
1374
+ message: parsedBody.message || parsedBody.Message || errorCode,
1375
+ $fault: "client",
1376
+ $metadata: deserializeMetadata(output),
1377
+ };
1378
+ }
1379
+ const message = response.message || response.Message || errorCode;
1380
+ response.message = message;
1381
+ delete response.Message;
1382
+ return Promise.reject(Object.assign(new Error(message), response));
1383
+ };
1027
1384
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1028
1385
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1029
1386
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
@@ -1352,6 +1709,66 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1352
1709
  delete response.Message;
1353
1710
  return Promise.reject(Object.assign(new Error(message), response));
1354
1711
  };
1712
+ const deserializeAws_restJson1UpdateOrganizationConfigurationCommand = async (output, context) => {
1713
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1714
+ return deserializeAws_restJson1UpdateOrganizationConfigurationCommandError(output, context);
1715
+ }
1716
+ const contents = {
1717
+ $metadata: deserializeMetadata(output),
1718
+ };
1719
+ await collectBody(output.body, context);
1720
+ return Promise.resolve(contents);
1721
+ };
1722
+ exports.deserializeAws_restJson1UpdateOrganizationConfigurationCommand = deserializeAws_restJson1UpdateOrganizationConfigurationCommand;
1723
+ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = async (output, context) => {
1724
+ const parsedOutput = {
1725
+ ...output,
1726
+ body: await parseBody(output.body, context),
1727
+ };
1728
+ let response;
1729
+ let errorCode = "UnknownError";
1730
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1731
+ switch (errorCode) {
1732
+ case "InternalServerException":
1733
+ case "com.amazonaws.detective#InternalServerException":
1734
+ response = {
1735
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1736
+ name: errorCode,
1737
+ $metadata: deserializeMetadata(output),
1738
+ };
1739
+ break;
1740
+ case "TooManyRequestsException":
1741
+ case "com.amazonaws.detective#TooManyRequestsException":
1742
+ response = {
1743
+ ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1744
+ name: errorCode,
1745
+ $metadata: deserializeMetadata(output),
1746
+ };
1747
+ break;
1748
+ case "ValidationException":
1749
+ case "com.amazonaws.detective#ValidationException":
1750
+ response = {
1751
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1752
+ name: errorCode,
1753
+ $metadata: deserializeMetadata(output),
1754
+ };
1755
+ break;
1756
+ default:
1757
+ const parsedBody = parsedOutput.body;
1758
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1759
+ response = {
1760
+ ...parsedBody,
1761
+ name: `${errorCode}`,
1762
+ message: parsedBody.message || parsedBody.Message || errorCode,
1763
+ $fault: "client",
1764
+ $metadata: deserializeMetadata(output),
1765
+ };
1766
+ }
1767
+ const message = response.message || response.Message || errorCode;
1768
+ response.message = message;
1769
+ delete response.Message;
1770
+ return Promise.reject(Object.assign(new Error(message), response));
1771
+ };
1355
1772
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1356
1773
  const contents = {
1357
1774
  name: "ConflictException",
@@ -1404,6 +1821,19 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
1404
1821
  }
1405
1822
  return contents;
1406
1823
  };
1824
+ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1825
+ const contents = {
1826
+ name: "TooManyRequestsException",
1827
+ $fault: "client",
1828
+ $metadata: deserializeMetadata(parsedOutput),
1829
+ Message: undefined,
1830
+ };
1831
+ const data = parsedOutput.body;
1832
+ if (data.Message !== undefined && data.Message !== null) {
1833
+ contents.Message = smithy_client_1.expectString(data.Message);
1834
+ }
1835
+ return contents;
1836
+ };
1407
1837
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1408
1838
  const contents = {
1409
1839
  name: "ValidationException",
@@ -1464,6 +1894,25 @@ const deserializeAws_restJson1AccountIdList = (output, context) => {
1464
1894
  return smithy_client_1.expectString(entry);
1465
1895
  });
1466
1896
  };
1897
+ const deserializeAws_restJson1Administrator = (output, context) => {
1898
+ return {
1899
+ AccountId: smithy_client_1.expectString(output.AccountId),
1900
+ DelegationTime: output.DelegationTime !== undefined && output.DelegationTime !== null
1901
+ ? smithy_client_1.expectNonNull(smithy_client_1.parseRfc3339DateTime(output.DelegationTime))
1902
+ : undefined,
1903
+ GraphArn: smithy_client_1.expectString(output.GraphArn),
1904
+ };
1905
+ };
1906
+ const deserializeAws_restJson1AdministratorList = (output, context) => {
1907
+ return (output || [])
1908
+ .filter((e) => e != null)
1909
+ .map((entry) => {
1910
+ if (entry === null) {
1911
+ return null;
1912
+ }
1913
+ return deserializeAws_restJson1Administrator(entry, context);
1914
+ });
1915
+ };
1467
1916
  const deserializeAws_restJson1Graph = (output, context) => {
1468
1917
  return {
1469
1918
  Arn: smithy_client_1.expectString(output.Arn),
@@ -1489,6 +1938,7 @@ const deserializeAws_restJson1MemberDetail = (output, context) => {
1489
1938
  DisabledReason: smithy_client_1.expectString(output.DisabledReason),
1490
1939
  EmailAddress: smithy_client_1.expectString(output.EmailAddress),
1491
1940
  GraphArn: smithy_client_1.expectString(output.GraphArn),
1941
+ InvitationType: smithy_client_1.expectString(output.InvitationType),
1492
1942
  InvitedTime: output.InvitedTime !== undefined && output.InvitedTime !== null
1493
1943
  ? smithy_client_1.expectNonNull(smithy_client_1.parseRfc3339DateTime(output.InvitedTime))
1494
1944
  : undefined,
@@ -15,10 +15,8 @@ const util_body_length_node_1 = require("@aws-sdk/util-body-length-node");
15
15
  const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
16
16
  const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
17
17
  const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
18
- const smithy_client_1 = require("@aws-sdk/smithy-client");
19
18
  const getRuntimeConfig = (config) => {
20
19
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
21
- smithy_client_1.emitWarningIfUnsupportedVersion(process.version);
22
20
  const clientSharedValues = runtimeConfig_shared_1.getRuntimeConfig(config);
23
21
  return {
24
22
  ...clientSharedValues,
@@ -4,16 +4,21 @@ import { CreateGraphCommand } from "./commands/CreateGraphCommand";
4
4
  import { CreateMembersCommand, } from "./commands/CreateMembersCommand";
5
5
  import { DeleteGraphCommand } from "./commands/DeleteGraphCommand";
6
6
  import { DeleteMembersCommand, } from "./commands/DeleteMembersCommand";
7
+ import { DescribeOrganizationConfigurationCommand, } from "./commands/DescribeOrganizationConfigurationCommand";
8
+ import { DisableOrganizationAdminAccountCommand, } from "./commands/DisableOrganizationAdminAccountCommand";
7
9
  import { DisassociateMembershipCommand, } from "./commands/DisassociateMembershipCommand";
10
+ import { EnableOrganizationAdminAccountCommand, } from "./commands/EnableOrganizationAdminAccountCommand";
8
11
  import { GetMembersCommand } from "./commands/GetMembersCommand";
9
12
  import { ListGraphsCommand } from "./commands/ListGraphsCommand";
10
13
  import { ListInvitationsCommand, } from "./commands/ListInvitationsCommand";
11
14
  import { ListMembersCommand } from "./commands/ListMembersCommand";
15
+ import { ListOrganizationAdminAccountsCommand, } from "./commands/ListOrganizationAdminAccountsCommand";
12
16
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
13
17
  import { RejectInvitationCommand, } from "./commands/RejectInvitationCommand";
14
18
  import { StartMonitoringMemberCommand, } from "./commands/StartMonitoringMemberCommand";
15
19
  import { TagResourceCommand } from "./commands/TagResourceCommand";
16
20
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
21
+ import { UpdateOrganizationConfigurationCommand, } from "./commands/UpdateOrganizationConfigurationCommand";
17
22
  import { DetectiveClient } from "./DetectiveClient";
18
23
  var Detective = (function (_super) {
19
24
  __extends(Detective, _super);
@@ -90,6 +95,34 @@ var Detective = (function (_super) {
90
95
  return this.send(command, optionsOrCb);
91
96
  }
92
97
  };
98
+ Detective.prototype.describeOrganizationConfiguration = function (args, optionsOrCb, cb) {
99
+ var command = new DescribeOrganizationConfigurationCommand(args);
100
+ if (typeof optionsOrCb === "function") {
101
+ this.send(command, optionsOrCb);
102
+ }
103
+ else if (typeof cb === "function") {
104
+ if (typeof optionsOrCb !== "object")
105
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
106
+ this.send(command, optionsOrCb || {}, cb);
107
+ }
108
+ else {
109
+ return this.send(command, optionsOrCb);
110
+ }
111
+ };
112
+ Detective.prototype.disableOrganizationAdminAccount = function (args, optionsOrCb, cb) {
113
+ var command = new DisableOrganizationAdminAccountCommand(args);
114
+ if (typeof optionsOrCb === "function") {
115
+ this.send(command, optionsOrCb);
116
+ }
117
+ else if (typeof cb === "function") {
118
+ if (typeof optionsOrCb !== "object")
119
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
120
+ this.send(command, optionsOrCb || {}, cb);
121
+ }
122
+ else {
123
+ return this.send(command, optionsOrCb);
124
+ }
125
+ };
93
126
  Detective.prototype.disassociateMembership = function (args, optionsOrCb, cb) {
94
127
  var command = new DisassociateMembershipCommand(args);
95
128
  if (typeof optionsOrCb === "function") {
@@ -104,6 +137,20 @@ var Detective = (function (_super) {
104
137
  return this.send(command, optionsOrCb);
105
138
  }
106
139
  };
140
+ Detective.prototype.enableOrganizationAdminAccount = function (args, optionsOrCb, cb) {
141
+ var command = new EnableOrganizationAdminAccountCommand(args);
142
+ if (typeof optionsOrCb === "function") {
143
+ this.send(command, optionsOrCb);
144
+ }
145
+ else if (typeof cb === "function") {
146
+ if (typeof optionsOrCb !== "object")
147
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
148
+ this.send(command, optionsOrCb || {}, cb);
149
+ }
150
+ else {
151
+ return this.send(command, optionsOrCb);
152
+ }
153
+ };
107
154
  Detective.prototype.getMembers = function (args, optionsOrCb, cb) {
108
155
  var command = new GetMembersCommand(args);
109
156
  if (typeof optionsOrCb === "function") {
@@ -160,6 +207,20 @@ var Detective = (function (_super) {
160
207
  return this.send(command, optionsOrCb);
161
208
  }
162
209
  };
210
+ Detective.prototype.listOrganizationAdminAccounts = function (args, optionsOrCb, cb) {
211
+ var command = new ListOrganizationAdminAccountsCommand(args);
212
+ if (typeof optionsOrCb === "function") {
213
+ this.send(command, optionsOrCb);
214
+ }
215
+ else if (typeof cb === "function") {
216
+ if (typeof optionsOrCb !== "object")
217
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
218
+ this.send(command, optionsOrCb || {}, cb);
219
+ }
220
+ else {
221
+ return this.send(command, optionsOrCb);
222
+ }
223
+ };
163
224
  Detective.prototype.listTagsForResource = function (args, optionsOrCb, cb) {
164
225
  var command = new ListTagsForResourceCommand(args);
165
226
  if (typeof optionsOrCb === "function") {
@@ -230,6 +291,20 @@ var Detective = (function (_super) {
230
291
  return this.send(command, optionsOrCb);
231
292
  }
232
293
  };
294
+ Detective.prototype.updateOrganizationConfiguration = function (args, optionsOrCb, cb) {
295
+ var command = new UpdateOrganizationConfigurationCommand(args);
296
+ if (typeof optionsOrCb === "function") {
297
+ this.send(command, optionsOrCb);
298
+ }
299
+ else if (typeof cb === "function") {
300
+ if (typeof optionsOrCb !== "object")
301
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
302
+ this.send(command, optionsOrCb || {}, cb);
303
+ }
304
+ else {
305
+ return this.send(command, optionsOrCb);
306
+ }
307
+ };
233
308
  return Detective;
234
309
  }(DetectiveClient));
235
310
  export { Detective };