@aws-sdk/client-detective 3.181.0 → 3.183.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 +8 -0
  2. package/dist-es/Detective.js +98 -105
  3. package/dist-es/DetectiveClient.js +22 -28
  4. package/dist-es/commands/AcceptInvitationCommand.js +22 -29
  5. package/dist-es/commands/BatchGetGraphMemberDatasourcesCommand.js +21 -28
  6. package/dist-es/commands/BatchGetMembershipDatasourcesCommand.js +21 -28
  7. package/dist-es/commands/CreateGraphCommand.js +21 -28
  8. package/dist-es/commands/CreateMembersCommand.js +21 -28
  9. package/dist-es/commands/DeleteGraphCommand.js +22 -29
  10. package/dist-es/commands/DeleteMembersCommand.js +21 -28
  11. package/dist-es/commands/DescribeOrganizationConfigurationCommand.js +21 -28
  12. package/dist-es/commands/DisableOrganizationAdminAccountCommand.js +23 -30
  13. package/dist-es/commands/DisassociateMembershipCommand.js +22 -29
  14. package/dist-es/commands/EnableOrganizationAdminAccountCommand.js +22 -29
  15. package/dist-es/commands/GetMembersCommand.js +21 -28
  16. package/dist-es/commands/ListDatasourcePackagesCommand.js +21 -28
  17. package/dist-es/commands/ListGraphsCommand.js +21 -28
  18. package/dist-es/commands/ListInvitationsCommand.js +21 -28
  19. package/dist-es/commands/ListMembersCommand.js +21 -28
  20. package/dist-es/commands/ListOrganizationAdminAccountsCommand.js +21 -28
  21. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  22. package/dist-es/commands/RejectInvitationCommand.js +22 -29
  23. package/dist-es/commands/StartMonitoringMemberCommand.js +22 -29
  24. package/dist-es/commands/TagResourceCommand.js +21 -28
  25. package/dist-es/commands/UntagResourceCommand.js +21 -28
  26. package/dist-es/commands/UpdateDatasourcePackagesCommand.js +22 -29
  27. package/dist-es/commands/UpdateOrganizationConfigurationCommand.js +22 -29
  28. package/dist-es/endpoints.js +8 -8
  29. package/dist-es/models/DetectiveServiceException.js +5 -10
  30. package/dist-es/models/models_0.js +219 -124
  31. package/dist-es/pagination/ListDatasourcePackagesPaginator.js +25 -68
  32. package/dist-es/pagination/ListGraphsPaginator.js +25 -68
  33. package/dist-es/pagination/ListInvitationsPaginator.js +25 -68
  34. package/dist-es/pagination/ListMembersPaginator.js +25 -68
  35. package/dist-es/pagination/ListOrganizationAdminAccountsPaginator.js +25 -68
  36. package/dist-es/protocols/Aws_restJson1.js +1605 -2284
  37. package/dist-es/runtimeConfig.browser.js +26 -12
  38. package/dist-es/runtimeConfig.js +30 -12
  39. package/dist-es/runtimeConfig.native.js +8 -5
  40. package/dist-es/runtimeConfig.shared.js +8 -11
  41. package/package.json +33 -33
@@ -1,2258 +1,1591 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { DetectiveServiceException as __BaseException } from "../models/DetectiveServiceException";
5
4
  import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, TooManyRequestsException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_restJson1AcceptInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {
14
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/invitation";
17
- body = JSON.stringify(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })));
18
- return [2, new __HttpRequest({
19
- protocol: protocol,
20
- hostname: hostname,
21
- port: port,
22
- method: "PUT",
23
- headers: headers,
24
- path: resolvedPath,
25
- body: body,
26
- })];
27
- }
28
- });
29
- }); };
30
- export var serializeAws_restJson1BatchGetGraphMemberDatasourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
31
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
32
- return __generator(this, function (_c) {
33
- switch (_c.label) {
34
- case 0: return [4, context.endpoint()];
35
- case 1:
36
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
37
- headers = {
38
- "content-type": "application/json",
39
- };
40
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/datasources/get";
41
- body = JSON.stringify(__assign(__assign({}, (input.AccountIds != null && {
42
- AccountIds: serializeAws_restJson1AccountIdExtendedList(input.AccountIds, context),
43
- })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
44
- return [2, new __HttpRequest({
45
- protocol: protocol,
46
- hostname: hostname,
47
- port: port,
48
- method: "POST",
49
- headers: headers,
50
- path: resolvedPath,
51
- body: body,
52
- })];
53
- }
54
- });
55
- }); };
56
- export var serializeAws_restJson1BatchGetMembershipDatasourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
- return __generator(this, function (_c) {
59
- switch (_c.label) {
60
- case 0: return [4, context.endpoint()];
61
- case 1:
62
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
- headers = {
64
- "content-type": "application/json",
65
- };
66
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/membership/datasources/get";
67
- body = JSON.stringify(__assign({}, (input.GraphArns != null && { GraphArns: serializeAws_restJson1GraphArnList(input.GraphArns, context) })));
68
- return [2, new __HttpRequest({
69
- protocol: protocol,
70
- hostname: hostname,
71
- port: port,
72
- method: "POST",
73
- headers: headers,
74
- path: resolvedPath,
75
- body: body,
76
- })];
77
- }
78
- });
79
- }); };
80
- export var serializeAws_restJson1CreateGraphCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
81
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
82
- return __generator(this, function (_c) {
83
- switch (_c.label) {
84
- case 0: return [4, context.endpoint()];
85
- case 1:
86
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
87
- headers = {
88
- "content-type": "application/json",
89
- };
90
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph";
91
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
92
- return [2, new __HttpRequest({
93
- protocol: protocol,
94
- hostname: hostname,
95
- port: port,
96
- method: "POST",
97
- headers: headers,
98
- path: resolvedPath,
99
- body: body,
100
- })];
101
- }
102
- });
103
- }); };
104
- export var serializeAws_restJson1CreateMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
106
- return __generator(this, function (_c) {
107
- switch (_c.label) {
108
- case 0: return [4, context.endpoint()];
109
- case 1:
110
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
111
- headers = {
112
- "content-type": "application/json",
113
- };
114
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/members";
115
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Accounts != null && { Accounts: serializeAws_restJson1AccountList(input.Accounts, context) })), (input.DisableEmailNotification != null && { DisableEmailNotification: input.DisableEmailNotification })), (input.GraphArn != null && { GraphArn: input.GraphArn })), (input.Message != null && { Message: input.Message })));
116
- return [2, new __HttpRequest({
117
- protocol: protocol,
118
- hostname: hostname,
119
- port: port,
120
- method: "POST",
121
- headers: headers,
122
- path: resolvedPath,
123
- body: body,
124
- })];
125
- }
126
- });
127
- }); };
128
- export var serializeAws_restJson1DeleteGraphCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
130
- return __generator(this, function (_c) {
131
- switch (_c.label) {
132
- case 0: return [4, context.endpoint()];
133
- case 1:
134
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
135
- headers = {
136
- "content-type": "application/json",
137
- };
138
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/removal";
139
- body = JSON.stringify(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })));
140
- return [2, new __HttpRequest({
141
- protocol: protocol,
142
- hostname: hostname,
143
- port: port,
144
- method: "POST",
145
- headers: headers,
146
- path: resolvedPath,
147
- body: body,
148
- })];
149
- }
150
- });
151
- }); };
152
- export var serializeAws_restJson1DeleteMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
153
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
154
- return __generator(this, function (_c) {
155
- switch (_c.label) {
156
- case 0: return [4, context.endpoint()];
157
- case 1:
158
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
159
- headers = {
160
- "content-type": "application/json",
161
- };
162
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/members/removal";
163
- body = JSON.stringify(__assign(__assign({}, (input.AccountIds != null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
164
- return [2, new __HttpRequest({
165
- protocol: protocol,
166
- hostname: hostname,
167
- port: port,
168
- method: "POST",
169
- headers: headers,
170
- path: resolvedPath,
171
- body: body,
172
- })];
173
- }
174
- });
175
- }); };
176
- export var serializeAws_restJson1DescribeOrganizationConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
177
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
178
- return __generator(this, function (_c) {
179
- switch (_c.label) {
180
- case 0: return [4, context.endpoint()];
181
- case 1:
182
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
183
- headers = {
184
- "content-type": "application/json",
185
- };
186
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/describeOrganizationConfiguration";
187
- body = JSON.stringify(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })));
188
- return [2, new __HttpRequest({
189
- protocol: protocol,
190
- hostname: hostname,
191
- port: port,
192
- method: "POST",
193
- headers: headers,
194
- path: resolvedPath,
195
- body: body,
196
- })];
197
- }
198
- });
199
- }); };
200
- export var serializeAws_restJson1DisableOrganizationAdminAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
201
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
202
- return __generator(this, function (_c) {
203
- switch (_c.label) {
204
- case 0: return [4, context.endpoint()];
205
- case 1:
206
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
207
- headers = {
208
- "content-type": "application/json",
209
- };
210
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/disableAdminAccount";
211
- body = "";
212
- return [2, new __HttpRequest({
213
- protocol: protocol,
214
- hostname: hostname,
215
- port: port,
216
- method: "POST",
217
- headers: headers,
218
- path: resolvedPath,
219
- body: body,
220
- })];
221
- }
222
- });
223
- }); };
224
- export var serializeAws_restJson1DisassociateMembershipCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
225
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
226
- return __generator(this, function (_c) {
227
- switch (_c.label) {
228
- case 0: return [4, context.endpoint()];
229
- case 1:
230
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
231
- headers = {
232
- "content-type": "application/json",
233
- };
234
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/membership/removal";
235
- body = JSON.stringify(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })));
236
- return [2, new __HttpRequest({
237
- protocol: protocol,
238
- hostname: hostname,
239
- port: port,
240
- method: "POST",
241
- headers: headers,
242
- path: resolvedPath,
243
- body: body,
244
- })];
245
- }
246
- });
247
- }); };
248
- export var serializeAws_restJson1EnableOrganizationAdminAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
249
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
250
- return __generator(this, function (_c) {
251
- switch (_c.label) {
252
- case 0: return [4, context.endpoint()];
253
- case 1:
254
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
255
- headers = {
256
- "content-type": "application/json",
257
- };
258
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/enableAdminAccount";
259
- body = JSON.stringify(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })));
260
- return [2, new __HttpRequest({
261
- protocol: protocol,
262
- hostname: hostname,
263
- port: port,
264
- method: "POST",
265
- headers: headers,
266
- path: resolvedPath,
267
- body: body,
268
- })];
269
- }
270
- });
271
- }); };
272
- export var serializeAws_restJson1GetMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
273
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
274
- return __generator(this, function (_c) {
275
- switch (_c.label) {
276
- case 0: return [4, context.endpoint()];
277
- case 1:
278
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
279
- headers = {
280
- "content-type": "application/json",
281
- };
282
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/members/get";
283
- body = JSON.stringify(__assign(__assign({}, (input.AccountIds != null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
284
- return [2, new __HttpRequest({
285
- protocol: protocol,
286
- hostname: hostname,
287
- port: port,
288
- method: "POST",
289
- headers: headers,
290
- path: resolvedPath,
291
- body: body,
292
- })];
293
- }
294
- });
295
- }); };
296
- export var serializeAws_restJson1ListDatasourcePackagesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
297
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
298
- return __generator(this, function (_c) {
299
- switch (_c.label) {
300
- case 0: return [4, context.endpoint()];
301
- case 1:
302
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
303
- headers = {
304
- "content-type": "application/json",
305
- };
306
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/datasources/list";
307
- body = JSON.stringify(__assign(__assign(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
308
- return [2, new __HttpRequest({
309
- protocol: protocol,
310
- hostname: hostname,
311
- port: port,
312
- method: "POST",
313
- headers: headers,
314
- path: resolvedPath,
315
- body: body,
316
- })];
317
- }
318
- });
319
- }); };
320
- export var serializeAws_restJson1ListGraphsCommand = 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 = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graphs/list";
331
- body = JSON.stringify(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (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
- }); };
344
- export var serializeAws_restJson1ListInvitationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
345
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
346
- return __generator(this, function (_c) {
347
- switch (_c.label) {
348
- case 0: return [4, context.endpoint()];
349
- case 1:
350
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
351
- headers = {
352
- "content-type": "application/json",
353
- };
354
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/invitations/list";
355
- body = JSON.stringify(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
356
- return [2, new __HttpRequest({
357
- protocol: protocol,
358
- hostname: hostname,
359
- port: port,
360
- method: "POST",
361
- headers: headers,
362
- path: resolvedPath,
363
- body: body,
364
- })];
365
- }
366
- });
367
- }); };
368
- export var serializeAws_restJson1ListMembersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
369
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
370
- return __generator(this, function (_c) {
371
- switch (_c.label) {
372
- case 0: return [4, context.endpoint()];
373
- case 1:
374
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
375
- headers = {
376
- "content-type": "application/json",
377
- };
378
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/members/list";
379
- body = JSON.stringify(__assign(__assign(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
380
- return [2, new __HttpRequest({
381
- protocol: protocol,
382
- hostname: hostname,
383
- port: port,
384
- method: "POST",
385
- headers: headers,
386
- path: resolvedPath,
387
- body: body,
388
- })];
389
- }
390
- });
391
- }); };
392
- export var serializeAws_restJson1ListOrganizationAdminAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
393
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
394
- return __generator(this, function (_c) {
395
- switch (_c.label) {
396
- case 0: return [4, context.endpoint()];
397
- case 1:
398
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
399
- headers = {
400
- "content-type": "application/json",
401
- };
402
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/adminAccountslist";
403
- body = JSON.stringify(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
404
- return [2, new __HttpRequest({
405
- protocol: protocol,
406
- hostname: hostname,
407
- port: port,
408
- method: "POST",
409
- headers: headers,
410
- path: resolvedPath,
411
- body: body,
412
- })];
413
- }
414
- });
415
- }); };
416
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
417
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
418
- return __generator(this, function (_c) {
419
- switch (_c.label) {
420
- case 0: return [4, context.endpoint()];
421
- case 1:
422
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
423
- headers = {};
424
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
425
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
426
- return [2, new __HttpRequest({
427
- protocol: protocol,
428
- hostname: hostname,
429
- port: port,
430
- method: "GET",
431
- headers: headers,
432
- path: resolvedPath,
433
- body: body,
434
- })];
435
- }
436
- });
437
- }); };
438
- export var serializeAws_restJson1RejectInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
439
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
440
- return __generator(this, function (_c) {
441
- switch (_c.label) {
442
- case 0: return [4, context.endpoint()];
443
- case 1:
444
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
445
- headers = {
446
- "content-type": "application/json",
447
- };
448
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/invitation/removal";
449
- body = JSON.stringify(__assign({}, (input.GraphArn != null && { GraphArn: input.GraphArn })));
450
- return [2, new __HttpRequest({
451
- protocol: protocol,
452
- hostname: hostname,
453
- port: port,
454
- method: "POST",
455
- headers: headers,
456
- path: resolvedPath,
457
- body: body,
458
- })];
459
- }
460
- });
461
- }); };
462
- export var serializeAws_restJson1StartMonitoringMemberCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
463
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
464
- return __generator(this, function (_c) {
465
- switch (_c.label) {
466
- case 0: return [4, context.endpoint()];
467
- case 1:
468
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
469
- headers = {
470
- "content-type": "application/json",
471
- };
472
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/member/monitoringstate";
473
- body = JSON.stringify(__assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
474
- return [2, new __HttpRequest({
475
- protocol: protocol,
476
- hostname: hostname,
477
- port: port,
478
- method: "POST",
479
- headers: headers,
480
- path: resolvedPath,
481
- body: body,
482
- })];
483
- }
5
+ export const serializeAws_restJson1AcceptInvitationCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/invitation";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
14
+ });
15
+ return new __HttpRequest({
16
+ protocol,
17
+ hostname,
18
+ port,
19
+ method: "PUT",
20
+ headers,
21
+ path: resolvedPath,
22
+ body,
484
23
  });
485
- }); };
486
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
487
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
488
- return __generator(this, function (_c) {
489
- switch (_c.label) {
490
- case 0: return [4, context.endpoint()];
491
- case 1:
492
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
493
- headers = {
494
- "content-type": "application/json",
495
- };
496
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
497
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
498
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
499
- return [2, new __HttpRequest({
500
- protocol: protocol,
501
- hostname: hostname,
502
- port: port,
503
- method: "POST",
504
- headers: headers,
505
- path: resolvedPath,
506
- body: body,
507
- })];
508
- }
24
+ };
25
+ export const serializeAws_restJson1BatchGetGraphMemberDatasourcesCommand = async (input, context) => {
26
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
27
+ const headers = {
28
+ "content-type": "application/json",
29
+ };
30
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/datasources/get";
31
+ let body;
32
+ body = JSON.stringify({
33
+ ...(input.AccountIds != null && {
34
+ AccountIds: serializeAws_restJson1AccountIdExtendedList(input.AccountIds, context),
35
+ }),
36
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
37
+ });
38
+ return new __HttpRequest({
39
+ protocol,
40
+ hostname,
41
+ port,
42
+ method: "POST",
43
+ headers,
44
+ path: resolvedPath,
45
+ body,
509
46
  });
510
- }); };
511
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
512
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
513
- return __generator(this, function (_c) {
514
- switch (_c.label) {
515
- case 0: return [4, context.endpoint()];
516
- case 1:
517
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
518
- headers = {};
519
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
520
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
521
- query = map({
522
- tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
523
- });
524
- return [2, new __HttpRequest({
525
- protocol: protocol,
526
- hostname: hostname,
527
- port: port,
528
- method: "DELETE",
529
- headers: headers,
530
- path: resolvedPath,
531
- query: query,
532
- body: body,
533
- })];
534
- }
47
+ };
48
+ export const serializeAws_restJson1BatchGetMembershipDatasourcesCommand = async (input, context) => {
49
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
50
+ const headers = {
51
+ "content-type": "application/json",
52
+ };
53
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/membership/datasources/get";
54
+ let body;
55
+ body = JSON.stringify({
56
+ ...(input.GraphArns != null && { GraphArns: serializeAws_restJson1GraphArnList(input.GraphArns, context) }),
57
+ });
58
+ return new __HttpRequest({
59
+ protocol,
60
+ hostname,
61
+ port,
62
+ method: "POST",
63
+ headers,
64
+ path: resolvedPath,
65
+ body,
535
66
  });
536
- }); };
537
- export var serializeAws_restJson1UpdateDatasourcePackagesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
538
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
539
- return __generator(this, function (_c) {
540
- switch (_c.label) {
541
- case 0: return [4, context.endpoint()];
542
- case 1:
543
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
544
- headers = {
545
- "content-type": "application/json",
546
- };
547
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/graph/datasources/update";
548
- body = JSON.stringify(__assign(__assign({}, (input.DatasourcePackages != null && {
549
- DatasourcePackages: serializeAws_restJson1DatasourcePackageList(input.DatasourcePackages, context),
550
- })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
551
- return [2, new __HttpRequest({
552
- protocol: protocol,
553
- hostname: hostname,
554
- port: port,
555
- method: "POST",
556
- headers: headers,
557
- path: resolvedPath,
558
- body: body,
559
- })];
560
- }
67
+ };
68
+ export const serializeAws_restJson1CreateGraphCommand = async (input, context) => {
69
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const headers = {
71
+ "content-type": "application/json",
72
+ };
73
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph";
74
+ let body;
75
+ body = JSON.stringify({
76
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
77
+ });
78
+ return new __HttpRequest({
79
+ protocol,
80
+ hostname,
81
+ port,
82
+ method: "POST",
83
+ headers,
84
+ path: resolvedPath,
85
+ body,
561
86
  });
562
- }); };
563
- export var serializeAws_restJson1UpdateOrganizationConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
564
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
565
- return __generator(this, function (_c) {
566
- switch (_c.label) {
567
- case 0: return [4, context.endpoint()];
568
- case 1:
569
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
570
- headers = {
571
- "content-type": "application/json",
572
- };
573
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/orgs/updateOrganizationConfiguration";
574
- body = JSON.stringify(__assign(__assign({}, (input.AutoEnable != null && { AutoEnable: input.AutoEnable })), (input.GraphArn != null && { GraphArn: input.GraphArn })));
575
- return [2, new __HttpRequest({
576
- protocol: protocol,
577
- hostname: hostname,
578
- port: port,
579
- method: "POST",
580
- headers: headers,
581
- path: resolvedPath,
582
- body: body,
583
- })];
584
- }
87
+ };
88
+ export const serializeAws_restJson1CreateMembersCommand = async (input, context) => {
89
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
90
+ const headers = {
91
+ "content-type": "application/json",
92
+ };
93
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/members";
94
+ let body;
95
+ body = JSON.stringify({
96
+ ...(input.Accounts != null && { Accounts: serializeAws_restJson1AccountList(input.Accounts, context) }),
97
+ ...(input.DisableEmailNotification != null && { DisableEmailNotification: input.DisableEmailNotification }),
98
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
99
+ ...(input.Message != null && { Message: input.Message }),
100
+ });
101
+ return new __HttpRequest({
102
+ protocol,
103
+ hostname,
104
+ port,
105
+ method: "POST",
106
+ headers,
107
+ path: resolvedPath,
108
+ body,
585
109
  });
586
- }); };
587
- export var deserializeAws_restJson1AcceptInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
588
- var contents;
589
- return __generator(this, function (_a) {
590
- switch (_a.label) {
591
- case 0:
592
- if (output.statusCode !== 200 && output.statusCode >= 300) {
593
- return [2, deserializeAws_restJson1AcceptInvitationCommandError(output, context)];
594
- }
595
- contents = map({
596
- $metadata: deserializeMetadata(output),
597
- });
598
- return [4, collectBody(output.body, context)];
599
- case 1:
600
- _a.sent();
601
- return [2, contents];
602
- }
110
+ };
111
+ export const serializeAws_restJson1DeleteGraphCommand = async (input, context) => {
112
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
113
+ const headers = {
114
+ "content-type": "application/json",
115
+ };
116
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/removal";
117
+ let body;
118
+ body = JSON.stringify({
119
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
120
+ });
121
+ return new __HttpRequest({
122
+ protocol,
123
+ hostname,
124
+ port,
125
+ method: "POST",
126
+ headers,
127
+ path: resolvedPath,
128
+ body,
603
129
  });
604
- }); };
605
- var deserializeAws_restJson1AcceptInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
606
- var parsedOutput, _a, errorCode, _b, parsedBody;
607
- var _c;
608
- return __generator(this, function (_d) {
609
- switch (_d.label) {
610
- case 0:
611
- _a = [__assign({}, output)];
612
- _c = {};
613
- return [4, parseErrorBody(output.body, context)];
614
- case 1:
615
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
616
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
617
- _b = errorCode;
618
- switch (_b) {
619
- case "ConflictException": return [3, 2];
620
- case "com.amazonaws.detective#ConflictException": return [3, 2];
621
- case "InternalServerException": return [3, 4];
622
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
623
- case "ResourceNotFoundException": return [3, 6];
624
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 6];
625
- case "ValidationException": return [3, 8];
626
- case "com.amazonaws.detective#ValidationException": return [3, 8];
627
- }
628
- return [3, 10];
629
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
630
- case 3: throw _d.sent();
631
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
632
- case 5: throw _d.sent();
633
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
634
- case 7: throw _d.sent();
635
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
636
- case 9: throw _d.sent();
637
- case 10:
638
- parsedBody = parsedOutput.body;
639
- throwDefaultError({
640
- output: output,
641
- parsedBody: parsedBody,
642
- exceptionCtor: __BaseException,
643
- errorCode: errorCode,
644
- });
645
- _d.label = 11;
646
- case 11: return [2];
647
- }
130
+ };
131
+ export const serializeAws_restJson1DeleteMembersCommand = async (input, context) => {
132
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
133
+ const headers = {
134
+ "content-type": "application/json",
135
+ };
136
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/members/removal";
137
+ let body;
138
+ body = JSON.stringify({
139
+ ...(input.AccountIds != null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }),
140
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
141
+ });
142
+ return new __HttpRequest({
143
+ protocol,
144
+ hostname,
145
+ port,
146
+ method: "POST",
147
+ headers,
148
+ path: resolvedPath,
149
+ body,
648
150
  });
