@aws-sdk/client-detective 3.45.0 → 3.47.2

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 (70) hide show
  1. package/CHANGELOG.md +45 -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/endpoints.js +0 -24
  11. package/dist-cjs/models/models_0.js +48 -31
  12. package/dist-cjs/pagination/ListOrganizationAdminAccountsPaginator.js +35 -0
  13. package/dist-cjs/pagination/index.js +1 -0
  14. package/dist-cjs/protocols/Aws_restJson1.js +451 -1
  15. package/dist-cjs/runtimeConfig.browser.js +7 -2
  16. package/dist-cjs/runtimeConfig.js +9 -3
  17. package/dist-es/Detective.js +75 -0
  18. package/dist-es/commands/DescribeOrganizationConfigurationCommand.js +39 -0
  19. package/dist-es/commands/DisableOrganizationAdminAccountCommand.js +38 -0
  20. package/dist-es/commands/EnableOrganizationAdminAccountCommand.js +39 -0
  21. package/dist-es/commands/ListOrganizationAdminAccountsCommand.js +39 -0
  22. package/dist-es/commands/UpdateOrganizationConfigurationCommand.js +39 -0
  23. package/dist-es/commands/index.js +5 -0
  24. package/dist-es/endpoints.js +0 -24
  25. package/dist-es/models/models_0.js +33 -20
  26. package/dist-es/pagination/ListOrganizationAdminAccountsPaginator.js +74 -0
  27. package/dist-es/pagination/index.js +1 -0
  28. package/dist-es/protocols/Aws_restJson1.js +533 -1
  29. package/dist-es/runtimeConfig.browser.js +12 -3
  30. package/dist-es/runtimeConfig.js +13 -6
  31. package/dist-types/Detective.d.ts +154 -42
  32. package/dist-types/DetectiveClient.d.ts +54 -17
  33. package/dist-types/commands/CreateGraphCommand.d.ts +9 -9
  34. package/dist-types/commands/CreateMembersCommand.d.ts +17 -7
  35. package/dist-types/commands/DeleteGraphCommand.d.ts +1 -1
  36. package/dist-types/commands/DeleteMembersCommand.d.ts +13 -5
  37. package/dist-types/commands/DescribeOrganizationConfigurationCommand.d.ts +38 -0
  38. package/dist-types/commands/DisableOrganizationAdminAccountCommand.d.ts +38 -0
  39. package/dist-types/commands/DisassociateMembershipCommand.d.ts +6 -1
  40. package/dist-types/commands/EnableOrganizationAdminAccountCommand.d.ts +42 -0
  41. package/dist-types/commands/ListInvitationsCommand.d.ts +1 -1
  42. package/dist-types/commands/ListMembersCommand.d.ts +6 -2
  43. package/dist-types/commands/ListOrganizationAdminAccountsCommand.d.ts +36 -0
  44. package/dist-types/commands/RejectInvitationCommand.d.ts +6 -1
  45. package/dist-types/commands/StartMonitoringMemberCommand.d.ts +1 -1
  46. package/dist-types/commands/UpdateOrganizationConfigurationCommand.d.ts +37 -0
  47. package/dist-types/commands/index.d.ts +5 -0
  48. package/dist-types/models/models_0.d.ts +228 -101
  49. package/dist-types/pagination/ListOrganizationAdminAccountsPaginator.d.ts +4 -0
  50. package/dist-types/pagination/index.d.ts +1 -0
  51. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  52. package/dist-types/runtimeConfig.browser.d.ts +3 -2
  53. package/dist-types/runtimeConfig.d.ts +4 -3
  54. package/dist-types/runtimeConfig.native.d.ts +1 -0
  55. package/dist-types/ts3.4/Detective.d.ts +25 -0
  56. package/dist-types/ts3.4/DetectiveClient.d.ts +10 -3
  57. package/dist-types/ts3.4/commands/DescribeOrganizationConfigurationCommand.d.ts +17 -0
  58. package/dist-types/ts3.4/commands/DisableOrganizationAdminAccountCommand.d.ts +16 -0
  59. package/dist-types/ts3.4/commands/EnableOrganizationAdminAccountCommand.d.ts +17 -0
  60. package/dist-types/ts3.4/commands/ListOrganizationAdminAccountsCommand.d.ts +17 -0
  61. package/dist-types/ts3.4/commands/UpdateOrganizationConfigurationCommand.d.ts +17 -0
  62. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  63. package/dist-types/ts3.4/models/models_0.d.ts +79 -20
  64. package/dist-types/ts3.4/pagination/ListOrganizationAdminAccountsPaginator.d.ts +4 -0
  65. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  66. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
  67. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -2
  68. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -3
  69. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
  70. package/package.json +39 -46
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
4
4
  export var serializeAws_restJson1AcceptInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