649
- }); };
650
- export var deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
651
- var contents, data, _a, _b;
652
- return __generator(this, function (_c) {
653
- switch (_c.label) {
654
- case 0:
655
- if (output.statusCode !== 200 && output.statusCode >= 300) {
656
- return [2, deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError(output, context)];
657
- }
658
- contents = map({
659
- $metadata: deserializeMetadata(output),
660
- });
661
- _a = __expectNonNull;
662
- _b = __expectObject;
663
- return [4, parseBody(output.body, context)];
664
- case 1:
665
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
666
- if (data.MemberDatasources != null) {
667
- contents.MemberDatasources = deserializeAws_restJson1MembershipDatasourcesList(data.MemberDatasources, context);
668
- }
669
- if (data.UnprocessedAccounts != null) {
670
- contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
671
- }
672
- return [2, contents];
673
- }
151
+ };
152
+ export const serializeAws_restJson1DescribeOrganizationConfigurationCommand = async (input, context) => {
153
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const headers = {
155
+ "content-type": "application/json",
156
+ };
157
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/describeOrganizationConfiguration";
158
+ let body;
159
+ body = JSON.stringify({
160
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
161
+ });
162
+ return new __HttpRequest({
163
+ protocol,
164
+ hostname,
165
+ port,
166
+ method: "POST",
167
+ headers,
168
+ path: resolvedPath,
169
+ body,
674
170
  });
675
- }); };
676
- var deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
677
- var parsedOutput, _a, errorCode, _b, parsedBody;
678
- var _c;
679
- return __generator(this, function (_d) {
680
- switch (_d.label) {
681
- case 0:
682
- _a = [__assign({}, output)];
683
- _c = {};
684
- return [4, parseErrorBody(output.body, context)];
685
- case 1:
686
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
687
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
688
- _b = errorCode;
689
- switch (_b) {
690
- case "InternalServerException": return [3, 2];
691
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
692
- case "ResourceNotFoundException": return [3, 4];
693
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
694
- case "ValidationException": return [3, 6];
695
- case "com.amazonaws.detective#ValidationException": return [3, 6];
696
- }
697
- return [3, 8];
698
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
699
- case 3: throw _d.sent();
700
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
701
- case 5: throw _d.sent();
702
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
703
- case 7: throw _d.sent();
704
- case 8:
705
- parsedBody = parsedOutput.body;
706
- throwDefaultError({
707
- output: output,
708
- parsedBody: parsedBody,
709
- exceptionCtor: __BaseException,
710
- errorCode: errorCode,
711
- });
712
- _d.label = 9;
713
- case 9: return [2];
714
- }
171
+ };
172
+ export const serializeAws_restJson1DisableOrganizationAdminAccountCommand = async (input, context) => {
173
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
174
+ const headers = {
175
+ "content-type": "application/json",
176
+ };
177
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/disableAdminAccount";
178
+ let body;
179
+ body = "";
180
+ return new __HttpRequest({
181
+ protocol,
182
+ hostname,
183
+ port,
184
+ method: "POST",
185
+ headers,
186
+ path: resolvedPath,
187
+ body,
715
188
  });
716
- }); };
717
- export var deserializeAws_restJson1BatchGetMembershipDatasourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
718
- var contents, data, _a, _b;
719
- return __generator(this, function (_c) {
720
- switch (_c.label) {
721
- case 0:
722
- if (output.statusCode !== 200 && output.statusCode >= 300) {
723
- return [2, deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError(output, context)];
724
- }
725
- contents = map({
726
- $metadata: deserializeMetadata(output),
727
- });
728
- _a = __expectNonNull;
729
- _b = __expectObject;
730
- return [4, parseBody(output.body, context)];
731
- case 1:
732
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
733
- if (data.MembershipDatasources != null) {
734
- contents.MembershipDatasources = deserializeAws_restJson1MembershipDatasourcesList(data.MembershipDatasources, context);
735
- }
736
- if (data.UnprocessedGraphs != null) {
737
- contents.UnprocessedGraphs = deserializeAws_restJson1UnprocessedGraphList(data.UnprocessedGraphs, context);
738
- }
739
- return [2, contents];
740
- }
189
+ };
190
+ export const serializeAws_restJson1DisassociateMembershipCommand = async (input, context) => {
191
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
192
+ const headers = {
193
+ "content-type": "application/json",
194
+ };
195
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/membership/removal";
196
+ let body;
197
+ body = JSON.stringify({
198
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
199
+ });
200
+ return new __HttpRequest({
201
+ protocol,
202
+ hostname,
203
+ port,
204
+ method: "POST",
205
+ headers,
206
+ path: resolvedPath,
207
+ body,
741
208
  });
742
- }); };
743
- var deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
744
- var parsedOutput, _a, errorCode, _b, parsedBody;
745
- var _c;
746
- return __generator(this, function (_d) {
747
- switch (_d.label) {
748
- case 0:
749
- _a = [__assign({}, output)];
750
- _c = {};
751
- return [4, parseErrorBody(output.body, context)];
752
- case 1:
753
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
754
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
755
- _b = errorCode;
756
- switch (_b) {
757
- case "InternalServerException": return [3, 2];
758
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
759
- case "ResourceNotFoundException": return [3, 4];
760
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
761
- case "ValidationException": return [3, 6];
762
- case "com.amazonaws.detective#ValidationException": return [3, 6];
763
- }
764
- return [3, 8];
765
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
766
- case 3: throw _d.sent();
767
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
768
- case 5: throw _d.sent();
769
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
770
- case 7: throw _d.sent();
771
- case 8:
772
- parsedBody = parsedOutput.body;
773
- throwDefaultError({
774
- output: output,
775
- parsedBody: parsedBody,
776
- exceptionCtor: __BaseException,
777
- errorCode: errorCode,
778
- });
779
- _d.label = 9;
780
- case 9: return [2];
781
- }
209
+ };
210
+ export const serializeAws_restJson1EnableOrganizationAdminAccountCommand = async (input, context) => {
211
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
212
+ const headers = {
213
+ "content-type": "application/json",
214
+ };
215
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/enableAdminAccount";
216
+ let body;
217
+ body = JSON.stringify({
218
+ ...(input.AccountId != null && { AccountId: input.AccountId }),
219
+ });
220
+ return new __HttpRequest({
221
+ protocol,
222
+ hostname,
223
+ port,
224
+ method: "POST",
225
+ headers,
226
+ path: resolvedPath,
227
+ body,
782
228
  });
783
- }); };
784
- export var deserializeAws_restJson1CreateGraphCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
785
- var contents, data, _a, _b;
786
- return __generator(this, function (_c) {
787
- switch (_c.label) {
788
- case 0:
789
- if (output.statusCode !== 200 && output.statusCode >= 300) {
790
- return [2, deserializeAws_restJson1CreateGraphCommandError(output, context)];
791
- }
792
- contents = map({
793
- $metadata: deserializeMetadata(output),
794
- });
795
- _a = __expectNonNull;
796
- _b = __expectObject;
797
- return [4, parseBody(output.body, context)];
798
- case 1:
799
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
800
- if (data.GraphArn != null) {
801
- contents.GraphArn = __expectString(data.GraphArn);
802
- }
803
- return [2, contents];
804
- }
229
+ };
230
+ export const serializeAws_restJson1GetMembersCommand = async (input, context) => {
231
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
232
+ const headers = {
233
+ "content-type": "application/json",
234
+ };
235
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/members/get";
236
+ let body;
237
+ body = JSON.stringify({
238
+ ...(input.AccountIds != null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }),
239
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
240
+ });
241
+ return new __HttpRequest({
242
+ protocol,
243
+ hostname,
244
+ port,
245
+ method: "POST",
246
+ headers,
247
+ path: resolvedPath,
248
+ body,
805
249
  });
806
- }); };
807
- var deserializeAws_restJson1CreateGraphCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
808
- var parsedOutput, _a, errorCode, _b, parsedBody;
809
- var _c;
810
- return __generator(this, function (_d) {
811
- switch (_d.label) {
812
- case 0:
813
- _a = [__assign({}, output)];
814
- _c = {};
815
- return [4, parseErrorBody(output.body, context)];
816
- case 1:
817
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
818
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
819
- _b = errorCode;
820
- switch (_b) {
821
- case "ConflictException": return [3, 2];
822
- case "com.amazonaws.detective#ConflictException": return [3, 2];
823
- case "InternalServerException": return [3, 4];
824
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
825
- case "ServiceQuotaExceededException": return [3, 6];
826
- case "com.amazonaws.detective#ServiceQuotaExceededException": return [3, 6];
827
- }
828
- return [3, 8];
829
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
830
- case 3: throw _d.sent();
831
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
832
- case 5: throw _d.sent();
833
- case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
834
- case 7: throw _d.sent();
835
- case 8:
836
- parsedBody = parsedOutput.body;
837
- throwDefaultError({
838
- output: output,
839
- parsedBody: parsedBody,
840
- exceptionCtor: __BaseException,
841
- errorCode: errorCode,
842
- });
843
- _d.label = 9;
844
- case 9: return [2];
845
- }
250
+ };
251
+ export const serializeAws_restJson1ListDatasourcePackagesCommand = async (input, context) => {
252
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
253
+ const headers = {
254
+ "content-type": "application/json",
255
+ };
256
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/datasources/list";
257
+ let body;
258
+ body = JSON.stringify({
259
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
260
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
261
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
262
+ });
263
+ return new __HttpRequest({
264
+ protocol,
265
+ hostname,
266
+ port,
267
+ method: "POST",
268
+ headers,
269
+ path: resolvedPath,
270
+ body,
846
271
  });
847
- }); };
848
- export var deserializeAws_restJson1CreateMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
849
- var contents, data, _a, _b;
850
- return __generator(this, function (_c) {
851
- switch (_c.label) {
852
- case 0:
853
- if (output.statusCode !== 200 && output.statusCode >= 300) {
854
- return [2, deserializeAws_restJson1CreateMembersCommandError(output, context)];
855
- }
856
- contents = map({
857
- $metadata: deserializeMetadata(output),
858
- });
859
- _a = __expectNonNull;
860
- _b = __expectObject;
861
- return [4, parseBody(output.body, context)];
862
- case 1:
863
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
864
- if (data.Members != null) {
865
- contents.Members = deserializeAws_restJson1MemberDetailList(data.Members, context);
866
- }
867
- if (data.UnprocessedAccounts != null) {
868
- contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
869
- }
870
- return [2, contents];
871
- }
272
+ };
273
+ export const serializeAws_restJson1ListGraphsCommand = async (input, context) => {
274
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
275
+ const headers = {
276
+ "content-type": "application/json",
277
+ };
278
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graphs/list";
279
+ let body;
280
+ body = JSON.stringify({
281
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
282
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
283
+ });
284
+ return new __HttpRequest({
285
+ protocol,
286
+ hostname,
287
+ port,
288
+ method: "POST",
289
+ headers,
290
+ path: resolvedPath,
291
+ body,
872
292
  });
873
- }); };
874
- var deserializeAws_restJson1CreateMembersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
875
- var parsedOutput, _a, errorCode, _b, parsedBody;
876
- var _c;
877
- return __generator(this, function (_d) {
878
- switch (_d.label) {
879
- case 0:
880
- _a = [__assign({}, output)];
881
- _c = {};
882
- return [4, parseErrorBody(output.body, context)];
883
- case 1:
884
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
885
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
886
- _b = errorCode;
887
- switch (_b) {
888
- case "InternalServerException": return [3, 2];
889
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
890
- case "ResourceNotFoundException": return [3, 4];
891
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
892
- case "ServiceQuotaExceededException": return [3, 6];
893
- case "com.amazonaws.detective#ServiceQuotaExceededException": return [3, 6];
894
- case "ValidationException": return [3, 8];
895
- case "com.amazonaws.detective#ValidationException": return [3, 8];
896
- }
897
- return [3, 10];
898
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
899
- case 3: throw _d.sent();
900
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
901
- case 5: throw _d.sent();
902
- case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
903
- case 7: throw _d.sent();
904
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
905
- case 9: throw _d.sent();
906
- case 10:
907
- parsedBody = parsedOutput.body;
908
- throwDefaultError({
909
- output: output,
910
- parsedBody: parsedBody,
911
- exceptionCtor: __BaseException,
912
- errorCode: errorCode,
913
- });
914
- _d.label = 11;
915
- case 11: return [2];
916
- }
293
+ };
294
+ export const serializeAws_restJson1ListInvitationsCommand = async (input, context) => {
295
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
296
+ const headers = {
297
+ "content-type": "application/json",
298
+ };
299
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/invitations/list";
300
+ let body;
301
+ body = JSON.stringify({
302
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
303
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
304
+ });
305
+ return new __HttpRequest({
306
+ protocol,
307
+ hostname,
308
+ port,
309
+ method: "POST",
310
+ headers,
311
+ path: resolvedPath,
312
+ body,
917
313
  });
918
- }); };
919
- export var deserializeAws_restJson1DeleteGraphCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
920
- var contents;
921
- return __generator(this, function (_a) {
922
- switch (_a.label) {
923
- case 0:
924
- if (output.statusCode !== 200 && output.statusCode >= 300) {
925
- return [2, deserializeAws_restJson1DeleteGraphCommandError(output, context)];
926
- }
927
- contents = map({
928
- $metadata: deserializeMetadata(output),
929
- });
930
- return [4, collectBody(output.body, context)];
931
- case 1:
932
- _a.sent();
933
- return [2, contents];
934
- }
314
+ };
315
+ export const serializeAws_restJson1ListMembersCommand = async (input, context) => {
316
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
317
+ const headers = {
318
+ "content-type": "application/json",
319
+ };
320
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/members/list";
321
+ let body;
322
+ body = JSON.stringify({
323
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
324
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
325
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
326
+ });
327
+ return new __HttpRequest({
328
+ protocol,
329
+ hostname,
330
+ port,
331
+ method: "POST",
332
+ headers,
333
+ path: resolvedPath,
334
+ body,
935
335
  });
936
- }); };
937
- var deserializeAws_restJson1DeleteGraphCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
938
- var parsedOutput, _a, errorCode, _b, parsedBody;
939
- var _c;
940
- return __generator(this, function (_d) {
941
- switch (_d.label) {
942
- case 0:
943
- _a = [__assign({}, output)];
944
- _c = {};
945
- return [4, parseErrorBody(output.body, context)];
946
- case 1:
947
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
948
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
949
- _b = errorCode;
950
- switch (_b) {
951
- case "InternalServerException": return [3, 2];
952
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
953
- case "ResourceNotFoundException": return [3, 4];
954
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
955
- case "ValidationException": return [3, 6];
956
- case "com.amazonaws.detective#ValidationException": return [3, 6];
957
- }
958
- return [3, 8];
959
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
960
- case 3: throw _d.sent();
961
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
962
- case 5: throw _d.sent();
963
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
964
- case 7: throw _d.sent();
965
- case 8:
966
- parsedBody = parsedOutput.body;
967
- throwDefaultError({
968
- output: output,
969
- parsedBody: parsedBody,
970
- exceptionCtor: __BaseException,
971
- errorCode: errorCode,
972
- });
973
- _d.label = 9;
974
- case 9: return [2];
975
- }
336
+ };
337
+ export const serializeAws_restJson1ListOrganizationAdminAccountsCommand = async (input, context) => {
338
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
339
+ const headers = {
340
+ "content-type": "application/json",
341
+ };
342
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/adminAccountslist";
343
+ let body;
344
+ body = JSON.stringify({
345
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
346
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
347
+ });
348
+ return new __HttpRequest({
349
+ protocol,
350
+ hostname,
351
+ port,
352
+ method: "POST",
353
+ headers,
354
+ path: resolvedPath,
355
+ body,
976
356
  });
977
- }); };
978
- export var deserializeAws_restJson1DeleteMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
979
- var contents, data, _a, _b;
980
- return __generator(this, function (_c) {
981
- switch (_c.label) {
982
- case 0:
983
- if (output.statusCode !== 200 && output.statusCode >= 300) {
984
- return [2, deserializeAws_restJson1DeleteMembersCommandError(output, context)];
985
- }
986
- contents = map({
987
- $metadata: deserializeMetadata(output),
988
- });
989
- _a = __expectNonNull;
990
- _b = __expectObject;
991
- return [4, parseBody(output.body, context)];
992
- case 1:
993
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
994
- if (data.AccountIds != null) {
995
- contents.AccountIds = deserializeAws_restJson1AccountIdList(data.AccountIds, context);
996
- }
997
- if (data.UnprocessedAccounts != null) {
998
- contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
999
- }
1000
- return [2, contents];
1001
- }
357
+ };
358
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
359
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
360
+ const headers = {};
361
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
362
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
363
+ let body;
364
+ return new __HttpRequest({
365
+ protocol,
366
+ hostname,
367
+ port,
368
+ method: "GET",
369
+ headers,
370
+ path: resolvedPath,
371
+ body,
1002
372
  });
1003
- }); };
1004
- var deserializeAws_restJson1DeleteMembersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1005
- var parsedOutput, _a, errorCode, _b, parsedBody;
1006
- var _c;
1007
- return __generator(this, function (_d) {
1008
- switch (_d.label) {
1009
- case 0:
1010
- _a = [__assign({}, output)];
1011
- _c = {};
1012
- return [4, parseErrorBody(output.body, context)];
1013
- case 1:
1014
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1015
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1016
- _b = errorCode;
1017
- switch (_b) {
1018
- case "ConflictException": return [3, 2];
1019
- case "com.amazonaws.detective#ConflictException": return [3, 2];
1020
- case "InternalServerException": return [3, 4];
1021
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
1022
- case "ResourceNotFoundException": return [3, 6];
1023
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 6];
1024
- case "ValidationException": return [3, 8];
1025
- case "com.amazonaws.detective#ValidationException": return [3, 8];
1026
- }
1027
- return [3, 10];
1028
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1029
- case 3: throw _d.sent();
1030
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1031
- case 5: throw _d.sent();
1032
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1033
- case 7: throw _d.sent();
1034
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1035
- case 9: throw _d.sent();
1036
- case 10:
1037
- parsedBody = parsedOutput.body;
1038
- throwDefaultError({
1039
- output: output,
1040
- parsedBody: parsedBody,
1041
- exceptionCtor: __BaseException,
1042
- errorCode: errorCode,
1043
- });
1044
- _d.label = 11;
1045
- case 11: return [2];
1046
- }
373
+ };
374
+ export const serializeAws_restJson1RejectInvitationCommand = async (input, context) => {
375
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
376
+ const headers = {
377
+ "content-type": "application/json",
378
+ };
379
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/invitation/removal";
380
+ let body;
381
+ body = JSON.stringify({
382
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
383
+ });
384
+ return new __HttpRequest({
385
+ protocol,
386
+ hostname,
387
+ port,
388
+ method: "POST",
389
+ headers,
390
+ path: resolvedPath,
391
+ body,
1047
392
  });
1048
- }); };
1049
- export var deserializeAws_restJson1DescribeOrganizationConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1050
- var contents, data, _a, _b;
1051
- return __generator(this, function (_c) {
1052
- switch (_c.label) {
1053
- case 0:
1054
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1055
- return [2, deserializeAws_restJson1DescribeOrganizationConfigurationCommandError(output, context)];
1056
- }
1057
- contents = map({
1058
- $metadata: deserializeMetadata(output),
1059
- });
1060
- _a = __expectNonNull;
1061
- _b = __expectObject;
1062
- return [4, parseBody(output.body, context)];
1063
- case 1:
1064
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1065
- if (data.AutoEnable != null) {
1066
- contents.AutoEnable = __expectBoolean(data.AutoEnable);
1067
- }
1068
- return [2, contents];
1069
- }
393
+ };
394
+ export const serializeAws_restJson1StartMonitoringMemberCommand = async (input, context) => {
395
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
396
+ const headers = {
397
+ "content-type": "application/json",
398
+ };
399
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/member/monitoringstate";
400
+ let body;
401
+ body = JSON.stringify({
402
+ ...(input.AccountId != null && { AccountId: input.AccountId }),
403
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
404
+ });
405
+ return new __HttpRequest({
406
+ protocol,
407
+ hostname,
408
+ port,
409
+ method: "POST",
410
+ headers,
411
+ path: resolvedPath,
412
+ body,
1070
413
  });
1071
- }); };
1072
- var deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1073
- var parsedOutput, _a, errorCode, _b, parsedBody;
1074
- var _c;
1075
- return __generator(this, function (_d) {
1076
- switch (_d.label) {
1077
- case 0:
1078
- _a = [__assign({}, output)];
1079
- _c = {};
1080
- return [4, parseErrorBody(output.body, context)];
1081
- case 1:
1082
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1083
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1084
- _b = errorCode;
1085
- switch (_b) {
1086
- case "InternalServerException": return [3, 2];
1087
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1088
- case "TooManyRequestsException": return [3, 4];
1089
- case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1090
- case "ValidationException": return [3, 6];
1091
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1092
- }
1093
- return [3, 8];
1094
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1095
- case 3: throw _d.sent();
1096
- case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1097
- case 5: throw _d.sent();
1098
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1099
- case 7: throw _d.sent();
1100
- case 8:
1101
- parsedBody = parsedOutput.body;
1102
- throwDefaultError({
1103
- output: output,
1104
- parsedBody: parsedBody,
1105
- exceptionCtor: __BaseException,
1106
- errorCode: errorCode,
1107
- });
1108
- _d.label = 9;
1109
- case 9: return [2];
1110
- }
414
+ };
415
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
416
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
417
+ const headers = {
418
+ "content-type": "application/json",
419
+ };
420
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
421
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
422
+ let body;
423
+ body = JSON.stringify({
424
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
425
+ });
426
+ return new __HttpRequest({
427
+ protocol,
428
+ hostname,
429
+ port,
430
+ method: "POST",
431
+ headers,
432
+ path: resolvedPath,
433
+ body,
1111
434
  });
1112
- }); };
1113
- export var deserializeAws_restJson1DisableOrganizationAdminAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1114
- var contents;
1115
- return __generator(this, function (_a) {
1116
- switch (_a.label) {
1117
- case 0:
1118
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1119
- return [2, deserializeAws_restJson1DisableOrganizationAdminAccountCommandError(output, context)];
1120
- }
1121
- contents = map({
1122
- $metadata: deserializeMetadata(output),
1123
- });
1124
- return [4, collectBody(output.body, context)];
1125
- case 1:
1126
- _a.sent();
1127
- return [2, contents];
1128
- }
435
+ };
436
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
437
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
438
+ const headers = {};
439
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
440
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
441
+ const query = map({
442
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
443
+ });
444
+ let body;
445
+ return new __HttpRequest({
446
+ protocol,
447
+ hostname,
448
+ port,
449
+ method: "DELETE",
450
+ headers,
451
+ path: resolvedPath,
452
+ query,
453
+ body,
1129
454
  });