5
5
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
6
6
  return __generator(this, function (_c) {
@@ -124,6 +124,54 @@ export var serializeAws_restJson1DeleteMembersCommand = function (input, context
124
124
  }
125
125
  });
126
126
  }); };
127
+ export var serializeAws_restJson1DescribeOrganizationConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
129
+ return __generator(this, function (_c) {
130
+ switch (_c.label) {
131
+ case 0: return [4, context.endpoint()];
132
+ case 1:
133
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
134
+ headers = {
135
+ "content-type": "application/json",
136
+ };
137
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/describeOrganizationConfiguration";
138
+ body = JSON.stringify(__assign({}, (input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn })));
139
+ return [2, new __HttpRequest({
140
+ protocol: protocol,
141
+ hostname: hostname,
142
+ port: port,
143
+ method: "POST",
144
+ headers: headers,
145
+ path: resolvedPath,
146
+ body: body,
147
+ })];
148
+ }
149
+ });
150
+ }); };
151
+ export var serializeAws_restJson1DisableOrganizationAdminAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
152
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
153
+ return __generator(this, function (_c) {
154
+ switch (_c.label) {
155
+ case 0: return [4, context.endpoint()];
156
+ case 1:
157
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
158
+ headers = {
159
+ "content-type": "application/json",
160
+ };
161
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/disableAdminAccount";
162
+ body = "";
163
+ return [2, new __HttpRequest({
164
+ protocol: protocol,
165
+ hostname: hostname,
166
+ port: port,
167
+ method: "POST",
168
+ headers: headers,
169
+ path: resolvedPath,
170
+ body: body,
171
+ })];
172
+ }
173
+ });
174
+ }); };
127
175
  export var serializeAws_restJson1DisassociateMembershipCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
176
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
129
177
  return __generator(this, function (_c) {
@@ -148,6 +196,30 @@ export var serializeAws_restJson1DisassociateMembershipCommand = function (input
148
196
  }
149
197
  });
150
198
  }); };
199
+ export var serializeAws_restJson1EnableOrganizationAdminAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
200
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
201
+ return __generator(this, function (_c) {
202
+ switch (_c.label) {
203
+ case 0: return [4, context.endpoint()];
204
+ case 1:
205
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
206
+ headers = {
207
+ "content-type": "application/json",
208
+ };
209
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/enableAdminAccount";
210
+ body = JSON.stringify(__assign({}, (input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId })));
211
+ return [2, new __HttpRequest({
212
+ protocol: protocol,
213
+ hostname: hostname,
214
+ port: port,
215
+ method: "POST",
216
+ headers: headers,
217
+ path: resolvedPath,
218
+ body: body,
219
+ })];
220
+ }
221
+ });
222
+ }); };
151
223
  export var serializeAws_restJson1GetMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
152
224
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
153
225
  return __generator(this, function (_c) {
@@ -245,6 +317,30 @@ export var serializeAws_restJson1ListMembersCommand = function (input, context)
245
317
  }
246
318
  });
247
319
  }); };
320
+ export var serializeAws_restJson1ListOrganizationAdminAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
321
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
322
+ return __generator(this, function (_c) {
323
+ switch (_c.label) {
324
+ case 0: return [4, context.endpoint()];
325
+ case 1:
326
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
327
+ headers = {
328
+ "content-type": "application/json",
329
+ };
330
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/adminAccountslist";
331
+ body = JSON.stringify(__assign(__assign({}, (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
332
+ return [2, new __HttpRequest({
333
+ protocol: protocol,
334
+ hostname: hostname,
335
+ port: port,
336
+ method: "POST",
337
+ headers: headers,
338
+ path: resolvedPath,
339
+ body: body,
340
+ })];
341
+ }
342
+ });
343
+ }); };
248
344
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
249
345
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
250
346
  return __generator(this, function (_c) {
@@ -391,6 +487,30 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
391
487
  }
392
488
  });
393
489
  }); };