1130
- }); };
1131
- var deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1132
- var parsedOutput, _a, errorCode, _b, parsedBody;
1133
- var _c;
1134
- return __generator(this, function (_d) {
1135
- switch (_d.label) {
1136
- case 0:
1137
- _a = [__assign({}, output)];
1138
- _c = {};
1139
- return [4, parseErrorBody(output.body, context)];
1140
- case 1:
1141
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1142
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1143
- _b = errorCode;
1144
- switch (_b) {
1145
- case "InternalServerException": return [3, 2];
1146
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1147
- case "TooManyRequestsException": return [3, 4];
1148
- case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1149
- case "ValidationException": return [3, 6];
1150
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1151
- }
1152
- return [3, 8];
1153
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1154
- case 3: throw _d.sent();
1155
- case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1156
- case 5: throw _d.sent();
1157
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1158
- case 7: throw _d.sent();
1159
- case 8:
1160
- parsedBody = parsedOutput.body;
1161
- throwDefaultError({
1162
- output: output,
1163
- parsedBody: parsedBody,
1164
- exceptionCtor: __BaseException,
1165
- errorCode: errorCode,
1166
- });
1167
- _d.label = 9;
1168
- case 9: return [2];
1169
- }
455
+ };
456
+ export const serializeAws_restJson1UpdateDatasourcePackagesCommand = async (input, context) => {
457
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
458
+ const headers = {
459
+ "content-type": "application/json",
460
+ };
461
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/graph/datasources/update";
462
+ let body;
463
+ body = JSON.stringify({
464
+ ...(input.DatasourcePackages != null && {
465
+ DatasourcePackages: serializeAws_restJson1DatasourcePackageList(input.DatasourcePackages, context),
466
+ }),
467
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
468
+ });
469
+ return new __HttpRequest({
470
+ protocol,
471
+ hostname,
472
+ port,
473
+ method: "POST",
474
+ headers,
475
+ path: resolvedPath,
476
+ body,
1170
477
  });
1171
- }); };
1172
- export var deserializeAws_restJson1DisassociateMembershipCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1173
- var contents;
1174
- return __generator(this, function (_a) {
1175
- switch (_a.label) {
1176
- case 0:
1177
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1178
- return [2, deserializeAws_restJson1DisassociateMembershipCommandError(output, context)];
1179
- }
1180
- contents = map({
1181
- $metadata: deserializeMetadata(output),
1182
- });
1183
- return [4, collectBody(output.body, context)];
1184
- case 1:
1185
- _a.sent();
1186
- return [2, contents];
1187
- }
478
+ };
479
+ export const serializeAws_restJson1UpdateOrganizationConfigurationCommand = async (input, context) => {
480
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
481
+ const headers = {
482
+ "content-type": "application/json",
483
+ };
484
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orgs/updateOrganizationConfiguration";
485
+ let body;
486
+ body = JSON.stringify({
487
+ ...(input.AutoEnable != null && { AutoEnable: input.AutoEnable }),
488
+ ...(input.GraphArn != null && { GraphArn: input.GraphArn }),
489
+ });
490
+ return new __HttpRequest({
491
+ protocol,
492
+ hostname,
493
+ port,
494
+ method: "POST",
495
+ headers,
496
+ path: resolvedPath,
497
+ body,
1188
498
  });
1189
- }); };
1190
- var deserializeAws_restJson1DisassociateMembershipCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1191
- var parsedOutput, _a, errorCode, _b, parsedBody;
1192
- var _c;
1193
- return __generator(this, function (_d) {
1194
- switch (_d.label) {
1195
- case 0:
1196
- _a = [__assign({}, output)];
1197
- _c = {};
1198
- return [4, parseErrorBody(output.body, context)];
1199
- case 1:
1200
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1201
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1202
- _b = errorCode;
1203
- switch (_b) {
1204
- case "ConflictException": return [3, 2];
1205
- case "com.amazonaws.detective#ConflictException": return [3, 2];
1206
- case "InternalServerException": return [3, 4];
1207
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
1208
- case "ResourceNotFoundException": return [3, 6];
1209
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 6];
1210
- case "ValidationException": return [3, 8];
1211
- case "com.amazonaws.detective#ValidationException": return [3, 8];
1212
- }
1213
- return [3, 10];
1214
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1215
- case 3: throw _d.sent();
1216
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1217
- case 5: throw _d.sent();
1218
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1219
- case 7: throw _d.sent();
1220
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1221
- case 9: throw _d.sent();
1222
- case 10:
1223
- parsedBody = parsedOutput.body;
1224
- throwDefaultError({
1225
- output: output,
1226
- parsedBody: parsedBody,
1227
- exceptionCtor: __BaseException,
1228
- errorCode: errorCode,
1229
- });
1230
- _d.label = 11;
1231
- case 11: return [2];
1232
- }
499
+ };
500
+ export const deserializeAws_restJson1AcceptInvitationCommand = async (output, context) => {
501
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
502
+ return deserializeAws_restJson1AcceptInvitationCommandError(output, context);
503
+ }
504
+ const contents = map({
505
+ $metadata: deserializeMetadata(output),
1233
506
  });
1234
- }); };
1235
- export var deserializeAws_restJson1EnableOrganizationAdminAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1236
- var contents;
1237
- return __generator(this, function (_a) {
1238
- switch (_a.label) {
1239
- case 0:
1240
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1241
- return [2, deserializeAws_restJson1EnableOrganizationAdminAccountCommandError(output, context)];
1242
- }
1243
- contents = map({
1244
- $metadata: deserializeMetadata(output),
1245
- });
1246
- return [4, collectBody(output.body, context)];
1247
- case 1:
1248
- _a.sent();
1249
- return [2, contents];
1250
- }
507
+ await collectBody(output.body, context);
508
+ return contents;
509
+ };
510
+ const deserializeAws_restJson1AcceptInvitationCommandError = async (output, context) => {
511
+ const parsedOutput = {
512
+ ...output,
513
+ body: await parseErrorBody(output.body, context),
514
+ };
515
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
516
+ switch (errorCode) {
517
+ case "ConflictException":
518
+ case "com.amazonaws.detective#ConflictException":
519
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
520
+ case "InternalServerException":
521
+ case "com.amazonaws.detective#InternalServerException":
522
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
523
+ case "ResourceNotFoundException":
524
+ case "com.amazonaws.detective#ResourceNotFoundException":
525
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
526
+ case "ValidationException":
527
+ case "com.amazonaws.detective#ValidationException":
528
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
529
+ default:
530
+ const parsedBody = parsedOutput.body;
531
+ throwDefaultError({
532
+ output,
533
+ parsedBody,
534
+ exceptionCtor: __BaseException,
535
+ errorCode,
536
+ });
537
+ }
538
+ };
539
+ export const deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommand = async (output, context) => {
540
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
541
+ return deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError(output, context);
542
+ }
543
+ const contents = map({
544
+ $metadata: deserializeMetadata(output),
1251
545
  });
1252
- }); };
1253
- var deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1254
- var parsedOutput, _a, errorCode, _b, parsedBody;
1255
- var _c;
1256
- return __generator(this, function (_d) {
1257
- switch (_d.label) {
1258
- case 0:
1259
- _a = [__assign({}, output)];
1260
- _c = {};
1261
- return [4, parseErrorBody(output.body, context)];
1262
- case 1:
1263
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1264
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1265
- _b = errorCode;
1266
- switch (_b) {
1267
- case "InternalServerException": return [3, 2];
1268
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1269
- case "TooManyRequestsException": return [3, 4];
1270
- case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1271
- case "ValidationException": return [3, 6];
1272
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1273
- }
1274
- return [3, 8];
1275
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1276
- case 3: throw _d.sent();
1277
- case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1278
- case 5: throw _d.sent();
1279
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1280
- case 7: throw _d.sent();
1281
- case 8:
1282
- parsedBody = parsedOutput.body;
1283
- throwDefaultError({
1284
- output: output,
1285
- parsedBody: parsedBody,
1286
- exceptionCtor: __BaseException,
1287
- errorCode: errorCode,
1288
- });
1289
- _d.label = 9;
1290
- case 9: return [2];
1291
- }
546
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
547
+ if (data.MemberDatasources != null) {
548
+ contents.MemberDatasources = deserializeAws_restJson1MembershipDatasourcesList(data.MemberDatasources, context);
549
+ }
550
+ if (data.UnprocessedAccounts != null) {
551
+ contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
552
+ }
553
+ return contents;
554
+ };
555
+ const deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError = async (output, context) => {
556
+ const parsedOutput = {
557
+ ...output,
558
+ body: await parseErrorBody(output.body, context),
559
+ };
560
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
561
+ switch (errorCode) {
562
+ case "InternalServerException":
563
+ case "com.amazonaws.detective#InternalServerException":
564
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
565
+ case "ResourceNotFoundException":
566
+ case "com.amazonaws.detective#ResourceNotFoundException":
567
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
568
+ case "ValidationException":
569
+ case "com.amazonaws.detective#ValidationException":
570
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
571
+ default:
572
+ const parsedBody = parsedOutput.body;
573
+ throwDefaultError({
574
+ output,
575
+ parsedBody,
576
+ exceptionCtor: __BaseException,
577
+ errorCode,
578
+ });
579
+ }
580
+ };
581
+ export const deserializeAws_restJson1BatchGetMembershipDatasourcesCommand = async (output, context) => {
582
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
583
+ return deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError(output, context);
584
+ }
585
+ const contents = map({
586
+ $metadata: deserializeMetadata(output),
1292
587
  });
1293
- }); };
1294
- export var deserializeAws_restJson1GetMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1295
- var contents, data, _a, _b;
1296
- return __generator(this, function (_c) {
1297
- switch (_c.label) {
1298
- case 0:
1299
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1300
- return [2, deserializeAws_restJson1GetMembersCommandError(output, context)];
1301
- }
1302
- contents = map({
1303
- $metadata: deserializeMetadata(output),
1304
- });
1305
- _a = __expectNonNull;
1306
- _b = __expectObject;
1307
- return [4, parseBody(output.body, context)];
1308
- case 1:
1309
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1310
- if (data.MemberDetails != null) {
1311
- contents.MemberDetails = deserializeAws_restJson1MemberDetailList(data.MemberDetails, context);
1312
- }
1313
- if (data.UnprocessedAccounts != null) {
1314
- contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
1315
- }
1316
- return [2, contents];
1317
- }
588
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
589
+ if (data.MembershipDatasources != null) {
590
+ contents.MembershipDatasources = deserializeAws_restJson1MembershipDatasourcesList(data.MembershipDatasources, context);
591
+ }
592
+ if (data.UnprocessedGraphs != null) {
593
+ contents.UnprocessedGraphs = deserializeAws_restJson1UnprocessedGraphList(data.UnprocessedGraphs, context);
594
+ }
595
+ return contents;
596
+ };
597
+ const deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError = async (output, context) => {
598
+ const parsedOutput = {
599
+ ...output,
600
+ body: await parseErrorBody(output.body, context),
601
+ };
602
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
603
+ switch (errorCode) {
604
+ case "InternalServerException":
605
+ case "com.amazonaws.detective#InternalServerException":
606
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
607
+ case "ResourceNotFoundException":
608
+ case "com.amazonaws.detective#ResourceNotFoundException":
609
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
610
+ case "ValidationException":
611
+ case "com.amazonaws.detective#ValidationException":
612
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
613
+ default:
614
+ const parsedBody = parsedOutput.body;
615
+ throwDefaultError({
616
+ output,
617
+ parsedBody,
618
+ exceptionCtor: __BaseException,
619
+ errorCode,
620
+ });
621
+ }
622
+ };
623
+ export const deserializeAws_restJson1CreateGraphCommand = async (output, context) => {
624
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
625
+ return deserializeAws_restJson1CreateGraphCommandError(output, context);
626
+ }
627
+ const contents = map({
628
+ $metadata: deserializeMetadata(output),
1318
629
  });
1319
- }); };
1320
- var deserializeAws_restJson1GetMembersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1321
- var parsedOutput, _a, errorCode, _b, parsedBody;
1322
- var _c;
1323
- return __generator(this, function (_d) {
1324
- switch (_d.label) {
1325
- case 0:
1326
- _a = [__assign({}, output)];
1327
- _c = {};
1328
- return [4, parseErrorBody(output.body, context)];
1329
- case 1:
1330
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1331
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1332
- _b = errorCode;
1333
- switch (_b) {
1334
- case "InternalServerException": return [3, 2];
1335
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1336
- case "ResourceNotFoundException": return [3, 4];
1337
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1338
- case "ValidationException": return [3, 6];
1339
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1340
- }
1341
- return [3, 8];
1342
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1343
- case 3: throw _d.sent();
1344
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1345
- case 5: throw _d.sent();
1346
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1347
- case 7: throw _d.sent();
1348
- case 8:
1349
- parsedBody = parsedOutput.body;
1350
- throwDefaultError({
1351
- output: output,
1352
- parsedBody: parsedBody,
1353
- exceptionCtor: __BaseException,
1354
- errorCode: errorCode,
1355
- });
1356
- _d.label = 9;
1357
- case 9: return [2];
1358
- }
630
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
631
+ if (data.GraphArn != null) {
632
+ contents.GraphArn = __expectString(data.GraphArn);
633
+ }
634
+ return contents;
635
+ };
636
+ const deserializeAws_restJson1CreateGraphCommandError = async (output, context) => {
637
+ const parsedOutput = {
638
+ ...output,
639
+ body: await parseErrorBody(output.body, context),
640
+ };
641
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
642
+ switch (errorCode) {
643
+ case "ConflictException":
644
+ case "com.amazonaws.detective#ConflictException":
645
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
646
+ case "InternalServerException":
647
+ case "com.amazonaws.detective#InternalServerException":
648
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
649
+ case "ServiceQuotaExceededException":
650
+ case "com.amazonaws.detective#ServiceQuotaExceededException":
651
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
652
+ default:
653
+ const parsedBody = parsedOutput.body;
654
+ throwDefaultError({
655
+ output,
656
+ parsedBody,
657
+ exceptionCtor: __BaseException,
658
+ errorCode,
659
+ });
660
+ }
661
+ };
662
+ export const deserializeAws_restJson1CreateMembersCommand = async (output, context) => {
663
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
664
+ return deserializeAws_restJson1CreateMembersCommandError(output, context);
665
+ }
666
+ const contents = map({
667
+ $metadata: deserializeMetadata(output),
1359
668
  });
1360
- }); };
1361
- export var deserializeAws_restJson1ListDatasourcePackagesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1362
- var contents, data, _a, _b;
1363
- return __generator(this, function (_c) {
1364
- switch (_c.label) {
1365
- case 0:
1366
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1367
- return [2, deserializeAws_restJson1ListDatasourcePackagesCommandError(output, context)];
1368
- }
1369
- contents = map({
1370
- $metadata: deserializeMetadata(output),
1371
- });
1372
- _a = __expectNonNull;
1373
- _b = __expectObject;
1374
- return [4, parseBody(output.body, context)];
1375
- case 1:
1376
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1377
- if (data.DatasourcePackages != null) {
1378
- contents.DatasourcePackages = deserializeAws_restJson1DatasourcePackageIngestDetails(data.DatasourcePackages, context);
1379
- }
1380
- if (data.NextToken != null) {
1381
- contents.NextToken = __expectString(data.NextToken);
1382
- }
1383
- return [2, contents];
1384
- }
669
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
670
+ if (data.Members != null) {
671
+ contents.Members = deserializeAws_restJson1MemberDetailList(data.Members, context);
672
+ }
673
+ if (data.UnprocessedAccounts != null) {
674
+ contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
675
+ }
676
+ return contents;
677
+ };
678
+ const deserializeAws_restJson1CreateMembersCommandError = async (output, context) => {
679
+ const parsedOutput = {
680
+ ...output,
681
+ body: await parseErrorBody(output.body, context),
682
+ };
683
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
684
+ switch (errorCode) {
685
+ case "InternalServerException":
686
+ case "com.amazonaws.detective#InternalServerException":
687
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
688
+ case "ResourceNotFoundException":
689
+ case "com.amazonaws.detective#ResourceNotFoundException":
690
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
691
+ case "ServiceQuotaExceededException":
692
+ case "com.amazonaws.detective#ServiceQuotaExceededException":
693
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
694
+ case "ValidationException":
695
+ case "com.amazonaws.detective#ValidationException":
696
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
697
+ default:
698
+ const parsedBody = parsedOutput.body;
699
+ throwDefaultError({
700
+ output,
701
+ parsedBody,
702
+ exceptionCtor: __BaseException,
703
+ errorCode,
704
+ });
705
+ }
706
+ };
707
+ export const deserializeAws_restJson1DeleteGraphCommand = async (output, context) => {
708
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
709
+ return deserializeAws_restJson1DeleteGraphCommandError(output, context);
710
+ }
711
+ const contents = map({
712
+ $metadata: deserializeMetadata(output),
1385
713
  });
1386
- }); };
1387
- var deserializeAws_restJson1ListDatasourcePackagesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1388
- var parsedOutput, _a, errorCode, _b, parsedBody;
1389
- var _c;
1390
- return __generator(this, function (_d) {
1391
- switch (_d.label) {
1392
- case 0:
1393
- _a = [__assign({}, output)];
1394
- _c = {};
1395
- return [4, parseErrorBody(output.body, context)];
1396
- case 1:
1397
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1398
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1399
- _b = errorCode;
1400
- switch (_b) {
1401
- case "InternalServerException": return [3, 2];
1402
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1403
- case "ResourceNotFoundException": return [3, 4];
1404
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1405
- case "ValidationException": return [3, 6];
1406
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1407
- }
1408
- return [3, 8];
1409
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1410
- case 3: throw _d.sent();
1411
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1412
- case 5: throw _d.sent();
1413
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1414
- case 7: throw _d.sent();
1415
- case 8:
1416
- parsedBody = parsedOutput.body;
1417
- throwDefaultError({
1418
- output: output,
1419
- parsedBody: parsedBody,
1420
- exceptionCtor: __BaseException,
1421
- errorCode: errorCode,
1422
- });
1423
- _d.label = 9;
1424
- case 9: return [2];
1425
- }
714
+ await collectBody(output.body, context);
715
+ return contents;
716
+ };
717
+ const deserializeAws_restJson1DeleteGraphCommandError = async (output, context) => {
718
+ const parsedOutput = {
719
+ ...output,
720
+ body: await parseErrorBody(output.body, context),
721
+ };
722
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
723
+ switch (errorCode) {
724
+ case "InternalServerException":
725
+ case "com.amazonaws.detective#InternalServerException":
726
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
727
+ case "ResourceNotFoundException":
728
+ case "com.amazonaws.detective#ResourceNotFoundException":
729
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
730
+ case "ValidationException":
731
+ case "com.amazonaws.detective#ValidationException":
732
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
733
+ default:
734
+ const parsedBody = parsedOutput.body;
735
+ throwDefaultError({
736
+ output,
737
+ parsedBody,
738
+ exceptionCtor: __BaseException,
739
+ errorCode,
740
+ });
741
+ }
742
+ };
743
+ export const deserializeAws_restJson1DeleteMembersCommand = async (output, context) => {
744
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
745
+ return deserializeAws_restJson1DeleteMembersCommandError(output, context);
746
+ }
747
+ const contents = map({
748
+ $metadata: deserializeMetadata(output),
1426
749
  });
1427
- }); };
1428
- export var deserializeAws_restJson1ListGraphsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1429
- var contents, data, _a, _b;
1430
- return __generator(this, function (_c) {
1431
- switch (_c.label) {
1432
- case 0:
1433
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1434
- return [2, deserializeAws_restJson1ListGraphsCommandError(output, context)];
1435
- }
1436
- contents = map({
1437
- $metadata: deserializeMetadata(output),
1438
- });
1439
- _a = __expectNonNull;
1440
- _b = __expectObject;
1441
- return [4, parseBody(output.body, context)];
1442
- case 1:
1443
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1444
- if (data.GraphList != null) {
1445
- contents.GraphList = deserializeAws_restJson1GraphList(data.GraphList, context);
1446
- }
1447
- if (data.NextToken != null) {
1448
- contents.NextToken = __expectString(data.NextToken);
1449
- }
1450
- return [2, contents];
1451
- }
750
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
751
+ if (data.AccountIds != null) {
752
+ contents.AccountIds = deserializeAws_restJson1AccountIdList(data.AccountIds, context);
753
+ }
754
+ if (data.UnprocessedAccounts != null) {
755
+ contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
756
+ }
757
+ return contents;
758
+ };
759
+ const deserializeAws_restJson1DeleteMembersCommandError = async (output, context) => {
760
+ const parsedOutput = {
761
+ ...output,
762
+ body: await parseErrorBody(output.body, context),
763
+ };
764
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
765
+ switch (errorCode) {
766
+ case "ConflictException":
767
+ case "com.amazonaws.detective#ConflictException":
768
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
769
+ case "InternalServerException":
770
+ case "com.amazonaws.detective#InternalServerException":
771
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
772
+ case "ResourceNotFoundException":
773
+ case "com.amazonaws.detective#ResourceNotFoundException":
774
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
775
+ case "ValidationException":
776
+ case "com.amazonaws.detective#ValidationException":
777
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
778
+ default:
779
+ const parsedBody = parsedOutput.body;
780
+ throwDefaultError({
781
+ output,
782
+ parsedBody,
783
+ exceptionCtor: __BaseException,
784
+ errorCode,
785
+ });
786
+ }
787
+ };
788
+ export const deserializeAws_restJson1DescribeOrganizationConfigurationCommand = async (output, context) => {
789
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
790
+ return deserializeAws_restJson1DescribeOrganizationConfigurationCommandError(output, context);
791
+ }
792
+ const contents = map({
793
+ $metadata: deserializeMetadata(output),
1452
794
  });