490
+ export var serializeAws_restJson1UpdateOrganizationConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
491
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
492
+ return __generator(this, function (_c) {
493
+ switch (_c.label) {
494
+ case 0: return [4, context.endpoint()];
495
+ case 1:
496
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
497
+ headers = {
498
+ "content-type": "application/json",
499
+ };
500
+ resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/updateOrganizationConfiguration";
501
+ body = JSON.stringify(__assign(__assign({}, (input.AutoEnable !== undefined && input.AutoEnable !== null && { AutoEnable: input.AutoEnable })), (input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn })));
502
+ return [2, new __HttpRequest({
503
+ protocol: protocol,
504
+ hostname: hostname,
505
+ port: port,
506
+ method: "POST",
507
+ headers: headers,
508
+ path: resolvedPath,
509
+ body: body,
510
+ })];
511
+ }
512
+ });
513
+ }); };
394
514
  export var deserializeAws_restJson1AcceptInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
395
515
  var contents;
396
516
  return __generator(this, function (_a) {
@@ -801,6 +921,156 @@ var deserializeAws_restJson1DeleteMembersCommandError = function (output, contex
801
921
  }
802
922
  });
803
923
  }); };
924
+ export var deserializeAws_restJson1DescribeOrganizationConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
925
+ var contents, data, _a, _b;
926
+ return __generator(this, function (_c) {
927
+ switch (_c.label) {
928
+ case 0:
929
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
930
+ return [2, deserializeAws_restJson1DescribeOrganizationConfigurationCommandError(output, context)];
931
+ }
932
+ contents = {
933
+ $metadata: deserializeMetadata(output),
934
+ AutoEnable: undefined,
935
+ };
936
+ _a = __expectNonNull;
937
+ _b = __expectObject;
938
+ return [4, parseBody(output.body, context)];
939
+ case 1:
940
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
941
+ if (data.AutoEnable !== undefined && data.AutoEnable !== null) {
942
+ contents.AutoEnable = __expectBoolean(data.AutoEnable);
943
+ }
944
+ return [2, Promise.resolve(contents)];
945
+ }
946
+ });
947
+ }); };
948
+ var deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
949
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
950
+ var _f;
951
+ return __generator(this, function (_g) {
952
+ switch (_g.label) {
953
+ case 0:
954
+ _a = [__assign({}, output)];
955
+ _f = {};
956
+ return [4, parseBody(output.body, context)];
957
+ case 1:
958
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
959
+ errorCode = "UnknownError";
960
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
961
+ _b = errorCode;
962
+ switch (_b) {
963
+ case "InternalServerException": return [3, 2];
964
+ case "com.amazonaws.detective#InternalServerException": return [3, 2];
965
+ case "TooManyRequestsException": return [3, 4];
966
+ case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
967
+ case "ValidationException": return [3, 6];
968
+ case "com.amazonaws.detective#ValidationException": return [3, 6];
969
+ }
970
+ return [3, 8];
971
+ case 2:
972
+ _c = [{}];
973
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
974
+ case 3:
975
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
976
+ return [3, 9];
977
+ case 4:
978
+ _d = [{}];
979
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
980
+ case 5:
981
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
982
+ return [3, 9];
983
+ case 6:
984
+ _e = [{}];
985
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
986
+ case 7:
987
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
988
+ return [3, 9];
989
+ case 8:
990
+ parsedBody = parsedOutput.body;
991
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
992
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
993
+ _g.label = 9;
994
+ case 9:
995
+ message = response.message || response.Message || errorCode;
996
+ response.message = message;
997
+ delete response.Message;
998
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
999
+ }
1000
+ });
1001
+ }); };
1002
+ export var deserializeAws_restJson1DisableOrganizationAdminAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1003
+ var contents;
1004
+ return __generator(this, function (_a) {
1005
+ switch (_a.label) {
1006
+ case 0:
1007
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1008
+ return [2, deserializeAws_restJson1DisableOrganizationAdminAccountCommandError(output, context)];
1009
+ }
1010
+ contents = {
1011
+ $metadata: deserializeMetadata(output),
1012
+ };
1013
+ return [4, collectBody(output.body, context)];
1014
+ case 1:
1015
+ _a.sent();
1016
+ return [2, Promise.resolve(contents)];
1017
+ }
1018
+ });
1019
+ }); };
1020
+ var deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1021
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
1022
+ var _f;
1023
+ return __generator(this, function (_g) {
1024
+ switch (_g.label) {
1025
+ case 0:
1026
+ _a = [__assign({}, output)];
1027
+ _f = {};
1028
+ return [4, parseBody(output.body, context)];
1029
+ case 1:
1030
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
1031
+ errorCode = "UnknownError";
1032
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1033
+ _b = errorCode;
1034
+ switch (_b) {
1035
+ case "InternalServerException": return [3, 2];
1036
+ case "com.amazonaws.detective#InternalServerException": return [3, 2];
1037
+ case "TooManyRequestsException": return [3, 4];
1038
+ case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1039
+ case "ValidationException": return [3, 6];
1040
+ case "com.amazonaws.detective#ValidationException": return [3, 6];
1041
+ }
1042
+ return [3, 8];
1043
+ case 2:
1044
+ _c = [{}];
1045
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1046
+ case 3:
1047
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1048
+ return [3, 9];
1049
+ case 4:
1050
+ _d = [{}];
1051
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1052
+ case 5:
1053
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1054
+ return [3, 9];
1055
+ case 6:
1056
+ _e = [{}];
1057
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1058
+ case 7:
1059
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1060
+ return [3, 9];
1061
+ case 8:
1062
+ parsedBody = parsedOutput.body;
1063
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1064
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1065
+ _g.label = 9;
1066
+ case 9:
1067
+ message = response.message || response.Message || errorCode;
1068
+ response.message = message;
1069
+ delete response.Message;
1070
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1071
+ }
1072
+ });
1073
+ }); };
804
1074
  export var deserializeAws_restJson1DisassociateMembershipCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