1453
- }); };
1454
- var deserializeAws_restJson1ListGraphsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1455
- var parsedOutput, _a, errorCode, _b, parsedBody;
1456
- var _c;
1457
- return __generator(this, function (_d) {
1458
- switch (_d.label) {
1459
- case 0:
1460
- _a = [__assign({}, output)];
1461
- _c = {};
1462
- return [4, parseErrorBody(output.body, context)];
1463
- case 1:
1464
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1465
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1466
- _b = errorCode;
1467
- switch (_b) {
1468
- case "InternalServerException": return [3, 2];
1469
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1470
- case "ValidationException": return [3, 4];
1471
- case "com.amazonaws.detective#ValidationException": return [3, 4];
1472
- }
1473
- return [3, 6];
1474
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1475
- case 3: throw _d.sent();
1476
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1477
- case 5: throw _d.sent();
1478
- case 6:
1479
- parsedBody = parsedOutput.body;
1480
- throwDefaultError({
1481
- output: output,
1482
- parsedBody: parsedBody,
1483
- exceptionCtor: __BaseException,
1484
- errorCode: errorCode,
1485
- });
1486
- _d.label = 7;
1487
- case 7: return [2];
1488
- }
795
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
796
+ if (data.AutoEnable != null) {
797
+ contents.AutoEnable = __expectBoolean(data.AutoEnable);
798
+ }
799
+ return contents;
800
+ };
801
+ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = async (output, context) => {
802
+ const parsedOutput = {
803
+ ...output,
804
+ body: await parseErrorBody(output.body, context),
805
+ };
806
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
807
+ switch (errorCode) {
808
+ case "InternalServerException":
809
+ case "com.amazonaws.detective#InternalServerException":
810
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
811
+ case "TooManyRequestsException":
812
+ case "com.amazonaws.detective#TooManyRequestsException":
813
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
814
+ case "ValidationException":
815
+ case "com.amazonaws.detective#ValidationException":
816
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
817
+ default:
818
+ const parsedBody = parsedOutput.body;
819
+ throwDefaultError({
820
+ output,
821
+ parsedBody,
822
+ exceptionCtor: __BaseException,
823
+ errorCode,
824
+ });
825
+ }
826
+ };
827
+ export const deserializeAws_restJson1DisableOrganizationAdminAccountCommand = async (output, context) => {
828
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
829
+ return deserializeAws_restJson1DisableOrganizationAdminAccountCommandError(output, context);
830
+ }
831
+ const contents = map({
832
+ $metadata: deserializeMetadata(output),
1489
833
  });
1490
- }); };
1491
- export var deserializeAws_restJson1ListInvitationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1492
- var contents, data, _a, _b;
1493
- return __generator(this, function (_c) {
1494
- switch (_c.label) {
1495
- case 0:
1496
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1497
- return [2, deserializeAws_restJson1ListInvitationsCommandError(output, context)];
1498
- }
1499
- contents = map({
1500
- $metadata: deserializeMetadata(output),
1501
- });
1502
- _a = __expectNonNull;
1503
- _b = __expectObject;
1504
- return [4, parseBody(output.body, context)];
1505
- case 1:
1506
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1507
- if (data.Invitations != null) {
1508
- contents.Invitations = deserializeAws_restJson1MemberDetailList(data.Invitations, context);
1509
- }
1510
- if (data.NextToken != null) {
1511
- contents.NextToken = __expectString(data.NextToken);
1512
- }
1513
- return [2, contents];
1514
- }
834
+ await collectBody(output.body, context);
835
+ return contents;
836
+ };
837
+ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = async (output, context) => {
838
+ const parsedOutput = {
839
+ ...output,
840
+ body: await parseErrorBody(output.body, context),
841
+ };
842
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
843
+ switch (errorCode) {
844
+ case "InternalServerException":
845
+ case "com.amazonaws.detective#InternalServerException":
846
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
847
+ case "TooManyRequestsException":
848
+ case "com.amazonaws.detective#TooManyRequestsException":
849
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
850
+ case "ValidationException":
851
+ case "com.amazonaws.detective#ValidationException":
852
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
853
+ default:
854
+ const parsedBody = parsedOutput.body;
855
+ throwDefaultError({
856
+ output,
857
+ parsedBody,
858
+ exceptionCtor: __BaseException,
859
+ errorCode,
860
+ });
861
+ }
862
+ };
863
+ export const deserializeAws_restJson1DisassociateMembershipCommand = async (output, context) => {
864
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
865
+ return deserializeAws_restJson1DisassociateMembershipCommandError(output, context);
866
+ }
867
+ const contents = map({
868
+ $metadata: deserializeMetadata(output),
1515
869
  });
1516
- }); };
1517
- var deserializeAws_restJson1ListInvitationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1518
- var parsedOutput, _a, errorCode, _b, parsedBody;
1519
- var _c;
1520
- return __generator(this, function (_d) {
1521
- switch (_d.label) {
1522
- case 0:
1523
- _a = [__assign({}, output)];
1524
- _c = {};
1525
- return [4, parseErrorBody(output.body, context)];
1526
- case 1:
1527
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1528
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1529
- _b = errorCode;
1530
- switch (_b) {
1531
- case "InternalServerException": return [3, 2];
1532
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1533
- case "ValidationException": return [3, 4];
1534
- case "com.amazonaws.detective#ValidationException": return [3, 4];
1535
- }
1536
- return [3, 6];
1537
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1538
- case 3: throw _d.sent();
1539
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1540
- case 5: throw _d.sent();
1541
- case 6:
1542
- parsedBody = parsedOutput.body;
1543
- throwDefaultError({
1544
- output: output,
1545
- parsedBody: parsedBody,
1546
- exceptionCtor: __BaseException,
1547
- errorCode: errorCode,
1548
- });
1549
- _d.label = 7;
1550
- case 7: return [2];
1551
- }
870
+ await collectBody(output.body, context);
871
+ return contents;
872
+ };
873
+ const deserializeAws_restJson1DisassociateMembershipCommandError = async (output, context) => {
874
+ const parsedOutput = {
875
+ ...output,
876
+ body: await parseErrorBody(output.body, context),
877
+ };
878
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
879
+ switch (errorCode) {
880
+ case "ConflictException":
881
+ case "com.amazonaws.detective#ConflictException":
882
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
883
+ case "InternalServerException":
884
+ case "com.amazonaws.detective#InternalServerException":
885
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
886
+ case "ResourceNotFoundException":
887
+ case "com.amazonaws.detective#ResourceNotFoundException":
888
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
889
+ case "ValidationException":
890
+ case "com.amazonaws.detective#ValidationException":
891
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
892
+ default:
893
+ const parsedBody = parsedOutput.body;
894
+ throwDefaultError({
895
+ output,
896
+ parsedBody,
897
+ exceptionCtor: __BaseException,
898
+ errorCode,
899
+ });
900
+ }
901
+ };
902
+ export const deserializeAws_restJson1EnableOrganizationAdminAccountCommand = async (output, context) => {
903
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
904
+ return deserializeAws_restJson1EnableOrganizationAdminAccountCommandError(output, context);
905
+ }
906
+ const contents = map({
907
+ $metadata: deserializeMetadata(output),
1552
908
  });
1553
- }); };
1554
- export var deserializeAws_restJson1ListMembersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1555
- var contents, data, _a, _b;
1556
- return __generator(this, function (_c) {
1557
- switch (_c.label) {
1558
- case 0:
1559
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1560
- return [2, deserializeAws_restJson1ListMembersCommandError(output, context)];
1561
- }
1562
- contents = map({
1563
- $metadata: deserializeMetadata(output),
1564
- });
1565
- _a = __expectNonNull;
1566
- _b = __expectObject;
1567
- return [4, parseBody(output.body, context)];
1568
- case 1:
1569
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1570
- if (data.MemberDetails != null) {
1571
- contents.MemberDetails = deserializeAws_restJson1MemberDetailList(data.MemberDetails, context);
1572
- }
1573
- if (data.NextToken != null) {
1574
- contents.NextToken = __expectString(data.NextToken);
1575
- }
1576
- return [2, contents];
1577
- }
909
+ await collectBody(output.body, context);
910
+ return contents;
911
+ };
912
+ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async (output, context) => {
913
+ const parsedOutput = {
914
+ ...output,
915
+ body: await parseErrorBody(output.body, context),
916
+ };
917
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
918
+ switch (errorCode) {
919
+ case "InternalServerException":
920
+ case "com.amazonaws.detective#InternalServerException":
921
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
922
+ case "TooManyRequestsException":
923
+ case "com.amazonaws.detective#TooManyRequestsException":
924
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
925
+ case "ValidationException":
926
+ case "com.amazonaws.detective#ValidationException":
927
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
928
+ default:
929
+ const parsedBody = parsedOutput.body;
930
+ throwDefaultError({
931
+ output,
932
+ parsedBody,
933
+ exceptionCtor: __BaseException,
934
+ errorCode,
935
+ });
936
+ }
937
+ };
938
+ export const deserializeAws_restJson1GetMembersCommand = async (output, context) => {
939
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
940
+ return deserializeAws_restJson1GetMembersCommandError(output, context);
941
+ }
942
+ const contents = map({
943
+ $metadata: deserializeMetadata(output),
1578
944
  });
1579
- }); };
1580
- var deserializeAws_restJson1ListMembersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1581
- var parsedOutput, _a, errorCode, _b, parsedBody;
1582
- var _c;
1583
- return __generator(this, function (_d) {
1584
- switch (_d.label) {
1585
- case 0:
1586
- _a = [__assign({}, output)];
1587
- _c = {};
1588
- return [4, parseErrorBody(output.body, context)];
1589
- case 1:
1590
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1591
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1592
- _b = errorCode;
1593
- switch (_b) {
1594
- case "InternalServerException": return [3, 2];
1595
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1596
- case "ResourceNotFoundException": return [3, 4];
1597
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1598
- case "ValidationException": return [3, 6];
1599
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1600
- }
1601
- return [3, 8];
1602
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1603
- case 3: throw _d.sent();
1604
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1605
- case 5: throw _d.sent();
1606
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1607
- case 7: throw _d.sent();
1608
- case 8:
1609
- parsedBody = parsedOutput.body;
1610
- throwDefaultError({
1611
- output: output,
1612
- parsedBody: parsedBody,
1613
- exceptionCtor: __BaseException,
1614
- errorCode: errorCode,
1615
- });
1616
- _d.label = 9;
1617
- case 9: return [2];
1618
- }
945
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
946
+ if (data.MemberDetails != null) {
947
+ contents.MemberDetails = deserializeAws_restJson1MemberDetailList(data.MemberDetails, context);
948
+ }
949
+ if (data.UnprocessedAccounts != null) {
950
+ contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccountList(data.UnprocessedAccounts, context);
951
+ }
952
+ return contents;
953
+ };
954
+ const deserializeAws_restJson1GetMembersCommandError = async (output, context) => {
955
+ const parsedOutput = {
956
+ ...output,
957
+ body: await parseErrorBody(output.body, context),
958
+ };
959
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
960
+ switch (errorCode) {
961
+ case "InternalServerException":
962
+ case "com.amazonaws.detective#InternalServerException":
963
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
964
+ case "ResourceNotFoundException":
965
+ case "com.amazonaws.detective#ResourceNotFoundException":
966
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
967
+ case "ValidationException":
968
+ case "com.amazonaws.detective#ValidationException":
969
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
970
+ default:
971
+ const parsedBody = parsedOutput.body;
972
+ throwDefaultError({
973
+ output,
974
+ parsedBody,
975
+ exceptionCtor: __BaseException,
976
+ errorCode,
977
+ });
978
+ }
979
+ };
980
+ export const deserializeAws_restJson1ListDatasourcePackagesCommand = async (output, context) => {
981
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
982
+ return deserializeAws_restJson1ListDatasourcePackagesCommandError(output, context);
983
+ }
984
+ const contents = map({
985
+ $metadata: deserializeMetadata(output),
1619
986
  });
1620
- }); };
1621
- export var deserializeAws_restJson1ListOrganizationAdminAccountsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1622
- var contents, data, _a, _b;
1623
- return __generator(this, function (_c) {
1624
- switch (_c.label) {
1625
- case 0:
1626
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1627
- return [2, deserializeAws_restJson1ListOrganizationAdminAccountsCommandError(output, context)];
1628
- }
1629
- contents = map({
1630
- $metadata: deserializeMetadata(output),
1631
- });
1632
- _a = __expectNonNull;
1633
- _b = __expectObject;
1634
- return [4, parseBody(output.body, context)];
1635
- case 1:
1636
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1637
- if (data.Administrators != null) {
1638
- contents.Administrators = deserializeAws_restJson1AdministratorList(data.Administrators, context);
1639
- }
1640
- if (data.NextToken != null) {
1641
- contents.NextToken = __expectString(data.NextToken);
1642
- }
1643
- return [2, contents];
1644
- }
987
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
988
+ if (data.DatasourcePackages != null) {
989
+ contents.DatasourcePackages = deserializeAws_restJson1DatasourcePackageIngestDetails(data.DatasourcePackages, context);
990
+ }
991
+ if (data.NextToken != null) {
992
+ contents.NextToken = __expectString(data.NextToken);
993
+ }
994
+ return contents;
995
+ };
996
+ const deserializeAws_restJson1ListDatasourcePackagesCommandError = async (output, context) => {
997
+ const parsedOutput = {
998
+ ...output,
999
+ body: await parseErrorBody(output.body, context),
1000
+ };
1001
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1002
+ switch (errorCode) {
1003
+ case "InternalServerException":
1004
+ case "com.amazonaws.detective#InternalServerException":
1005
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1006
+ case "ResourceNotFoundException":
1007
+ case "com.amazonaws.detective#ResourceNotFoundException":
1008
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1009
+ case "ValidationException":
1010
+ case "com.amazonaws.detective#ValidationException":
1011
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1012
+ default:
1013
+ const parsedBody = parsedOutput.body;
1014
+ throwDefaultError({
1015
+ output,
1016
+ parsedBody,
1017
+ exceptionCtor: __BaseException,
1018
+ errorCode,
1019
+ });
1020
+ }
1021
+ };
1022
+ export const deserializeAws_restJson1ListGraphsCommand = async (output, context) => {
1023
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1024
+ return deserializeAws_restJson1ListGraphsCommandError(output, context);
1025
+ }
1026
+ const contents = map({
1027
+ $metadata: deserializeMetadata(output),
1645
1028
  });
1646
- }); };
1647
- var deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1648
- var parsedOutput, _a, errorCode, _b, parsedBody;
1649
- var _c;
1650
- return __generator(this, function (_d) {
1651
- switch (_d.label) {
1652
- case 0:
1653
- _a = [__assign({}, output)];
1654
- _c = {};
1655
- return [4, parseErrorBody(output.body, context)];
1656
- case 1:
1657
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1658
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1659
- _b = errorCode;
1660
- switch (_b) {
1661
- case "InternalServerException": return [3, 2];
1662
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1663
- case "TooManyRequestsException": return [3, 4];
1664
- case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
1665
- case "ValidationException": return [3, 6];
1666
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1667
- }
1668
- return [3, 8];
1669
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1670
- case 3: throw _d.sent();
1671
- case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1672
- case 5: throw _d.sent();
1673
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1674
- case 7: throw _d.sent();
1675
- case 8:
1676
- parsedBody = parsedOutput.body;
1677
- throwDefaultError({
1678
- output: output,
1679
- parsedBody: parsedBody,
1680
- exceptionCtor: __BaseException,
1681
- errorCode: errorCode,
1682
- });
1683
- _d.label = 9;
1684
- case 9: return [2];
1685
- }
1029
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1030
+ if (data.GraphList != null) {
1031
+ contents.GraphList = deserializeAws_restJson1GraphList(data.GraphList, context);
1032
+ }
1033
+ if (data.NextToken != null) {
1034
+ contents.NextToken = __expectString(data.NextToken);
1035
+ }
1036
+ return contents;
1037
+ };
1038
+ const deserializeAws_restJson1ListGraphsCommandError = async (output, context) => {
1039
+ const parsedOutput = {
1040
+ ...output,
1041
+ body: await parseErrorBody(output.body, context),
1042
+ };
1043
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1044
+ switch (errorCode) {
1045
+ case "InternalServerException":
1046
+ case "com.amazonaws.detective#InternalServerException":
1047
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1048
+ case "ValidationException":
1049
+ case "com.amazonaws.detective#ValidationException":
1050
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1051
+ default:
1052
+ const parsedBody = parsedOutput.body;
1053
+ throwDefaultError({
1054
+ output,
1055
+ parsedBody,
1056
+ exceptionCtor: __BaseException,
1057
+ errorCode,
1058
+ });
1059
+ }
1060
+ };
1061
+ export const deserializeAws_restJson1ListInvitationsCommand = async (output, context) => {
1062
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1063
+ return deserializeAws_restJson1ListInvitationsCommandError(output, context);
1064
+ }
1065
+ const contents = map({
1066
+ $metadata: deserializeMetadata(output),
1686
1067
  });
1687
- }); };
1688
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1689
- var contents, data, _a, _b;
1690
- return __generator(this, function (_c) {
1691
- switch (_c.label) {
1692
- case 0:
1693
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1694
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1695
- }
1696
- contents = map({
1697
- $metadata: deserializeMetadata(output),
1698
- });
1699
- _a = __expectNonNull;
1700
- _b = __expectObject;
1701
- return [4, parseBody(output.body, context)];
1702
- case 1:
1703
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1704
- if (data.Tags != null) {
1705
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1706
- }
1707
- return [2, contents];
1708
- }
1068
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1069
+ if (data.Invitations != null) {
1070
+ contents.Invitations = deserializeAws_restJson1MemberDetailList(data.Invitations, context);
1071
+ }
1072
+ if (data.NextToken != null) {
1073
+ contents.NextToken = __expectString(data.NextToken);
1074
+ }
1075
+ return contents;
1076
+ };
1077
+ const deserializeAws_restJson1ListInvitationsCommandError = async (output, context) => {
1078
+ const parsedOutput = {
1079
+ ...output,
1080
+ body: await parseErrorBody(output.body, context),
1081
+ };
1082
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1083
+ switch (errorCode) {
1084
+ case "InternalServerException":
1085
+ case "com.amazonaws.detective#InternalServerException":
1086
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1087
+ case "ValidationException":
1088
+ case "com.amazonaws.detective#ValidationException":
1089
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1090
+ default:
1091
+ const parsedBody = parsedOutput.body;
1092
+ throwDefaultError({
1093
+ output,
1094
+ parsedBody,
1095
+ exceptionCtor: __BaseException,
1096
+ errorCode,
1097
+ });
1098
+ }
1099
+ };
1100
+ export const deserializeAws_restJson1ListMembersCommand = async (output, context) => {
1101
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1102
+ return deserializeAws_restJson1ListMembersCommandError(output, context);
1103
+ }
1104
+ const contents = map({
1105
+ $metadata: deserializeMetadata(output),
1709
1106
  });
1710
- }); };
1711
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1712
- var parsedOutput, _a, errorCode, _b, parsedBody;
1713
- var _c;
1714
- return __generator(this, function (_d) {
1715
- switch (_d.label) {
1716
- case 0:
1717
- _a = [__assign({}, output)];
1718
- _c = {};
1719
- return [4, parseErrorBody(output.body, context)];
1720
- case 1:
1721
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1722
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1723
- _b = errorCode;
1724
- switch (_b) {
1725
- case "InternalServerException": return [3, 2];
1726
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1727
- case "ResourceNotFoundException": return [3, 4];
1728
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1729
- case "ValidationException": return [3, 6];
1730
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1731
- }
1732
- return [3, 8];
1733
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1734
- case 3: throw _d.sent();
1735
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1736
- case 5: throw _d.sent();
1737
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1738
- case 7: throw _d.sent();
1739
- case 8:
1740
- parsedBody = parsedOutput.body;
1741
- throwDefaultError({
1742
- output: output,
1743
- parsedBody: parsedBody,
1744
- exceptionCtor: __BaseException,
1745
- errorCode: errorCode,
1746
- });
1747
- _d.label = 9;
1748
- case 9: return [2];
1749
- }
1107
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1108
+ if (data.MemberDetails != null) {
1109
+ contents.MemberDetails = deserializeAws_restJson1MemberDetailList(data.MemberDetails, context);
1110
+ }
1111
+ if (data.NextToken != null) {
1112
+ contents.NextToken = __expectString(data.NextToken);
1113
+ }
1114
+ return contents;
1115
+ };
1116
+ const deserializeAws_restJson1ListMembersCommandError = async (output, context) => {
1117
+ const parsedOutput = {
1118
+ ...output,
1119
+ body: await parseErrorBody(output.body, context),
1120
+ };
1121
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1122
+ switch (errorCode) {
1123
+ case "InternalServerException":
1124
+ case "com.amazonaws.detective#InternalServerException":
1125
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1126
+ case "ResourceNotFoundException":
1127
+ case "com.amazonaws.detective#ResourceNotFoundException":
1128
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1129
+ case "ValidationException":
1130
+ case "com.amazonaws.detective#ValidationException":
1131
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1132
+ default:
1133
+ const parsedBody = parsedOutput.body;
1134
+ throwDefaultError({
1135
+ output,
1136
+ parsedBody,
1137
+ exceptionCtor: __BaseException,
1138
+ errorCode,
1139
+ });
1140
+ }
1141
+ };
1142
+ export const deserializeAws_restJson1ListOrganizationAdminAccountsCommand = async (output, context) => {
1143
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1144
+ return deserializeAws_restJson1ListOrganizationAdminAccountsCommandError(output, context);
1145
+ }
1146
+ const contents = map({
1147
+ $metadata: deserializeMetadata(output),
1750
1148
  });
1751
- }); };
1752
- export var deserializeAws_restJson1RejectInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1753
- var contents;
1754
- return __generator(this, function (_a) {
1755
- switch (_a.label) {
1756
- case 0:
1757
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1758
- return [2, deserializeAws_restJson1RejectInvitationCommandError(output, context)];
1759
- }
1760
- contents = map({
1761
- $metadata: deserializeMetadata(output),
1762
- });
1763
- return [4, collectBody(output.body, context)];
1764
- case 1:
1765
- _a.sent();
1766
- return [2, contents];
1767
- }
1149
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1150
+ if (data.Administrators != null) {
1151
+ contents.Administrators = deserializeAws_restJson1AdministratorList(data.Administrators, context);
1152
+ }
1153
+ if (data.NextToken != null) {
1154
+ contents.NextToken = __expectString(data.NextToken);
1155
+ }
1156
+ return contents;
1157
+ };
1158
+ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async (output, context) => {
1159
+ const parsedOutput = {
1160
+ ...output,
1161
+ body: await parseErrorBody(output.body, context),
1162
+ };
1163
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1164
+ switch (errorCode) {
1165
+ case "InternalServerException":
1166
+ case "com.amazonaws.detective#InternalServerException":
1167
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1168
+ case "TooManyRequestsException":
1169
+ case "com.amazonaws.detective#TooManyRequestsException":
1170
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1171
+ case "ValidationException":
1172
+ case "com.amazonaws.detective#ValidationException":
1173
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1174
+ default:
1175
+ const parsedBody = parsedOutput.body;
1176
+ throwDefaultError({
1177
+ output,
1178
+ parsedBody,
1179
+ exceptionCtor: __BaseException,
1180
+ errorCode,
1181
+ });
1182
+ }
1183
+ };
1184
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1185
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1186
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1187
+ }
1188
+ const contents = map({
1189
+ $metadata: deserializeMetadata(output),
1768
1190
  });
1769
- }); };
1770
- var deserializeAws_restJson1RejectInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1771
- var parsedOutput, _a, errorCode, _b, parsedBody;
1772
- var _c;
1773
- return __generator(this, function (_d) {
1774
- switch (_d.label) {
1775
- case 0:
1776
- _a = [__assign({}, output)];
1777
- _c = {};
1778
- return [4, parseErrorBody(output.body, context)];
1779
- case 1:
1780
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1781
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1782
- _b = errorCode;
1783
- switch (_b) {
1784
- case "ConflictException": return [3, 2];
1785
- case "com.amazonaws.detective#ConflictException": return [3, 2];
1786
- case "InternalServerException": return [3, 4];
1787
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
1788
- case "ResourceNotFoundException": return [3, 6];
1789
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 6];
1790
- case "ValidationException": return [3, 8];
1791
- case "com.amazonaws.detective#ValidationException": return [3, 8];
1792
- }
1793
- return [3, 10];
1794
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1795
- case 3: throw _d.sent();
1796
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1797
- case 5: throw _d.sent();
1798
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1799
- case 7: throw _d.sent();
1800
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1801
- case 9: throw _d.sent();
1802
- case 10:
1803
- parsedBody = parsedOutput.body;
1804
- throwDefaultError({
1805
- output: output,
1806
- parsedBody: parsedBody,
1807
- exceptionCtor: __BaseException,
1808
- errorCode: errorCode,
1809
- });
1810
- _d.label = 11;
1811
- case 11: return [2];
1812
- }
1191
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1192
+ if (data.Tags != null) {
1193
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1194
+ }
1195
+ return contents;
1196
+ };
1197
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1198
+ const parsedOutput = {
1199
+ ...output,
1200
+ body: await parseErrorBody(output.body, context),
1201
+ };
1202
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1203
+ switch (errorCode) {
1204
+ case "InternalServerException":
1205
+ case "com.amazonaws.detective#InternalServerException":
1206
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1207
+ case "ResourceNotFoundException":
1208
+ case "com.amazonaws.detective#ResourceNotFoundException":
1209
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1210
+ case "ValidationException":
1211
+ case "com.amazonaws.detective#ValidationException":
1212
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1213
+ default:
1214
+ const parsedBody = parsedOutput.body;
1215
+ throwDefaultError({
1216
+ output,
1217
+ parsedBody,
1218
+ exceptionCtor: __BaseException,
1219
+ errorCode,
1220
+ });
1221
+ }
1222
+ };
1223
+ export const deserializeAws_restJson1RejectInvitationCommand = async (output, context) => {
1224
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1225
+ return deserializeAws_restJson1RejectInvitationCommandError(output, context);
1226
+ }
1227
+ const contents = map({
1228
+ $metadata: deserializeMetadata(output),
1813
1229
  });
1814
- }); };
1815
- export var deserializeAws_restJson1StartMonitoringMemberCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1816
- var contents;
1817
- return __generator(this, function (_a) {
1818
- switch (_a.label) {
1819
- case 0:
1820
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1821
- return [2, deserializeAws_restJson1StartMonitoringMemberCommandError(output, context)];
1822
- }
1823
- contents = map({
1824
- $metadata: deserializeMetadata(output),
1825
- });
1826
- return [4, collectBody(output.body, context)];
1827
- case 1:
1828
- _a.sent();
1829
- return [2, contents];
1830
- }
1230
+ await collectBody(output.body, context);
1231
+ return contents;
1232
+ };
1233
+ const deserializeAws_restJson1RejectInvitationCommandError = async (output, context) => {
1234
+ const parsedOutput = {
1235
+ ...output,
1236
+ body: await parseErrorBody(output.body, context),
1237
+ };
1238
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1239
+ switch (errorCode) {
1240
+ case "ConflictException":
1241
+ case "com.amazonaws.detective#ConflictException":
1242
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1243
+ case "InternalServerException":
1244
+ case "com.amazonaws.detective#InternalServerException":
1245
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1246
+ case "ResourceNotFoundException":
1247
+ case "com.amazonaws.detective#ResourceNotFoundException":
1248
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1249
+ case "ValidationException":
1250
+ case "com.amazonaws.detective#ValidationException":
1251
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1252
+ default:
1253
+ const parsedBody = parsedOutput.body;
1254
+ throwDefaultError({
1255
+ output,
1256
+ parsedBody,
1257
+ exceptionCtor: __BaseException,
1258
+ errorCode,
1259
+ });
1260
+ }
1261
+ };
1262
+ export const deserializeAws_restJson1StartMonitoringMemberCommand = async (output, context) => {
1263
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1264
+ return deserializeAws_restJson1StartMonitoringMemberCommandError(output, context);
1265
+ }
1266
+ const contents = map({
1267
+ $metadata: deserializeMetadata(output),
1831
1268
  });
1832
- }); };
1833
- var deserializeAws_restJson1StartMonitoringMemberCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1834
- var parsedOutput, _a, errorCode, _b, parsedBody;
1835
- var _c;
1836
- return __generator(this, function (_d) {
1837
- switch (_d.label) {
1838
- case 0:
1839
- _a = [__assign({}, output)];
1840
- _c = {};
1841
- return [4, parseErrorBody(output.body, context)];
1842
- case 1:
1843
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1844
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1845
- _b = errorCode;
1846
- switch (_b) {
1847
- case "ConflictException": return [3, 2];
1848
- case "com.amazonaws.detective#ConflictException": return [3, 2];
1849
- case "InternalServerException": return [3, 4];
1850
- case "com.amazonaws.detective#InternalServerException": return [3, 4];
1851
- case "ResourceNotFoundException": return [3, 6];
1852
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 6];
1853
- case "ServiceQuotaExceededException": return [3, 8];
1854
- case "com.amazonaws.detective#ServiceQuotaExceededException": return [3, 8];
1855
- case "ValidationException": return [3, 10];
1856
- case "com.amazonaws.detective#ValidationException": return [3, 10];
1857
- }
1858
- return [3, 12];
1859
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1860
- case 3: throw _d.sent();
1861
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1862
- case 5: throw _d.sent();
1863
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1864
- case 7: throw _d.sent();
1865
- case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1866
- case 9: throw _d.sent();
1867
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1868
- case 11: throw _d.sent();
1869
- case 12:
1870
- parsedBody = parsedOutput.body;
1871
- throwDefaultError({
1872
- output: output,
1873
- parsedBody: parsedBody,
1874
- exceptionCtor: __BaseException,
1875
- errorCode: errorCode,
1876
- });
1877
- _d.label = 13;
1878
- case 13: return [2];
1879
- }
1269
+ await collectBody(output.body, context);
1270
+ return contents;
1271
+ };
1272
+ const deserializeAws_restJson1StartMonitoringMemberCommandError = async (output, context) => {
1273
+ const parsedOutput = {
1274
+ ...output,
1275
+ body: await parseErrorBody(output.body, context),
1276
+ };
1277
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1278
+ switch (errorCode) {
1279
+ case "ConflictException":
1280
+ case "com.amazonaws.detective#ConflictException":
1281
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1282
+ case "InternalServerException":
1283
+ case "com.amazonaws.detective#InternalServerException":
1284
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1285
+ case "ResourceNotFoundException":
1286
+ case "com.amazonaws.detective#ResourceNotFoundException":
1287
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1288
+ case "ServiceQuotaExceededException":
1289
+ case "com.amazonaws.detective#ServiceQuotaExceededException":
1290
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1291
+ case "ValidationException":
1292
+ case "com.amazonaws.detective#ValidationException":
1293
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1294
+ default:
1295
+ const parsedBody = parsedOutput.body;
1296
+ throwDefaultError({
1297
+ output,
1298
+ parsedBody,
1299
+ exceptionCtor: __BaseException,
1300
+ errorCode,
1301
+ });
1302
+ }
1303
+ };
1304
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1305
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1306
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1307
+ }
1308
+ const contents = map({
1309
+ $metadata: deserializeMetadata(output),
1880
1310
  });
1881
- }); };
1882
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1883
- var contents;
1884
- return __generator(this, function (_a) {
1885
- switch (_a.label) {
1886
- case 0:
1887
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1888
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1889
- }
1890
- contents = map({
1891
- $metadata: deserializeMetadata(output),
1892
- });
1893
- return [4, collectBody(output.body, context)];
1894
- case 1:
1895
- _a.sent();
1896
- return [2, contents];
1897
- }
1311
+ await collectBody(output.body, context);
1312
+ return contents;
1313
+ };
1314
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1315
+ const parsedOutput = {
1316
+ ...output,
1317
+ body: await parseErrorBody(output.body, context),
1318
+ };
1319
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1320
+ switch (errorCode) {
1321
+ case "InternalServerException":
1322
+ case "com.amazonaws.detective#InternalServerException":
1323
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1324
+ case "ResourceNotFoundException":
1325
+ case "com.amazonaws.detective#ResourceNotFoundException":
1326
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1327
+ case "ValidationException":
1328
+ case "com.amazonaws.detective#ValidationException":
1329
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1330
+ default:
1331
+ const parsedBody = parsedOutput.body;
1332
+ throwDefaultError({
1333
+ output,
1334
+ parsedBody,
1335
+ exceptionCtor: __BaseException,
1336
+ errorCode,
1337
+ });
1338
+ }
1339
+ };
1340
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1341
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1342
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1343
+ }
1344
+ const contents = map({
1345
+ $metadata: deserializeMetadata(output),
1898
1346
  });
1899
- }); };
1900
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1901
- var parsedOutput, _a, errorCode, _b, parsedBody;
1902
- var _c;
1903
- return __generator(this, function (_d) {
1904
- switch (_d.label) {
1905
- case 0:
1906
- _a = [__assign({}, output)];
1907
- _c = {};
1908
- return [4, parseErrorBody(output.body, context)];
1909
- case 1:
1910
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1911
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1912
- _b = errorCode;
1913
- switch (_b) {
1914
- case "InternalServerException": return [3, 2];
1915
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1916
- case "ResourceNotFoundException": return [3, 4];
1917
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1918
- case "ValidationException": return [3, 6];
1919
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1920
- }
1921
- return [3, 8];
1922
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1923
- case 3: throw _d.sent();
1924
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1925
- case 5: throw _d.sent();
1926
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1927
- case 7: throw _d.sent();
1928
- case 8:
1929
- parsedBody = parsedOutput.body;
1930
- throwDefaultError({
1931
- output: output,
1932
- parsedBody: parsedBody,
1933
- exceptionCtor: __BaseException,
1934
- errorCode: errorCode,
1935
- });
1936
- _d.label = 9;
1937
- case 9: return [2];
1938
- }
1347
+ await collectBody(output.body, context);
1348
+ return contents;
1349
+ };
1350
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1351
+ const parsedOutput = {
1352
+ ...output,
1353
+ body: await parseErrorBody(output.body, context),
1354
+ };
1355
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1356
+ switch (errorCode) {
1357
+ case "InternalServerException":
1358
+ case "com.amazonaws.detective#InternalServerException":
1359
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1360
+ case "ResourceNotFoundException":
1361
+ case "com.amazonaws.detective#ResourceNotFoundException":
1362
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1363
+ case "ValidationException":
1364
+ case "com.amazonaws.detective#ValidationException":
1365
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1366
+ default:
1367
+ const parsedBody = parsedOutput.body;
1368
+ throwDefaultError({
1369
+ output,
1370
+ parsedBody,
1371
+ exceptionCtor: __BaseException,
1372
+ errorCode,
1373
+ });
1374
+ }
1375
+ };
1376
+ export const deserializeAws_restJson1UpdateDatasourcePackagesCommand = async (output, context) => {
1377
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1378
+ return deserializeAws_restJson1UpdateDatasourcePackagesCommandError(output, context);
1379
+ }
1380
+ const contents = map({
1381
+ $metadata: deserializeMetadata(output),
1939
1382
  });