805
1075
  var contents;
806
1076
  return __generator(this, function (_a) {
@@ -881,6 +1151,78 @@ var deserializeAws_restJson1DisassociateMembershipCommandError = function (outpu
881
1151
  }
882
1152
  });
883
1153
  }); };
1154
+ export var deserializeAws_restJson1EnableOrganizationAdminAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1155
+ var contents;
1156
+ return __generator(this, function (_a) {
1157
+ switch (_a.label) {
1158
+ case 0:
1159
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1160
+ return [2, deserializeAws_restJson1EnableOrganizationAdminAccountCommandError(output, context)];
1161
+ }
1162
+ contents = {
1163
+ $metadata: deserializeMetadata(output),
1164
+ };
1165
+ return [4, collectBody(output.body, context)];
1166
+ case 1:
1167
+ _a.sent();
1168
+ return [2, Promise.resolve(contents)];
1169
+ }
1170
+ });
1171
+ }); };
1172
+ var deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1173
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
1174
+ var _f;
1175
+ return __generator(this, function (_g) {
1176
+ switch (_g.label) {
1177
+ case 0:
1178
+ _a = [__assign({}, output)];
1179
+ _f = {};
1180
+ return [4, parseBody(output.body, context)];
1181
+ case 1:
1182
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
1183
+ errorCode = "UnknownError";
1184
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1185
+ _b = errorCode;
1186
+ switch (_b) {
1187
+ case "InternalServerException": return [3, 2];
1188
+ case "com.amazonaws.detective#InternalServerException": return [3, 2];
1189
+ case "TooManyRequestsException": return [3, 4];
1190
+ case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1191
+ case "ValidationException": return [3, 6];
1192
+ case "com.amazonaws.detective#ValidationException": return [3, 6];
1193
+ }
1194
+ return [3, 8];
1195
+ case 2:
1196
+ _c = [{}];
1197
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1198
+ case 3:
1199
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1200
+ return [3, 9];
1201
+ case 4:
1202
+ _d = [{}];
1203
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1204
+ case 5:
1205
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1206
+ return [3, 9];
1207
+ case 6:
1208
+ _e = [{}];
1209
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1210
+ case 7:
1211
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1212
+ return [3, 9];
1213
+ case 8:
1214
+ parsedBody = parsedOutput.body;
1215
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1216
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1217
+ _g.label = 9;
1218
+ case 9:
1219
+ message = response.message || response.Message || errorCode;
1220
+ response.message = message;
1221
+ delete response.Message;
1222
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1223
+ }
1224
+ });
1225
+ }); };
884
1226
  export var deserializeAws_restJson1GetMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
885
1227
  var contents, data, _a, _b;
886
1228
  return __generator(this, function (_c) {
@@ -1193,6 +1535,88 @@ var deserializeAws_restJson1ListMembersCommandError = function (output, context)
1193
1535
  }
1194
1536
  });
1195
1537
  }); };