1940
- }); };
1941
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1942
- var contents;
1943
- return __generator(this, function (_a) {
1944
- switch (_a.label) {
1945
- case 0:
1946
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1947
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1948
- }
1949
- contents = map({
1950
- $metadata: deserializeMetadata(output),
1951
- });
1952
- return [4, collectBody(output.body, context)];
1953
- case 1:
1954
- _a.sent();
1955
- return [2, contents];
1956
- }
1383
+ await collectBody(output.body, context);
1384
+ return contents;
1385
+ };
1386
+ const deserializeAws_restJson1UpdateDatasourcePackagesCommandError = async (output, context) => {
1387
+ const parsedOutput = {
1388
+ ...output,
1389
+ body: await parseErrorBody(output.body, context),
1390
+ };
1391
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1392
+ switch (errorCode) {
1393
+ case "InternalServerException":
1394
+ case "com.amazonaws.detective#InternalServerException":
1395
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1396
+ case "ResourceNotFoundException":
1397
+ case "com.amazonaws.detective#ResourceNotFoundException":
1398
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1399
+ case "ServiceQuotaExceededException":
1400
+ case "com.amazonaws.detective#ServiceQuotaExceededException":
1401
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1402
+ case "ValidationException":
1403
+ case "com.amazonaws.detective#ValidationException":
1404
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1405
+ default:
1406
+ const parsedBody = parsedOutput.body;
1407
+ throwDefaultError({
1408
+ output,
1409
+ parsedBody,
1410
+ exceptionCtor: __BaseException,
1411
+ errorCode,
1412
+ });
1413
+ }
1414
+ };
1415
+ export const deserializeAws_restJson1UpdateOrganizationConfigurationCommand = async (output, context) => {
1416
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1417
+ return deserializeAws_restJson1UpdateOrganizationConfigurationCommandError(output, context);
1418
+ }
1419
+ const contents = map({
1420
+ $metadata: deserializeMetadata(output),
1957
1421
  });
1958
- }); };
1959
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1960
- var parsedOutput, _a, errorCode, _b, parsedBody;
1961
- var _c;
1962
- return __generator(this, function (_d) {
1963
- switch (_d.label) {
1964
- case 0:
1965
- _a = [__assign({}, output)];
1966
- _c = {};
1967
- return [4, parseErrorBody(output.body, context)];
1968
- case 1:
1969
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1970
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1971
- _b = errorCode;
1972
- switch (_b) {
1973
- case "InternalServerException": return [3, 2];
1974
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
1975
- case "ResourceNotFoundException": return [3, 4];
1976
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
1977
- case "ValidationException": return [3, 6];
1978
- case "com.amazonaws.detective#ValidationException": return [3, 6];
1979
- }
1980
- return [3, 8];
1981
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1982
- case 3: throw _d.sent();
1983
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1984
- case 5: throw _d.sent();
1985
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1986
- case 7: throw _d.sent();
1987
- case 8:
1988
- parsedBody = parsedOutput.body;
1989
- throwDefaultError({
1990
- output: output,
1991
- parsedBody: parsedBody,
1992
- exceptionCtor: __BaseException,
1993
- errorCode: errorCode,
1994
- });
1995
- _d.label = 9;
1996
- case 9: return [2];
1997
- }
1422
+ await collectBody(output.body, context);
1423
+ return contents;
1424
+ };
1425
+ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = async (output, context) => {
1426
+ const parsedOutput = {
1427
+ ...output,
1428
+ body: await parseErrorBody(output.body, context),
1429
+ };
1430
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1431
+ switch (errorCode) {
1432
+ case "InternalServerException":
1433
+ case "com.amazonaws.detective#InternalServerException":
1434
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1435
+ case "TooManyRequestsException":
1436
+ case "com.amazonaws.detective#TooManyRequestsException":
1437
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1438
+ case "ValidationException":
1439
+ case "com.amazonaws.detective#ValidationException":
1440
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1441
+ default:
1442
+ const parsedBody = parsedOutput.body;
1443
+ throwDefaultError({
1444
+ output,
1445
+ parsedBody,
1446
+ exceptionCtor: __BaseException,
1447
+ errorCode,
1448
+ });
1449
+ }
1450
+ };
1451
+ const map = __map;
1452
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1453
+ const contents = map({});
1454
+ const data = parsedOutput.body;
1455
+ if (data.Message != null) {
1456
+ contents.Message = __expectString(data.Message);
1457
+ }
1458
+ const exception = new ConflictException({
1459
+ $metadata: deserializeMetadata(parsedOutput),
1460
+ ...contents,
1998
1461
  });
1999
- }); };
2000
- export var deserializeAws_restJson1UpdateDatasourcePackagesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2001
- var contents;
2002
- return __generator(this, function (_a) {
2003
- switch (_a.label) {
2004
- case 0:
2005
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2006
- return [2, deserializeAws_restJson1UpdateDatasourcePackagesCommandError(output, context)];
2007
- }
2008
- contents = map({
2009
- $metadata: deserializeMetadata(output),
2010
- });
2011
- return [4, collectBody(output.body, context)];
2012
- case 1:
2013
- _a.sent();
2014
- return [2, contents];
2015
- }
1462
+ return __decorateServiceException(exception, parsedOutput.body);
1463
+ };
1464
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1465
+ const contents = map({});
1466
+ const data = parsedOutput.body;
1467
+ if (data.Message != null) {
1468
+ contents.Message = __expectString(data.Message);
1469
+ }
1470
+ const exception = new InternalServerException({
1471
+ $metadata: deserializeMetadata(parsedOutput),
1472
+ ...contents,
2016
1473
  });
2017
- }); };
2018
- var deserializeAws_restJson1UpdateDatasourcePackagesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2019
- var parsedOutput, _a, errorCode, _b, parsedBody;
2020
- var _c;
2021
- return __generator(this, function (_d) {
2022
- switch (_d.label) {
2023
- case 0:
2024
- _a = [__assign({}, output)];
2025
- _c = {};
2026
- return [4, parseErrorBody(output.body, context)];
2027
- case 1:
2028
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2029
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2030
- _b = errorCode;
2031
- switch (_b) {
2032
- case "InternalServerException": return [3, 2];
2033
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
2034
- case "ResourceNotFoundException": return [3, 4];
2035
- case "com.amazonaws.detective#ResourceNotFoundException": return [3, 4];
2036
- case "ServiceQuotaExceededException": return [3, 6];
2037
- case "com.amazonaws.detective#ServiceQuotaExceededException": return [3, 6];
2038
- case "ValidationException": return [3, 8];
2039
- case "com.amazonaws.detective#ValidationException": return [3, 8];
2040
- }
2041
- return [3, 10];
2042
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2043
- case 3: throw _d.sent();
2044
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2045
- case 5: throw _d.sent();
2046
- case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
2047
- case 7: throw _d.sent();
2048
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2049
- case 9: throw _d.sent();
2050
- case 10:
2051
- parsedBody = parsedOutput.body;
2052
- throwDefaultError({
2053
- output: output,
2054
- parsedBody: parsedBody,
2055
- exceptionCtor: __BaseException,
2056
- errorCode: errorCode,
2057
- });
2058
- _d.label = 11;
2059
- case 11: return [2];
2060
- }
1474
+ return __decorateServiceException(exception, parsedOutput.body);
1475
+ };
1476
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1477
+ const contents = map({});
1478
+ const data = parsedOutput.body;
1479
+ if (data.Message != null) {
1480
+ contents.Message = __expectString(data.Message);
1481
+ }
1482
+ const exception = new ResourceNotFoundException({
1483
+ $metadata: deserializeMetadata(parsedOutput),
1484
+ ...contents,
2061
1485
  });
2062
- }); };
2063
- export var deserializeAws_restJson1UpdateOrganizationConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2064
- var contents;
2065
- return __generator(this, function (_a) {
2066
- switch (_a.label) {
2067
- case 0:
2068
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2069
- return [2, deserializeAws_restJson1UpdateOrganizationConfigurationCommandError(output, context)];
2070
- }
2071
- contents = map({
2072
- $metadata: deserializeMetadata(output),
2073
- });
2074
- return [4, collectBody(output.body, context)];
2075
- case 1:
2076
- _a.sent();
2077
- return [2, contents];
2078
- }
1486
+ return __decorateServiceException(exception, parsedOutput.body);
1487
+ };
1488
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1489
+ const contents = map({});
1490
+ const data = parsedOutput.body;
1491
+ if (data.Message != null) {
1492
+ contents.Message = __expectString(data.Message);
1493
+ }
1494
+ if (data.Resources != null) {
1495
+ contents.Resources = deserializeAws_restJson1ResourceList(data.Resources, context);
1496
+ }
1497
+ const exception = new ServiceQuotaExceededException({
1498
+ $metadata: deserializeMetadata(parsedOutput),
1499
+ ...contents,
2079
1500
  });
2080
- }); };
2081
- var deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2082
- var parsedOutput, _a, errorCode, _b, parsedBody;
2083
- var _c;
2084
- return __generator(this, function (_d) {
2085
- switch (_d.label) {
2086
- case 0:
2087
- _a = [__assign({}, output)];
2088
- _c = {};
2089
- return [4, parseErrorBody(output.body, context)];
2090
- case 1:
2091
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2092
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2093
- _b = errorCode;
2094
- switch (_b) {
2095
- case "InternalServerException": return [3, 2];
2096
- case "com.amazonaws.detective#InternalServerException": return [3, 2];
2097
- case "TooManyRequestsException": return [3, 4];
2098
- case "com.amazonaws.detective#TooManyRequestsException": return [3, 4];
2099
- case "ValidationException": return [3, 6];
2100
- case "com.amazonaws.detective#ValidationException": return [3, 6];
2101
- }
2102
- return [3, 8];
2103
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2104
- case 3: throw _d.sent();
2105
- case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
2106
- case 5: throw _d.sent();
2107
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2108
- case 7: throw _d.sent();
2109
- case 8:
2110
- parsedBody = parsedOutput.body;
2111
- throwDefaultError({
2112
- output: output,
2113
- parsedBody: parsedBody,
2114
- exceptionCtor: __BaseException,
2115
- errorCode: errorCode,
2116
- });
2117
- _d.label = 9;
2118
- case 9: return [2];
2119
- }
1501
+ return __decorateServiceException(exception, parsedOutput.body);
1502
+ };
1503
+ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1504
+ const contents = map({});
1505
+ const data = parsedOutput.body;
1506
+ if (data.Message != null) {
1507
+ contents.Message = __expectString(data.Message);
1508
+ }
1509
+ const exception = new TooManyRequestsException({
1510
+ $metadata: deserializeMetadata(parsedOutput),
1511
+ ...contents,
2120
1512
  });
2121
- }); };
2122
- var map = __map;
2123
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2124
- var contents, data, exception;
2125
- return __generator(this, function (_a) {
2126
- contents = map({});
2127
- data = parsedOutput.body;
2128
- if (data.Message != null) {
2129
- contents.Message = __expectString(data.Message);
2130
- }
2131
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2132
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2133
- });
2134
- }); };
2135
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2136
- var contents, data, exception;
2137
- return __generator(this, function (_a) {
2138
- contents = map({});
2139
- data = parsedOutput.body;
2140
- if (data.Message != null) {
2141
- contents.Message = __expectString(data.Message);
2142
- }
2143
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2144
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2145
- });
2146
- }); };
2147
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2148
- var contents, data, exception;
2149
- return __generator(this, function (_a) {
2150
- contents = map({});
2151
- data = parsedOutput.body;
2152
- if (data.Message != null) {
2153
- contents.Message = __expectString(data.Message);
2154
- }
2155
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2156
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2157
- });
2158
- }); };
2159
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2160
- var contents, data, exception;
2161
- return __generator(this, function (_a) {
2162
- contents = map({});
2163
- data = parsedOutput.body;
2164
- if (data.Message != null) {
2165
- contents.Message = __expectString(data.Message);
2166
- }
2167
- if (data.Resources != null) {
2168
- contents.Resources = deserializeAws_restJson1ResourceList(data.Resources, context);
2169
- }
2170
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2171
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2172
- });
2173
- }); };
2174
- var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2175
- var contents, data, exception;
2176
- return __generator(this, function (_a) {
2177
- contents = map({});
2178
- data = parsedOutput.body;
2179
- if (data.Message != null) {
2180
- contents.Message = __expectString(data.Message);
2181
- }
2182
- exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2183
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2184
- });
2185
- }); };
2186
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2187
- var contents, data, exception;
2188
- return __generator(this, function (_a) {
2189
- contents = map({});
2190
- data = parsedOutput.body;
2191
- if (data.ErrorCode != null) {
2192
- contents.ErrorCode = __expectString(data.ErrorCode);
2193
- }
2194
- if (data.ErrorCodeReason != null) {
2195
- contents.ErrorCodeReason = __expectString(data.ErrorCodeReason);
2196
- }
2197
- if (data.Message != null) {
2198
- contents.Message = __expectString(data.Message);
2199
- }
2200
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2201
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1513
+ return __decorateServiceException(exception, parsedOutput.body);
1514
+ };
1515
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1516
+ const contents = map({});
1517
+ const data = parsedOutput.body;
1518
+ if (data.ErrorCode != null) {
1519
+ contents.ErrorCode = __expectString(data.ErrorCode);
1520
+ }
1521
+ if (data.ErrorCodeReason != null) {
1522
+ contents.ErrorCodeReason = __expectString(data.ErrorCodeReason);
1523
+ }
1524
+ if (data.Message != null) {
1525
+ contents.Message = __expectString(data.Message);
1526
+ }
1527
+ const exception = new ValidationException({
1528
+ $metadata: deserializeMetadata(parsedOutput),
1529
+ ...contents,
2202
1530
  });
2203
- }); };
2204
- var serializeAws_restJson1Account = function (input, context) {
2205
- return __assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.EmailAddress != null && { EmailAddress: input.EmailAddress }));
1531
+ return __decorateServiceException(exception, parsedOutput.body);
2206
1532
  };
2207
- var serializeAws_restJson1AccountIdExtendedList = function (input, context) {
1533
+ const serializeAws_restJson1Account = (input, context) => {
1534
+ return {
1535
+ ...(input.AccountId != null && { AccountId: input.AccountId }),
1536
+ ...(input.EmailAddress != null && { EmailAddress: input.EmailAddress }),
1537
+ };
1538
+ };
1539
+ const serializeAws_restJson1AccountIdExtendedList = (input, context) => {
2208
1540
  return input
2209
- .filter(function (e) { return e != null; })
2210
- .map(function (entry) {
1541
+ .filter((e) => e != null)
1542
+ .map((entry) => {
2211
1543
  return entry;
2212
1544
  });
2213
1545
  };
2214
- var serializeAws_restJson1AccountIdList = function (input, context) {
1546
+ const serializeAws_restJson1AccountIdList = (input, context) => {
2215
1547
  return input
2216
- .filter(function (e) { return e != null; })
2217
- .map(function (entry) {
1548
+ .filter((e) => e != null)
1549
+ .map((entry) => {
2218
1550
  return entry;
2219
1551
  });
2220
1552
  };
2221
- var serializeAws_restJson1AccountList = function (input, context) {
1553
+ const serializeAws_restJson1AccountList = (input, context) => {
2222
1554
  return input
2223
- .filter(function (e) { return e != null; })
2224
- .map(function (entry) {
1555
+ .filter((e) => e != null)
1556
+ .map((entry) => {
2225
1557
  return serializeAws_restJson1Account(entry, context);
2226
1558
  });
2227
1559
  };
2228
- var serializeAws_restJson1DatasourcePackageList = function (input, context) {
1560
+ const serializeAws_restJson1DatasourcePackageList = (input, context) => {
2229
1561
  return input
2230
- .filter(function (e) { return e != null; })
2231
- .map(function (entry) {
1562
+ .filter((e) => e != null)
1563
+ .map((entry) => {
2232
1564
  return entry;
2233
1565
  });
2234
1566
  };
2235
- var serializeAws_restJson1GraphArnList = function (input, context) {
1567
+ const serializeAws_restJson1GraphArnList = (input, context) => {
2236
1568
  return input
2237
- .filter(function (e) { return e != null; })
2238
- .map(function (entry) {
1569
+ .filter((e) => e != null)
1570
+ .map((entry) => {
2239
1571
  return entry;
2240
1572
  });
2241
1573
  };
2242
- var serializeAws_restJson1TagMap = function (input, context) {
2243
- return Object.entries(input).reduce(function (acc, _a) {
2244
- var _b;
2245
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1574
+ const serializeAws_restJson1TagMap = (input, context) => {
1575
+ return Object.entries(input).reduce((acc, [key, value]) => {
2246
1576
  if (value === null) {
2247
1577
  return acc;
2248
1578
  }
2249
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1579
+ return {
1580
+ ...acc,
1581
+ [key]: value,
1582
+ };
2250
1583
  }, {});
2251
1584
  };
2252
- var deserializeAws_restJson1AccountIdList = function (output, context) {
2253
- var retVal = (output || [])
2254
- .filter(function (e) { return e != null; })
2255
- .map(function (entry) {
1585
+ const deserializeAws_restJson1AccountIdList = (output, context) => {
1586
+ const retVal = (output || [])
1587
+ .filter((e) => e != null)
1588
+ .map((entry) => {
2256
1589
  if (entry === null) {
2257
1590
  return null;
2258
1591
  }
@@ -2260,17 +1593,17 @@ var deserializeAws_restJson1AccountIdList = function (output, context) {
2260
1593
  });
2261
1594
  return retVal;
2262
1595
  };
2263
- var deserializeAws_restJson1Administrator = function (output, context) {
1596
+ const deserializeAws_restJson1Administrator = (output, context) => {
2264
1597
  return {
2265
1598
  AccountId: __expectString(output.AccountId),
2266
1599
  DelegationTime: output.DelegationTime != null ? __expectNonNull(__parseRfc3339DateTime(output.DelegationTime)) : undefined,
2267
1600
  GraphArn: __expectString(output.GraphArn),
2268
1601
  };
2269
1602
  };
2270
- var deserializeAws_restJson1AdministratorList = function (output, context) {
2271
- var retVal = (output || [])
2272
- .filter(function (e) { return e != null; })
2273
- .map(function (entry) {
1603
+ const deserializeAws_restJson1AdministratorList = (output, context) => {
1604
+ const retVal = (output || [])
1605
+ .filter((e) => e != null)
1606
+ .map((entry) => {
2274
1607
  if (entry === null) {
2275
1608
  return null;
2276
1609
  }
@@ -2278,7 +1611,7 @@ var deserializeAws_restJson1AdministratorList = function (output, context) {
2278
1611
  });
2279
1612
  return retVal;
2280
1613
  };
2281
- var deserializeAws_restJson1DatasourcePackageIngestDetail = function (output, context) {
1614
+ const deserializeAws_restJson1DatasourcePackageIngestDetail = (output, context) => {
2282
1615
  return {
2283
1616
  DatasourcePackageIngestState: __expectString(output.DatasourcePackageIngestState),
2284
1617
  LastIngestStateChange: output.LastIngestStateChange != null
@@ -2286,37 +1619,40 @@ var deserializeAws_restJson1DatasourcePackageIngestDetail = function (output, co
2286
1619
  : undefined,
2287
1620
  };
2288
1621
  };
2289
- var deserializeAws_restJson1DatasourcePackageIngestDetails = function (output, context) {
2290
- return Object.entries(output).reduce(function (acc, _a) {
2291
- var _b;
2292
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1622
+ const deserializeAws_restJson1DatasourcePackageIngestDetails = (output, context) => {
1623
+ return Object.entries(output).reduce((acc, [key, value]) => {
2293
1624
  if (value === null) {
2294
1625
  return acc;
2295
1626
  }
2296
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1DatasourcePackageIngestDetail(value, context), _b));
1627
+ return {
1628
+ ...acc,
1629
+ [key]: deserializeAws_restJson1DatasourcePackageIngestDetail(value, context),
1630
+ };
2297
1631
  }, {});
2298
1632
  };
2299
- var deserializeAws_restJson1DatasourcePackageIngestHistory = function (output, context) {
2300
- return Object.entries(output).reduce(function (acc, _a) {
2301
- var _b;
2302
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1633
+ const deserializeAws_restJson1DatasourcePackageIngestHistory = (output, context) => {
1634
+ return Object.entries(output).reduce((acc, [key, value]) => {
2303
1635
  if (value === null) {
2304
1636
  return acc;
2305
1637
  }
2306
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1LastIngestStateChangeDates(value, context), _b));
1638
+ return {
1639
+ ...acc,
1640
+ [key]: deserializeAws_restJson1LastIngestStateChangeDates(value, context),
1641
+ };
2307
1642
  }, {});
2308
1643
  };
2309
- var deserializeAws_restJson1DatasourcePackageIngestStates = function (output, context) {
2310
- return Object.entries(output).reduce(function (acc, _a) {
2311
- var _b;
2312
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1644
+ const deserializeAws_restJson1DatasourcePackageIngestStates = (output, context) => {
1645
+ return Object.entries(output).reduce((acc, [key, value]) => {
2313
1646
  if (value === null) {
2314
1647
  return acc;
2315
1648
  }
2316
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1649
+ return {
1650
+ ...acc,
1651
+ [key]: __expectString(value),
1652
+ };
2317
1653
  }, {});
2318
1654
  };
2319
- var deserializeAws_restJson1DatasourcePackageUsageInfo = function (output, context) {
1655
+ const deserializeAws_restJson1DatasourcePackageUsageInfo = (output, context) => {
2320
1656
  return {
2321
1657
  VolumeUsageInBytes: __expectLong(output.VolumeUsageInBytes),
2322
1658
  VolumeUsageUpdateTime: output.VolumeUsageUpdateTime != null
@@ -2324,16 +1660,16 @@ var deserializeAws_restJson1DatasourcePackageUsageInfo = function (output, conte
2324
1660
  : undefined,
2325
1661
  };
2326
1662
  };
2327
- var deserializeAws_restJson1Graph = function (output, context) {
1663
+ const deserializeAws_restJson1Graph = (output, context) => {
2328
1664
  return {
2329
1665
  Arn: __expectString(output.Arn),
2330
1666
  CreatedTime: output.CreatedTime != null ? __expectNonNull(__parseRfc3339DateTime(output.CreatedTime)) : undefined,
2331
1667
  };
2332
1668
  };
2333
- var deserializeAws_restJson1GraphList = function (output, context) {
2334
- var retVal = (output || [])
2335
- .filter(function (e) { return e != null; })
2336
- .map(function (entry) {
1669
+ const deserializeAws_restJson1GraphList = (output, context) => {
1670
+ const retVal = (output || [])
1671
+ .filter((e) => e != null)
1672
+ .map((entry) => {
2337
1673
  if (entry === null) {
2338
1674
  return null;
2339
1675
  }
@@ -2341,17 +1677,18 @@ var deserializeAws_restJson1GraphList = function (output, context) {
2341
1677
  });
2342
1678
  return retVal;
2343
1679
  };
2344
- var deserializeAws_restJson1LastIngestStateChangeDates = function (output, context) {
2345
- return Object.entries(output).reduce(function (acc, _a) {
2346
- var _b;
2347
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1680
+ const deserializeAws_restJson1LastIngestStateChangeDates = (output, context) => {
1681
+ return Object.entries(output).reduce((acc, [key, value]) => {
2348
1682
  if (value === null) {
2349
1683
  return acc;
2350
1684
  }
2351
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1TimestampForCollection(value, context), _b));
1685
+ return {
1686
+ ...acc,
1687
+ [key]: deserializeAws_restJson1TimestampForCollection(value, context),
1688
+ };
2352
1689
  }, {});
2353
1690
  };
2354
- var deserializeAws_restJson1MemberDetail = function (output, context) {
1691
+ const deserializeAws_restJson1MemberDetail = (output, context) => {
2355
1692
  return {
2356
1693
  AccountId: __expectString(output.AccountId),
2357
1694
  AdministratorId: __expectString(output.AdministratorId),
@@ -2379,10 +1716,10 @@ var deserializeAws_restJson1MemberDetail = function (output, context) {
2379
1716
  : undefined,
2380
1717
  };
2381
1718
  };
2382
- var deserializeAws_restJson1MemberDetailList = function (output, context) {
2383
- var retVal = (output || [])
2384
- .filter(function (e) { return e != null; })
2385
- .map(function (entry) {
1719
+ const deserializeAws_restJson1MemberDetailList = (output, context) => {
1720
+ const retVal = (output || [])
1721
+ .filter((e) => e != null)
1722
+ .map((entry) => {
2386
1723
  if (entry === null) {
2387
1724
  return null;
2388
1725
  }
@@ -2390,7 +1727,7 @@ var deserializeAws_restJson1MemberDetailList = function (output, context) {
2390
1727
  });
2391
1728
  return retVal;
2392
1729
  };
2393
- var deserializeAws_restJson1MembershipDatasources = function (output, context) {
1730
+ const deserializeAws_restJson1MembershipDatasources = (output, context) => {
2394
1731
  return {
2395
1732
  AccountId: __expectString(output.AccountId),
2396
1733
  DatasourcePackageIngestHistory: output.DatasourcePackageIngestHistory != null
@@ -2399,10 +1736,10 @@ var deserializeAws_restJson1MembershipDatasources = function (output, context) {
2399
1736
  GraphArn: __expectString(output.GraphArn),
2400
1737
  };
2401
1738
  };
2402
- var deserializeAws_restJson1MembershipDatasourcesList = function (output, context) {
2403
- var retVal = (output || [])
2404
- .filter(function (e) { return e != null; })
2405
- .map(function (entry) {
1739
+ const deserializeAws_restJson1MembershipDatasourcesList = (output, context) => {
1740
+ const retVal = (output || [])
1741
+ .filter((e) => e != null)
1742
+ .map((entry) => {
2406
1743
  if (entry === null) {
2407
1744
  return null;
2408
1745
  }
@@ -2410,10 +1747,10 @@ var deserializeAws_restJson1MembershipDatasourcesList = function (output, contex
2410
1747
  });
2411
1748
  return retVal;
2412
1749
  };
2413
- var deserializeAws_restJson1ResourceList = function (output, context) {
2414
- var retVal = (output || [])
2415
- .filter(function (e) { return e != null; })
2416
- .map(function (entry) {
1750
+ const deserializeAws_restJson1ResourceList = (output, context) => {
1751
+ const retVal = (output || [])
1752
+ .filter((e) => e != null)
1753
+ .map((entry) => {
2417
1754
  if (entry === null) {
2418
1755
  return null;
2419
1756
  }
@@ -2421,31 +1758,32 @@ var deserializeAws_restJson1ResourceList = function (output, context) {
2421
1758
  });
2422
1759
  return retVal;
2423
1760
  };
2424
- var deserializeAws_restJson1TagMap = function (output, context) {
2425
- return Object.entries(output).reduce(function (acc, _a) {
2426
- var _b;
2427
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1761
+ const deserializeAws_restJson1TagMap = (output, context) => {
1762
+ return Object.entries(output).reduce((acc, [key, value]) => {
2428
1763
  if (value === null) {
2429
1764
  return acc;
2430
1765
  }
2431
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1766
+ return {
1767
+ ...acc,
1768
+ [key]: __expectString(value),
1769
+ };
2432
1770
  }, {});
2433
1771
  };
2434
- var deserializeAws_restJson1TimestampForCollection = function (output, context) {
1772
+ const deserializeAws_restJson1TimestampForCollection = (output, context) => {
2435
1773
  return {
2436
1774
  Timestamp: output.Timestamp != null ? __expectNonNull(__parseRfc3339DateTime(output.Timestamp)) : undefined,
2437
1775
  };
2438
1776
  };
2439
- var deserializeAws_restJson1UnprocessedAccount = function (output, context) {
1777
+ const deserializeAws_restJson1UnprocessedAccount = (output, context) => {
2440
1778
  return {
2441
1779
  AccountId: __expectString(output.AccountId),
2442
1780
  Reason: __expectString(output.Reason),
2443
1781
  };
2444
1782
  };
2445
- var deserializeAws_restJson1UnprocessedAccountList = function (output, context) {
2446
- var retVal = (output || [])
2447
- .filter(function (e) { return e != null; })
2448
- .map(function (entry) {
1783
+ const deserializeAws_restJson1UnprocessedAccountList = (output, context) => {
1784
+ const retVal = (output || [])
1785
+ .filter((e) => e != null)
1786
+ .map((entry) => {
2449
1787
  if (entry === null) {
2450
1788
  return null;
2451
1789
  }
@@ -2453,16 +1791,16 @@ var deserializeAws_restJson1UnprocessedAccountList = function (output, context)
2453
1791
  });
2454
1792
  return retVal;
2455
1793
  };
2456
- var deserializeAws_restJson1UnprocessedGraph = function (output, context) {
1794
+ const deserializeAws_restJson1UnprocessedGraph = (output, context) => {
2457
1795
  return {
2458
1796
  GraphArn: __expectString(output.GraphArn),
2459
1797
  Reason: __expectString(output.Reason),
2460
1798
  };
2461
1799
  };
2462
- var deserializeAws_restJson1UnprocessedGraphList = function (output, context) {
2463
- var retVal = (output || [])
2464
- .filter(function (e) { return e != null; })
2465
- .map(function (entry) {
1800
+ const deserializeAws_restJson1UnprocessedGraphList = (output, context) => {
1801
+ const retVal = (output || [])
1802
+ .filter((e) => e != null)
1803
+ .map((entry) => {
2466
1804
  if (entry === null) {
2467
1805
  return null;
2468
1806
  }
@@ -2470,67 +1808,50 @@ var deserializeAws_restJson1UnprocessedGraphList = function (output, context) {
2470
1808
  });
2471
1809
  return retVal;
2472
1810
  };
2473
- var deserializeAws_restJson1VolumeUsageByDatasourcePackage = function (output, context) {
2474
- return Object.entries(output).reduce(function (acc, _a) {
2475
- var _b;
2476
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1811
+ const deserializeAws_restJson1VolumeUsageByDatasourcePackage = (output, context) => {
1812
+ return Object.entries(output).reduce((acc, [key, value]) => {
2477
1813
  if (value === null) {
2478
1814
  return acc;
2479
1815
  }
2480
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1DatasourcePackageUsageInfo(value, context), _b));
1816
+ return {
1817
+ ...acc,
1818
+ [key]: deserializeAws_restJson1DatasourcePackageUsageInfo(value, context),
1819
+ };
2481
1820
  }, {});
2482
1821
  };
2483
- var deserializeMetadata = function (output) {
2484
- var _a;
2485
- return ({
2486
- httpStatusCode: output.statusCode,
2487
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2488
- extendedRequestId: output.headers["x-amz-id-2"],
2489
- cfId: output.headers["x-amz-cf-id"],
2490
- });
2491
- };
2492
- var collectBody = function (streamBody, context) {
2493
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1822
+ const deserializeMetadata = (output) => ({
1823
+ httpStatusCode: output.statusCode,
1824
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1825
+ extendedRequestId: output.headers["x-amz-id-2"],
1826
+ cfId: output.headers["x-amz-cf-id"],
1827
+ });
1828
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2494
1829
  if (streamBody instanceof Uint8Array) {
2495
1830
  return Promise.resolve(streamBody);
2496
1831
  }
2497
1832
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2498
1833
  };
2499
- var collectBodyString = function (streamBody, context) {
2500
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2501
- };
2502
- var isSerializableHeaderValue = function (value) {
2503
- return value !== undefined &&
2504
- value !== null &&
2505
- value !== "" &&
2506
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2507
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1834
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1835
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1836
+ value !== null &&
1837
+ value !== "" &&
1838
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1839
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1840
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1841
+ if (encoded.length) {
1842
+ return JSON.parse(encoded);
1843
+ }
1844
+ return {};
1845
+ });
1846
+ const parseErrorBody = async (errorBody, context) => {
1847
+ const value = await parseBody(errorBody, context);
1848
+ value.message = value.message ?? value.Message;
1849
+ return value;
2508
1850
  };
2509
- var parseBody = function (streamBody, context) {
2510
- return collectBodyString(streamBody, context).then(function (encoded) {
2511
- if (encoded.length) {
2512
- return JSON.parse(encoded);
2513
- }
2514
- return {};
2515
- });
2516
- };
2517
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2518
- var value;
2519
- var _a;
2520
- return __generator(this, function (_b) {
2521
- switch (_b.label) {
2522
- case 0: return [4, parseBody(errorBody, context)];
2523
- case 1:
2524
- value = _b.sent();
2525
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2526
- return [2, value];
2527
- }
2528
- });
2529
- }); };
2530
- var loadRestJsonErrorCode = function (output, data) {
2531
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2532
- var sanitizeErrorCode = function (rawValue) {
2533
- var cleanValue = rawValue;
1851
+ const loadRestJsonErrorCode = (output, data) => {
1852
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1853
+ const sanitizeErrorCode = (rawValue) => {
1854
+ let cleanValue = rawValue;
2534
1855
  if (typeof cleanValue === "number") {
2535
1856
  cleanValue = cleanValue.toString();
2536
1857
  }
@@ -2545,7 +1866,7 @@ var loadRestJsonErrorCode = function (output, data) {
2545
1866
  }
2546
1867
  return cleanValue;
2547
1868
  };
2548
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1869
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2549
1870
  if (headerKey !== undefined) {
2550
1871
  return sanitizeErrorCode(output.headers[headerKey]);
2551
1872
  }