1538
+ export var deserializeAws_restJson1ListOrganizationAdminAccountsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1539
+ var contents, data, _a, _b;
1540
+ return __generator(this, function (_c) {
1541
+ switch (_c.label) {
1542
+ case 0:
1543
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1544
+ return [2, deserializeAws_restJson1ListOrganizationAdminAccountsCommandError(output, context)];
1545
+ }
1546
+ contents = {
1547
+ $metadata: deserializeMetadata(output),
1548
+ Administrators: undefined,
1549
+ NextToken: undefined,
1550
+ };
1551
+ _a = __expectNonNull;
1552
+ _b = __expectObject;
1553
+ return [4, parseBody(output.body, context)];
1554
+ case 1:
1555
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1556
+ if (data.Administrators !== undefined && data.Administrators !== null) {
1557
+ contents.Administrators = deserializeAws_restJson1AdministratorList(data.Administrators, context);
1558
+ }
1559
+ if (data.NextToken !== undefined && data.NextToken !== null) {
1560
+ contents.NextToken = __expectString(data.NextToken);
1561
+ }
1562
+ return [2, Promise.resolve(contents)];
1563
+ }
1564
+ });
1565
+ }); };
1566
+ var deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1567
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
1568
+ var _f;
1569
+ return __generator(this, function (_g) {
1570
+ switch (_g.label) {
1571
+ case 0:
1572
+ _a = [__assign({}, output)];
1573
+ _f = {};
1574
+ return [4, parseBody(output.body, context)];
1575
+ case 1:
1576
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
1577
+ errorCode = "UnknownError";
1578
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1579
+ _b = errorCode;
1580
+ switch (_b) {
1581
+ case "InternalServerException": return [3, 2];
1582
+ case "com.amazonaws.detective#InternalServerException": return [3, 2];
1583
+ case "TooManyRequestsException": return [3, 4];
1584
+ case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1585
+ case "ValidationException": return [3, 6];
1586
+ case "com.amazonaws.detective#ValidationException": return [3, 6];
1587
+ }
1588
+ return [3, 8];
1589
+ case 2:
1590
+ _c = [{}];
1591
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1592
+ case 3:
1593
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1594
+ return [3, 9];
1595
+ case 4:
1596
+ _d = [{}];
1597
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1598
+ case 5:
1599
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1600
+ return [3, 9];
1601
+ case 6:
1602
+ _e = [{}];
1603
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1604
+ case 7:
1605
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
1606
+ return [3, 9];
1607
+ case 8:
1608
+ parsedBody = parsedOutput.body;
1609
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1610
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
1611
+ _g.label = 9;
1612
+ case 9:
1613
+ message = response.message || response.Message || errorCode;
1614
+ response.message = message;
1615
+ delete response.Message;
1616
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
1617
+ }
1618
+ });
1619
+ }); };
1196
1620
  export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1197
1621
  var contents, data, _a, _b;
1198
1622
  return __generator(this, function (_c) {
@@ -1583,6 +2007,78 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1583
2007
  }
1584
2008
  });
1585
2009
  }); };
2010
+ export var deserializeAws_restJson1UpdateOrganizationConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2011
+ var contents;
2012
+ return __generator(this, function (_a) {
2013
+ switch (_a.label) {
2014
+ case 0:
2015
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2016
+ return [2, deserializeAws_restJson1UpdateOrganizationConfigurationCommandError(output, context)];
2017
+ }
2018
+ contents = {
2019
+ $metadata: deserializeMetadata(output),
2020
+ };
2021
+ return [4, collectBody(output.body, context)];
2022
+ case 1:
2023
+ _a.sent();
2024
+ return [2, Promise.resolve(contents)];
2025
+ }
2026
+ });
2027
+ }); };
2028
+ var deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2029
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
2030
+ var _f;
2031
+ return __generator(this, function (_g) {
2032
+ switch (_g.label) {
2033
+ case 0:
2034
+ _a = [__assign({}, output)];
2035
+ _f = {};
2036
+ return [4, parseBody(output.body, context)];
2037
+ case 1:
2038
+ parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
2039
+ errorCode = "UnknownError";
2040
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2041
+ _b = errorCode;
2042
+ switch (_b) {
2043
+ case "InternalServerException": return [3, 2];
2044
+ case "com.amazonaws.detective#InternalServerException": return [3, 2];
2045
+ case "TooManyRequestsException": return [3, 4];
2046
+ case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
2047
+ case "ValidationException": return [3, 6];
2048
+ case "com.amazonaws.detective#ValidationException": return [3, 6];
2049
+ }
2050
+ return [3, 8];
2051
+ case 2:
2052
+ _c = [{}];
2053
+ return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2054
+ case 3:
2055
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2056
+ return [3, 9];
2057
+ case 4:
2058
+ _d = [{}];
2059
+ return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
2060
+ case 5:
2061
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2062
+ return [3, 9];
2063
+ case 6:
2064
+ _e = [{}];
2065
+ return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2066
+ case 7:
2067
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
2068
+ return [3, 9];
2069
+ case 8:
2070
+ parsedBody = parsedOutput.body;
2071
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2072
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
2073
+ _g.label = 9;
2074
+ case 9:
2075
+ message = response.message || response.Message || errorCode;
2076
+ response.message = message;
2077
+ delete response.Message;
2078
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
2079
+ }
2080
+ });
2081
+ }); };
1586
2082
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1587
2083
  var contents, data;
1588
2084
  return __generator(this, function (_a) {
@@ -1647,6 +2143,22 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
1647
2143
  return [2, contents];
1648
2144
  });
1649
2145
  }); };
2146
+ var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2147
+ var contents, data;
2148
+ return __generator(this, function (_a) {
2149
+ contents = {
2150
+ name: "TooManyRequestsException",
2151
+ $fault: "client",
2152
+ $metadata: deserializeMetadata(parsedOutput),
2153
+ Message: undefined,
2154
+ };
2155
+ data = parsedOutput.body;
2156
+ if (data.Message !== undefined && data.Message !== null) {
2157
+ contents.Message = __expectString(data.Message);
2158
+ }
2159
+ return [2, contents];
2160
+ });
2161
+ }); };
1650
2162
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1651
2163
  var contents, data;
1652
2164
  return __generator(this, function (_a) {
@@ -1706,6 +2218,25 @@ var deserializeAws_restJson1AccountIdList = function (output, context) {
1706
2218
  return __expectString(entry);
1707
2219
  });
1708
2220
  };
2221
+ var deserializeAws_restJson1Administrator = function (output, context) {
2222
+ return {
2223
+ AccountId: __expectString(output.AccountId),
2224
+ DelegationTime: output.DelegationTime !== undefined && output.DelegationTime !== null
2225
+ ? __expectNonNull(__parseRfc3339DateTime(output.DelegationTime))
2226
+ : undefined,
2227
+ GraphArn: __expectString(output.GraphArn),
2228
+ };
2229
+ };
2230
+ var deserializeAws_restJson1AdministratorList = function (output, context) {
2231
+ return (output || [])
2232
+ .filter(function (e) { return e != null; })
2233
+ .map(function (entry) {
2234
+ if (entry === null) {
2235
+ return null;
2236
+ }
2237
+ return deserializeAws_restJson1Administrator(entry, context);
2238
+ });
2239
+ };
1709
2240
  var deserializeAws_restJson1Graph = function (output, context) {
1710
2241
  return {
1711
2242
  Arn: __expectString(output.Arn),
@@ -1731,6 +2262,7 @@ var deserializeAws_restJson1MemberDetail = function (output, context) {
1731
2262
  DisabledReason: __expectString(output.DisabledReason),
1732
2263
  EmailAddress: __expectString(output.EmailAddress),
1733
2264
  GraphArn: __expectString(output.GraphArn),
2265
+ InvitationType: __expectString(output.InvitationType),
1734
2266
  InvitedTime: output.InvitedTime !== undefined && output.InvitedTime !== null
1735
2267
  ? __expectNonNull(__parseRfc3339DateTime(output.InvitedTime))
1736
2268
  : undefined,
@@ -1,8 +1,8 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __awaiter, __generator } from "tslib";
2
2
  import packageInfo from "../package.json";
3
3
  import { Sha256 } from "@aws-crypto/sha256-browser";
4
4
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
5
- import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
5
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
6
6
  import { invalidProvider } from "@aws-sdk/invalid-dependency";
7
7
  import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
8
8
  import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
@@ -10,8 +10,17 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
10
10
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
11
11
  import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
12
12
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
+ import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
14
+ import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
13
15
  export var getRuntimeConfig = function (config) {
14
16
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
17
+ var defaultsMode = resolveDefaultsModeConfig(config);
18
+ var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
15
19
  var clientSharedValues = getSharedRuntimeConfig(config);
16
- return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new FetchHttpHandler(), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return Promise.resolve(DEFAULT_RETRY_MODE); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
20
+ return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
21
+ switch (_a.label) {
22
+ case 0: return [4, defaultConfigProvider()];
23
+ case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
24
+ }
25
+ }); }); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
17
26
  };