@aws-sdk/client-migration-hub 3.186.0 → 3.190.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 (34) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/MigrationHub.js +70 -77
  3. package/dist-es/MigrationHubClient.js +22 -28
  4. package/dist-es/commands/AssociateCreatedArtifactCommand.js +21 -28
  5. package/dist-es/commands/AssociateDiscoveredResourceCommand.js +21 -28
  6. package/dist-es/commands/CreateProgressUpdateStreamCommand.js +21 -28
  7. package/dist-es/commands/DeleteProgressUpdateStreamCommand.js +21 -28
  8. package/dist-es/commands/DescribeApplicationStateCommand.js +21 -28
  9. package/dist-es/commands/DescribeMigrationTaskCommand.js +21 -28
  10. package/dist-es/commands/DisassociateCreatedArtifactCommand.js +21 -28
  11. package/dist-es/commands/DisassociateDiscoveredResourceCommand.js +21 -28
  12. package/dist-es/commands/ImportMigrationTaskCommand.js +21 -28
  13. package/dist-es/commands/ListApplicationStatesCommand.js +21 -28
  14. package/dist-es/commands/ListCreatedArtifactsCommand.js +21 -28
  15. package/dist-es/commands/ListDiscoveredResourcesCommand.js +21 -28
  16. package/dist-es/commands/ListMigrationTasksCommand.js +21 -28
  17. package/dist-es/commands/ListProgressUpdateStreamsCommand.js +21 -28
  18. package/dist-es/commands/NotifyApplicationStateCommand.js +21 -28
  19. package/dist-es/commands/NotifyMigrationTaskStateCommand.js +21 -28
  20. package/dist-es/commands/PutResourceAttributesCommand.js +21 -28
  21. package/dist-es/endpoints.js +8 -8
  22. package/dist-es/models/MigrationHubServiceException.js +5 -10
  23. package/dist-es/models/models_0.js +247 -164
  24. package/dist-es/pagination/ListApplicationStatesPaginator.js +25 -68
  25. package/dist-es/pagination/ListCreatedArtifactsPaginator.js +25 -68
  26. package/dist-es/pagination/ListDiscoveredResourcesPaginator.js +25 -68
  27. package/dist-es/pagination/ListMigrationTasksPaginator.js +25 -68
  28. package/dist-es/pagination/ListProgressUpdateStreamsPaginator.js +25 -68
  29. package/dist-es/protocols/Aws_json1_1.js +1415 -1816
  30. package/dist-es/runtimeConfig.browser.js +26 -12
  31. package/dist-es/runtimeConfig.js +30 -12
  32. package/dist-es/runtimeConfig.native.js +8 -5
  33. package/dist-es/runtimeConfig.shared.js +8 -11
  34. package/package.json +33 -33
@@ -1,1735 +1,1357 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { MigrationHubServiceException as __BaseException } from "../models/MigrationHubServiceException";
5
4
  import { AccessDeniedException, DryRunOperation, HomeRegionNotSetException, InternalServerError, InvalidInputException, PolicyErrorException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, UnauthorizedOperation, } from "../models/models_0";
6
- export var serializeAws_json1_1AssociateCreatedArtifactCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSMigrationHub.AssociateCreatedArtifact",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1AssociateCreatedArtifactRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1AssociateDiscoveredResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "AWSMigrationHub.AssociateDiscoveredResource",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1AssociateDiscoveredResourceRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1CreateProgressUpdateStreamCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "AWSMigrationHub.CreateProgressUpdateStream",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1CreateProgressUpdateStreamRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1DeleteProgressUpdateStreamCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "AWSMigrationHub.DeleteProgressUpdateStream",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1DeleteProgressUpdateStreamRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1DescribeApplicationStateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.1",
55
- "x-amz-target": "AWSMigrationHub.DescribeApplicationState",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1DescribeApplicationStateRequest(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1DescribeMigrationTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.1",
66
- "x-amz-target": "AWSMigrationHub.DescribeMigrationTask",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1DescribeMigrationTaskRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_1DisassociateCreatedArtifactCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var headers, body;
74
- return __generator(this, function (_a) {
75
- headers = {
76
- "content-type": "application/x-amz-json-1.1",
77
- "x-amz-target": "AWSMigrationHub.DisassociateCreatedArtifact",
78
- };
79
- body = JSON.stringify(serializeAws_json1_1DisassociateCreatedArtifactRequest(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_1DisassociateDiscoveredResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
- var headers, body;
85
- return __generator(this, function (_a) {
86
- headers = {
87
- "content-type": "application/x-amz-json-1.1",
88
- "x-amz-target": "AWSMigrationHub.DisassociateDiscoveredResource",
89
- };
90
- body = JSON.stringify(serializeAws_json1_1DisassociateDiscoveredResourceRequest(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var serializeAws_json1_1ImportMigrationTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var headers, body;
96
- return __generator(this, function (_a) {
97
- headers = {
98
- "content-type": "application/x-amz-json-1.1",
99
- "x-amz-target": "AWSMigrationHub.ImportMigrationTask",
100
- };
101
- body = JSON.stringify(serializeAws_json1_1ImportMigrationTaskRequest(input, context));
102
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
- });
104
- }); };
105
- export var serializeAws_json1_1ListApplicationStatesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
- var headers, body;
107
- return __generator(this, function (_a) {
108
- headers = {
109
- "content-type": "application/x-amz-json-1.1",
110
- "x-amz-target": "AWSMigrationHub.ListApplicationStates",
111
- };
112
- body = JSON.stringify(serializeAws_json1_1ListApplicationStatesRequest(input, context));
113
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
- });
115
- }); };
116
- export var serializeAws_json1_1ListCreatedArtifactsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var headers, body;
118
- return __generator(this, function (_a) {
119
- headers = {
120
- "content-type": "application/x-amz-json-1.1",
121
- "x-amz-target": "AWSMigrationHub.ListCreatedArtifacts",
122
- };
123
- body = JSON.stringify(serializeAws_json1_1ListCreatedArtifactsRequest(input, context));
124
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
125
- });
126
- }); };
127
- export var serializeAws_json1_1ListDiscoveredResourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
- var headers, body;
129
- return __generator(this, function (_a) {
130
- headers = {
131
- "content-type": "application/x-amz-json-1.1",
132
- "x-amz-target": "AWSMigrationHub.ListDiscoveredResources",
133
- };
134
- body = JSON.stringify(serializeAws_json1_1ListDiscoveredResourcesRequest(input, context));
135
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
136
- });
137
- }); };
138
- export var serializeAws_json1_1ListMigrationTasksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var headers, body;
140
- return __generator(this, function (_a) {
141
- headers = {
142
- "content-type": "application/x-amz-json-1.1",
143
- "x-amz-target": "AWSMigrationHub.ListMigrationTasks",
144
- };
145
- body = JSON.stringify(serializeAws_json1_1ListMigrationTasksRequest(input, context));
146
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
147
- });
148
- }); };
149
- export var serializeAws_json1_1ListProgressUpdateStreamsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var headers, body;
151
- return __generator(this, function (_a) {
152
- headers = {
153
- "content-type": "application/x-amz-json-1.1",
154
- "x-amz-target": "AWSMigrationHub.ListProgressUpdateStreams",
155
- };
156
- body = JSON.stringify(serializeAws_json1_1ListProgressUpdateStreamsRequest(input, context));
157
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
158
- });
159
- }); };
160
- export var serializeAws_json1_1NotifyApplicationStateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
161
- var headers, body;
162
- return __generator(this, function (_a) {
163
- headers = {
164
- "content-type": "application/x-amz-json-1.1",
165
- "x-amz-target": "AWSMigrationHub.NotifyApplicationState",
166
- };
167
- body = JSON.stringify(serializeAws_json1_1NotifyApplicationStateRequest(input, context));
168
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
169
- });
170
- }); };
171
- export var serializeAws_json1_1NotifyMigrationTaskStateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
172
- var headers, body;
173
- return __generator(this, function (_a) {
174
- headers = {
175
- "content-type": "application/x-amz-json-1.1",
176
- "x-amz-target": "AWSMigrationHub.NotifyMigrationTaskState",
177
- };
178
- body = JSON.stringify(serializeAws_json1_1NotifyMigrationTaskStateRequest(input, context));
179
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
180
- });
181
- }); };
182
- export var serializeAws_json1_1PutResourceAttributesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
183
- var headers, body;
184
- return __generator(this, function (_a) {
185
- headers = {
186
- "content-type": "application/x-amz-json-1.1",
187
- "x-amz-target": "AWSMigrationHub.PutResourceAttributes",
188
- };
189
- body = JSON.stringify(serializeAws_json1_1PutResourceAttributesRequest(input, context));
190
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
191
- });
192
- }); };
193
- export var deserializeAws_json1_1AssociateCreatedArtifactCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
194
- var data, contents, response;
195
- return __generator(this, function (_a) {
196
- switch (_a.label) {
197
- case 0:
198
- if (output.statusCode >= 300) {
199
- return [2, deserializeAws_json1_1AssociateCreatedArtifactCommandError(output, context)];
200
- }
201
- return [4, parseBody(output.body, context)];
202
- case 1:
203
- data = _a.sent();
204
- contents = {};
205
- contents = deserializeAws_json1_1AssociateCreatedArtifactResult(data, context);
206
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
207
- return [2, Promise.resolve(response)];
208
- }
209
- });
210
- }); };
211
- var deserializeAws_json1_1AssociateCreatedArtifactCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
212
- var parsedOutput, _a, errorCode, _b, parsedBody;
213
- var _c;
214
- return __generator(this, function (_d) {
215
- switch (_d.label) {
216
- case 0:
217
- _a = [__assign({}, output)];
218
- _c = {};
219
- return [4, parseErrorBody(output.body, context)];
220
- case 1:
221
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
222
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
223
- _b = errorCode;
224
- switch (_b) {
225
- case "AccessDeniedException": return [3, 2];
226
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
227
- case "DryRunOperation": return [3, 4];
228
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
229
- case "HomeRegionNotSetException": return [3, 6];
230
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
231
- case "InternalServerError": return [3, 8];
232
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
233
- case "InvalidInputException": return [3, 10];
234
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
235
- case "ResourceNotFoundException": return [3, 12];
236
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
237
- case "ServiceUnavailableException": return [3, 14];
238
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
239
- case "ThrottlingException": return [3, 16];
240
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
241
- case "UnauthorizedOperation": return [3, 18];
242
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
243
- }
244
- return [3, 20];
245
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
246
- case 3: throw _d.sent();
247
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
248
- case 5: throw _d.sent();
249
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
250
- case 7: throw _d.sent();
251
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
252
- case 9: throw _d.sent();
253
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
254
- case 11: throw _d.sent();
255
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
256
- case 13: throw _d.sent();
257
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
258
- case 15: throw _d.sent();
259
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
260
- case 17: throw _d.sent();
261
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
262
- case 19: throw _d.sent();
263
- case 20:
264
- parsedBody = parsedOutput.body;
265
- throwDefaultError({
266
- output: output,
267
- parsedBody: parsedBody,
268
- exceptionCtor: __BaseException,
269
- errorCode: errorCode,
270
- });
271
- _d.label = 21;
272
- case 21: return [2];
273
- }
274
- });
275
- }); };
276
- export var deserializeAws_json1_1AssociateDiscoveredResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
277
- var data, contents, response;
278
- return __generator(this, function (_a) {
279
- switch (_a.label) {
280
- case 0:
281
- if (output.statusCode >= 300) {
282
- return [2, deserializeAws_json1_1AssociateDiscoveredResourceCommandError(output, context)];
283
- }
284
- return [4, parseBody(output.body, context)];
285
- case 1:
286
- data = _a.sent();
287
- contents = {};
288
- contents = deserializeAws_json1_1AssociateDiscoveredResourceResult(data, context);
289
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
290
- return [2, Promise.resolve(response)];
291
- }
292
- });
293
- }); };
294
- var deserializeAws_json1_1AssociateDiscoveredResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
295
- var parsedOutput, _a, errorCode, _b, parsedBody;
296
- var _c;
297
- return __generator(this, function (_d) {
298
- switch (_d.label) {
299
- case 0:
300
- _a = [__assign({}, output)];
301
- _c = {};
302
- return [4, parseErrorBody(output.body, context)];
303
- case 1:
304
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
305
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
306
- _b = errorCode;
307
- switch (_b) {
308
- case "AccessDeniedException": return [3, 2];
309
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
310
- case "DryRunOperation": return [3, 4];
311
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
312
- case "HomeRegionNotSetException": return [3, 6];
313
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
314
- case "InternalServerError": return [3, 8];
315
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
316
- case "InvalidInputException": return [3, 10];
317
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
318
- case "PolicyErrorException": return [3, 12];
319
- case "com.amazonaws.migrationhub#PolicyErrorException": return [3, 12];
320
- case "ResourceNotFoundException": return [3, 14];
321
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 14];
322
- case "ServiceUnavailableException": return [3, 16];
323
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 16];
324
- case "ThrottlingException": return [3, 18];
325
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 18];
326
- case "UnauthorizedOperation": return [3, 20];
327
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 20];
328
- }
329
- return [3, 22];
330
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
331
- case 3: throw _d.sent();
332
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
333
- case 5: throw _d.sent();
334
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
335
- case 7: throw _d.sent();
336
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
337
- case 9: throw _d.sent();
338
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
339
- case 11: throw _d.sent();
340
- case 12: return [4, deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context)];
341
- case 13: throw _d.sent();
342
- case 14: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
343
- case 15: throw _d.sent();
344
- case 16: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
345
- case 17: throw _d.sent();
346
- case 18: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
347
- case 19: throw _d.sent();
348
- case 20: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
349
- case 21: throw _d.sent();
350
- case 22:
351
- parsedBody = parsedOutput.body;
352
- throwDefaultError({
353
- output: output,
354
- parsedBody: parsedBody,
355
- exceptionCtor: __BaseException,
356
- errorCode: errorCode,
357
- });
358
- _d.label = 23;
359
- case 23: return [2];
360
- }
361
- });
362
- }); };
363
- export var deserializeAws_json1_1CreateProgressUpdateStreamCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
364
- var data, contents, response;
365
- return __generator(this, function (_a) {
366
- switch (_a.label) {
367
- case 0:
368
- if (output.statusCode >= 300) {
369
- return [2, deserializeAws_json1_1CreateProgressUpdateStreamCommandError(output, context)];
370
- }
371
- return [4, parseBody(output.body, context)];
372
- case 1:
373
- data = _a.sent();
374
- contents = {};
375
- contents = deserializeAws_json1_1CreateProgressUpdateStreamResult(data, context);
376
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
377
- return [2, Promise.resolve(response)];
378
- }
379
- });
380
- }); };
381
- var deserializeAws_json1_1CreateProgressUpdateStreamCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
382
- var parsedOutput, _a, errorCode, _b, parsedBody;
383
- var _c;
384
- return __generator(this, function (_d) {
385
- switch (_d.label) {
386
- case 0:
387
- _a = [__assign({}, output)];
388
- _c = {};
389
- return [4, parseErrorBody(output.body, context)];
390
- case 1:
391
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
392
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
393
- _b = errorCode;
394
- switch (_b) {
395
- case "AccessDeniedException": return [3, 2];
396
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
397
- case "DryRunOperation": return [3, 4];
398
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
399
- case "HomeRegionNotSetException": return [3, 6];
400
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
401
- case "InternalServerError": return [3, 8];
402
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
403
- case "InvalidInputException": return [3, 10];
404
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
405
- case "ServiceUnavailableException": return [3, 12];
406
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 12];
407
- case "ThrottlingException": return [3, 14];
408
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 14];
409
- case "UnauthorizedOperation": return [3, 16];
410
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 16];
411
- }
412
- return [3, 18];
413
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
414
- case 3: throw _d.sent();
415
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
416
- case 5: throw _d.sent();
417
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
418
- case 7: throw _d.sent();
419
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
420
- case 9: throw _d.sent();
421
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
422
- case 11: throw _d.sent();
423
- case 12: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
424
- case 13: throw _d.sent();
425
- case 14: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
426
- case 15: throw _d.sent();
427
- case 16: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
428
- case 17: throw _d.sent();
429
- case 18:
430
- parsedBody = parsedOutput.body;
431
- throwDefaultError({
432
- output: output,
433
- parsedBody: parsedBody,
434
- exceptionCtor: __BaseException,
435
- errorCode: errorCode,
436
- });
437
- _d.label = 19;
438
- case 19: return [2];
439
- }
440
- });
441
- }); };
442
- export var deserializeAws_json1_1DeleteProgressUpdateStreamCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
443
- var data, contents, response;
444
- return __generator(this, function (_a) {
445
- switch (_a.label) {
446
- case 0:
447
- if (output.statusCode >= 300) {
448
- return [2, deserializeAws_json1_1DeleteProgressUpdateStreamCommandError(output, context)];
449
- }
450
- return [4, parseBody(output.body, context)];
451
- case 1:
452
- data = _a.sent();
453
- contents = {};
454
- contents = deserializeAws_json1_1DeleteProgressUpdateStreamResult(data, context);
455
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
456
- return [2, Promise.resolve(response)];
457
- }
458
- });
459
- }); };
460
- var deserializeAws_json1_1DeleteProgressUpdateStreamCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
461
- var parsedOutput, _a, errorCode, _b, parsedBody;
462
- var _c;
463
- return __generator(this, function (_d) {
464
- switch (_d.label) {
465
- case 0:
466
- _a = [__assign({}, output)];
467
- _c = {};
468
- return [4, parseErrorBody(output.body, context)];
469
- case 1:
470
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
471
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
472
- _b = errorCode;
473
- switch (_b) {
474
- case "AccessDeniedException": return [3, 2];
475
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
476
- case "DryRunOperation": return [3, 4];
477
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
478
- case "HomeRegionNotSetException": return [3, 6];
479
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
480
- case "InternalServerError": return [3, 8];
481
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
482
- case "InvalidInputException": return [3, 10];
483
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
484
- case "ResourceNotFoundException": return [3, 12];
485
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
486
- case "ServiceUnavailableException": return [3, 14];
487
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
488
- case "ThrottlingException": return [3, 16];
489
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
490
- case "UnauthorizedOperation": return [3, 18];
491
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
492
- }
493
- return [3, 20];
494
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
495
- case 3: throw _d.sent();
496
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
497
- case 5: throw _d.sent();
498
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
499
- case 7: throw _d.sent();
500
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
501
- case 9: throw _d.sent();
502
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
503
- case 11: throw _d.sent();
504
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
505
- case 13: throw _d.sent();
506
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
507
- case 15: throw _d.sent();
508
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
509
- case 17: throw _d.sent();
510
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
511
- case 19: throw _d.sent();
512
- case 20:
513
- parsedBody = parsedOutput.body;
514
- throwDefaultError({
515
- output: output,
516
- parsedBody: parsedBody,
517
- exceptionCtor: __BaseException,
518
- errorCode: errorCode,
519
- });
520
- _d.label = 21;
521
- case 21: return [2];
522
- }
523
- });
524
- }); };
525
- export var deserializeAws_json1_1DescribeApplicationStateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
526
- var data, contents, response;
527
- return __generator(this, function (_a) {
528
- switch (_a.label) {
529
- case 0:
530
- if (output.statusCode >= 300) {
531
- return [2, deserializeAws_json1_1DescribeApplicationStateCommandError(output, context)];
532
- }
533
- return [4, parseBody(output.body, context)];
534
- case 1:
535
- data = _a.sent();
536
- contents = {};
537
- contents = deserializeAws_json1_1DescribeApplicationStateResult(data, context);
538
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
539
- return [2, Promise.resolve(response)];
540
- }
541
- });
542
- }); };
543
- var deserializeAws_json1_1DescribeApplicationStateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
544
- var parsedOutput, _a, errorCode, _b, parsedBody;
545
- var _c;
546
- return __generator(this, function (_d) {
547
- switch (_d.label) {
548
- case 0:
549
- _a = [__assign({}, output)];
550
- _c = {};
551
- return [4, parseErrorBody(output.body, context)];
552
- case 1:
553
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
554
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
555
- _b = errorCode;
556
- switch (_b) {
557
- case "AccessDeniedException": return [3, 2];
558
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
559
- case "HomeRegionNotSetException": return [3, 4];
560
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
561
- case "InternalServerError": return [3, 6];
562
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
563
- case "InvalidInputException": return [3, 8];
564
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
565
- case "PolicyErrorException": return [3, 10];
566
- case "com.amazonaws.migrationhub#PolicyErrorException": return [3, 10];
567
- case "ResourceNotFoundException": return [3, 12];
568
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
569
- case "ServiceUnavailableException": return [3, 14];
570
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
571
- case "ThrottlingException": return [3, 16];
572
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
573
- }
574
- return [3, 18];
575
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
576
- case 3: throw _d.sent();
577
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
578
- case 5: throw _d.sent();
579
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
580
- case 7: throw _d.sent();
581
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
582
- case 9: throw _d.sent();
583
- case 10: return [4, deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context)];
584
- case 11: throw _d.sent();
585
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
586
- case 13: throw _d.sent();
587
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
588
- case 15: throw _d.sent();
589
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
590
- case 17: throw _d.sent();
591
- case 18:
592
- parsedBody = parsedOutput.body;
593
- throwDefaultError({
594
- output: output,
595
- parsedBody: parsedBody,
596
- exceptionCtor: __BaseException,
597
- errorCode: errorCode,
598
- });
599
- _d.label = 19;
600
- case 19: return [2];
601
- }
602
- });
603
- }); };
604
- export var deserializeAws_json1_1DescribeMigrationTaskCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
605
- var data, contents, response;
606
- return __generator(this, function (_a) {
607
- switch (_a.label) {
608
- case 0:
609
- if (output.statusCode >= 300) {
610
- return [2, deserializeAws_json1_1DescribeMigrationTaskCommandError(output, context)];
611
- }
612
- return [4, parseBody(output.body, context)];
613
- case 1:
614
- data = _a.sent();
615
- contents = {};
616
- contents = deserializeAws_json1_1DescribeMigrationTaskResult(data, context);
617
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
618
- return [2, Promise.resolve(response)];
619
- }
620
- });
621
- }); };
622
- var deserializeAws_json1_1DescribeMigrationTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
623
- var parsedOutput, _a, errorCode, _b, parsedBody;
624
- var _c;
625
- return __generator(this, function (_d) {
626
- switch (_d.label) {
627
- case 0:
628
- _a = [__assign({}, output)];
629
- _c = {};
630
- return [4, parseErrorBody(output.body, context)];
631
- case 1:
632
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
633
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
634
- _b = errorCode;
635
- switch (_b) {
636
- case "AccessDeniedException": return [3, 2];
637
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
638
- case "HomeRegionNotSetException": return [3, 4];
639
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
640
- case "InternalServerError": return [3, 6];
641
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
642
- case "InvalidInputException": return [3, 8];
643
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
644
- case "ResourceNotFoundException": return [3, 10];
645
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 10];
646
- case "ServiceUnavailableException": return [3, 12];
647
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 12];
648
- case "ThrottlingException": return [3, 14];
649
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 14];
650
- }
651
- return [3, 16];
652
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
653
- case 3: throw _d.sent();
654
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
655
- case 5: throw _d.sent();
656
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
657
- case 7: throw _d.sent();
658
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
659
- case 9: throw _d.sent();
660
- case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
661
- case 11: throw _d.sent();
662
- case 12: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
663
- case 13: throw _d.sent();
664
- case 14: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
665
- case 15: throw _d.sent();
666
- case 16:
667
- parsedBody = parsedOutput.body;
668
- throwDefaultError({
669
- output: output,
670
- parsedBody: parsedBody,
671
- exceptionCtor: __BaseException,
672
- errorCode: errorCode,
673
- });
674
- _d.label = 17;
675
- case 17: return [2];
676
- }
677
- });
678
- }); };
679
- export var deserializeAws_json1_1DisassociateCreatedArtifactCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
680
- var data, contents, response;
681
- return __generator(this, function (_a) {
682
- switch (_a.label) {
683
- case 0:
684
- if (output.statusCode >= 300) {
685
- return [2, deserializeAws_json1_1DisassociateCreatedArtifactCommandError(output, context)];
686
- }
687
- return [4, parseBody(output.body, context)];
688
- case 1:
689
- data = _a.sent();
690
- contents = {};
691
- contents = deserializeAws_json1_1DisassociateCreatedArtifactResult(data, context);
692
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
693
- return [2, Promise.resolve(response)];
694
- }
695
- });
696
- }); };
697
- var deserializeAws_json1_1DisassociateCreatedArtifactCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
698
- var parsedOutput, _a, errorCode, _b, parsedBody;
699
- var _c;
700
- return __generator(this, function (_d) {
701
- switch (_d.label) {
702
- case 0:
703
- _a = [__assign({}, output)];
704
- _c = {};
705
- return [4, parseErrorBody(output.body, context)];
706
- case 1:
707
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
708
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
709
- _b = errorCode;
710
- switch (_b) {
711
- case "AccessDeniedException": return [3, 2];
712
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
713
- case "DryRunOperation": return [3, 4];
714
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
715
- case "HomeRegionNotSetException": return [3, 6];
716
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
717
- case "InternalServerError": return [3, 8];
718
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
719
- case "InvalidInputException": return [3, 10];
720
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
721
- case "ResourceNotFoundException": return [3, 12];
722
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
723
- case "ServiceUnavailableException": return [3, 14];
724
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
725
- case "ThrottlingException": return [3, 16];
726
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
727
- case "UnauthorizedOperation": return [3, 18];
728
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
729
- }
730
- return [3, 20];
731
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
732
- case 3: throw _d.sent();
733
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
734
- case 5: throw _d.sent();
735
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
736
- case 7: throw _d.sent();
737
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
738
- case 9: throw _d.sent();
739
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
740
- case 11: throw _d.sent();
741
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
742
- case 13: throw _d.sent();
743
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
744
- case 15: throw _d.sent();
745
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
746
- case 17: throw _d.sent();
747
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
748
- case 19: throw _d.sent();
749
- case 20:
750
- parsedBody = parsedOutput.body;
751
- throwDefaultError({
752
- output: output,
753
- parsedBody: parsedBody,
754
- exceptionCtor: __BaseException,
755
- errorCode: errorCode,
756
- });
757
- _d.label = 21;
758
- case 21: return [2];
759
- }
760
- });
761
- }); };
762
- export var deserializeAws_json1_1DisassociateDiscoveredResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
763
- var data, contents, response;
764
- return __generator(this, function (_a) {
765
- switch (_a.label) {
766
- case 0:
767
- if (output.statusCode >= 300) {
768
- return [2, deserializeAws_json1_1DisassociateDiscoveredResourceCommandError(output, context)];
769
- }
770
- return [4, parseBody(output.body, context)];
771
- case 1:
772
- data = _a.sent();
773
- contents = {};
774
- contents = deserializeAws_json1_1DisassociateDiscoveredResourceResult(data, context);
775
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
776
- return [2, Promise.resolve(response)];
777
- }
778
- });
779
- }); };
780
- var deserializeAws_json1_1DisassociateDiscoveredResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
781
- var parsedOutput, _a, errorCode, _b, parsedBody;
782
- var _c;
783
- return __generator(this, function (_d) {
784
- switch (_d.label) {
785
- case 0:
786
- _a = [__assign({}, output)];
787
- _c = {};
788
- return [4, parseErrorBody(output.body, context)];
789
- case 1:
790
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
791
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
- _b = errorCode;
793
- switch (_b) {
794
- case "AccessDeniedException": return [3, 2];
795
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
796
- case "DryRunOperation": return [3, 4];
797
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
798
- case "HomeRegionNotSetException": return [3, 6];
799
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
800
- case "InternalServerError": return [3, 8];
801
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
802
- case "InvalidInputException": return [3, 10];
803
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
804
- case "ResourceNotFoundException": return [3, 12];
805
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
806
- case "ServiceUnavailableException": return [3, 14];
807
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
808
- case "ThrottlingException": return [3, 16];
809
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
810
- case "UnauthorizedOperation": return [3, 18];
811
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
812
- }
813
- return [3, 20];
814
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
815
- case 3: throw _d.sent();
816
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
817
- case 5: throw _d.sent();
818
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
819
- case 7: throw _d.sent();
820
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
821
- case 9: throw _d.sent();
822
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
823
- case 11: throw _d.sent();
824
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
825
- case 13: throw _d.sent();
826
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
827
- case 15: throw _d.sent();
828
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
829
- case 17: throw _d.sent();
830
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
831
- case 19: throw _d.sent();
832
- case 20:
833
- parsedBody = parsedOutput.body;
834
- throwDefaultError({
835
- output: output,
836
- parsedBody: parsedBody,
837
- exceptionCtor: __BaseException,
838
- errorCode: errorCode,
839
- });
840
- _d.label = 21;
841
- case 21: return [2];
842
- }
843
- });
844
- }); };
845
- export var deserializeAws_json1_1ImportMigrationTaskCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
846
- var data, contents, response;
847
- return __generator(this, function (_a) {
848
- switch (_a.label) {
849
- case 0:
850
- if (output.statusCode >= 300) {
851
- return [2, deserializeAws_json1_1ImportMigrationTaskCommandError(output, context)];
852
- }
853
- return [4, parseBody(output.body, context)];
854
- case 1:
855
- data = _a.sent();
856
- contents = {};
857
- contents = deserializeAws_json1_1ImportMigrationTaskResult(data, context);
858
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
859
- return [2, Promise.resolve(response)];
860
- }
861
- });
862
- }); };
863
- var deserializeAws_json1_1ImportMigrationTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
864
- var parsedOutput, _a, errorCode, _b, parsedBody;
865
- var _c;
866
- return __generator(this, function (_d) {
867
- switch (_d.label) {
868
- case 0:
869
- _a = [__assign({}, output)];
870
- _c = {};
871
- return [4, parseErrorBody(output.body, context)];
872
- case 1:
873
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
874
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
875
- _b = errorCode;
876
- switch (_b) {
877
- case "AccessDeniedException": return [3, 2];
878
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
879
- case "DryRunOperation": return [3, 4];
880
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
881
- case "HomeRegionNotSetException": return [3, 6];
882
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
883
- case "InternalServerError": return [3, 8];
884
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
885
- case "InvalidInputException": return [3, 10];
886
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
887
- case "ResourceNotFoundException": return [3, 12];
888
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
889
- case "ServiceUnavailableException": return [3, 14];
890
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
891
- case "ThrottlingException": return [3, 16];
892
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
893
- case "UnauthorizedOperation": return [3, 18];
894
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
895
- }
896
- return [3, 20];
897
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
898
- case 3: throw _d.sent();
899
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
900
- case 5: throw _d.sent();
901
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
902
- case 7: throw _d.sent();
903
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
904
- case 9: throw _d.sent();
905
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
906
- case 11: throw _d.sent();
907
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
908
- case 13: throw _d.sent();
909
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
910
- case 15: throw _d.sent();
911
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
912
- case 17: throw _d.sent();
913
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
914
- case 19: throw _d.sent();
915
- case 20:
916
- parsedBody = parsedOutput.body;
917
- throwDefaultError({
918
- output: output,
919
- parsedBody: parsedBody,
920
- exceptionCtor: __BaseException,
921
- errorCode: errorCode,
922
- });
923
- _d.label = 21;
924
- case 21: return [2];
925
- }
926
- });
927
- }); };
928
- export var deserializeAws_json1_1ListApplicationStatesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
929
- var data, contents, response;
930
- return __generator(this, function (_a) {
931
- switch (_a.label) {
932
- case 0:
933
- if (output.statusCode >= 300) {
934
- return [2, deserializeAws_json1_1ListApplicationStatesCommandError(output, context)];
935
- }
936
- return [4, parseBody(output.body, context)];
937
- case 1:
938
- data = _a.sent();
939
- contents = {};
940
- contents = deserializeAws_json1_1ListApplicationStatesResult(data, context);
941
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
942
- return [2, Promise.resolve(response)];
943
- }
944
- });
945
- }); };
946
- var deserializeAws_json1_1ListApplicationStatesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
947
- var parsedOutput, _a, errorCode, _b, parsedBody;
948
- var _c;
949
- return __generator(this, function (_d) {
950
- switch (_d.label) {
951
- case 0:
952
- _a = [__assign({}, output)];
953
- _c = {};
954
- return [4, parseErrorBody(output.body, context)];
955
- case 1:
956
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
957
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
958
- _b = errorCode;
959
- switch (_b) {
960
- case "AccessDeniedException": return [3, 2];
961
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
962
- case "HomeRegionNotSetException": return [3, 4];
963
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
964
- case "InternalServerError": return [3, 6];
965
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
966
- case "InvalidInputException": return [3, 8];
967
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
968
- case "ServiceUnavailableException": return [3, 10];
969
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 10];
970
- case "ThrottlingException": return [3, 12];
971
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 12];
972
- }
973
- return [3, 14];
974
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
975
- case 3: throw _d.sent();
976
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
977
- case 5: throw _d.sent();
978
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
979
- case 7: throw _d.sent();
980
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
981
- case 9: throw _d.sent();
982
- case 10: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
983
- case 11: throw _d.sent();
984
- case 12: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
985
- case 13: throw _d.sent();
986
- case 14:
987
- parsedBody = parsedOutput.body;
988
- throwDefaultError({
989
- output: output,
990
- parsedBody: parsedBody,
991
- exceptionCtor: __BaseException,
992
- errorCode: errorCode,
993
- });
994
- _d.label = 15;
995
- case 15: return [2];
996
- }
997
- });
998
- }); };
999
- export var deserializeAws_json1_1ListCreatedArtifactsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1000
- var data, contents, response;
1001
- return __generator(this, function (_a) {
1002
- switch (_a.label) {
1003
- case 0:
1004
- if (output.statusCode >= 300) {
1005
- return [2, deserializeAws_json1_1ListCreatedArtifactsCommandError(output, context)];
1006
- }
1007
- return [4, parseBody(output.body, context)];
1008
- case 1:
1009
- data = _a.sent();
1010
- contents = {};
1011
- contents = deserializeAws_json1_1ListCreatedArtifactsResult(data, context);
1012
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1013
- return [2, Promise.resolve(response)];
1014
- }
1015
- });
1016
- }); };
1017
- var deserializeAws_json1_1ListCreatedArtifactsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1018
- var parsedOutput, _a, errorCode, _b, parsedBody;
1019
- var _c;
1020
- return __generator(this, function (_d) {
1021
- switch (_d.label) {
1022
- case 0:
1023
- _a = [__assign({}, output)];
1024
- _c = {};
1025
- return [4, parseErrorBody(output.body, context)];
1026
- case 1:
1027
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1028
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1029
- _b = errorCode;
1030
- switch (_b) {
1031
- case "AccessDeniedException": return [3, 2];
1032
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1033
- case "HomeRegionNotSetException": return [3, 4];
1034
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
1035
- case "InternalServerError": return [3, 6];
1036
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
1037
- case "InvalidInputException": return [3, 8];
1038
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
1039
- case "ResourceNotFoundException": return [3, 10];
1040
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 10];
1041
- case "ServiceUnavailableException": return [3, 12];
1042
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 12];
1043
- case "ThrottlingException": return [3, 14];
1044
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 14];
1045
- }
1046
- return [3, 16];
1047
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1048
- case 3: throw _d.sent();
1049
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1050
- case 5: throw _d.sent();
1051
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1052
- case 7: throw _d.sent();
1053
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1054
- case 9: throw _d.sent();
1055
- case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1056
- case 11: throw _d.sent();
1057
- case 12: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1058
- case 13: throw _d.sent();
1059
- case 14: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1060
- case 15: throw _d.sent();
1061
- case 16:
1062
- parsedBody = parsedOutput.body;
1063
- throwDefaultError({
1064
- output: output,
1065
- parsedBody: parsedBody,
1066
- exceptionCtor: __BaseException,
1067
- errorCode: errorCode,
1068
- });
1069
- _d.label = 17;
1070
- case 17: return [2];
1071
- }
1072
- });
1073
- }); };
1074
- export var deserializeAws_json1_1ListDiscoveredResourcesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1075
- var data, contents, response;
1076
- return __generator(this, function (_a) {
1077
- switch (_a.label) {
1078
- case 0:
1079
- if (output.statusCode >= 300) {
1080
- return [2, deserializeAws_json1_1ListDiscoveredResourcesCommandError(output, context)];
1081
- }
1082
- return [4, parseBody(output.body, context)];
1083
- case 1:
1084
- data = _a.sent();
1085
- contents = {};
1086
- contents = deserializeAws_json1_1ListDiscoveredResourcesResult(data, context);
1087
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1088
- return [2, Promise.resolve(response)];
1089
- }
1090
- });
1091
- }); };
1092
- var deserializeAws_json1_1ListDiscoveredResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1093
- var parsedOutput, _a, errorCode, _b, parsedBody;
1094
- var _c;
1095
- return __generator(this, function (_d) {
1096
- switch (_d.label) {
1097
- case 0:
1098
- _a = [__assign({}, output)];
1099
- _c = {};
1100
- return [4, parseErrorBody(output.body, context)];
1101
- case 1:
1102
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1103
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1104
- _b = errorCode;
1105
- switch (_b) {
1106
- case "AccessDeniedException": return [3, 2];
1107
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1108
- case "HomeRegionNotSetException": return [3, 4];
1109
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
1110
- case "InternalServerError": return [3, 6];
1111
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
1112
- case "InvalidInputException": return [3, 8];
1113
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
1114
- case "ResourceNotFoundException": return [3, 10];
1115
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 10];
1116
- case "ServiceUnavailableException": return [3, 12];
1117
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 12];
1118
- case "ThrottlingException": return [3, 14];
1119
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 14];
1120
- }
1121
- return [3, 16];
1122
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1123
- case 3: throw _d.sent();
1124
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1125
- case 5: throw _d.sent();
1126
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1127
- case 7: throw _d.sent();
1128
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1129
- case 9: throw _d.sent();
1130
- case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1131
- case 11: throw _d.sent();
1132
- case 12: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1133
- case 13: throw _d.sent();
1134
- case 14: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1135
- case 15: throw _d.sent();
1136
- case 16:
1137
- parsedBody = parsedOutput.body;
1138
- throwDefaultError({
1139
- output: output,
1140
- parsedBody: parsedBody,
1141
- exceptionCtor: __BaseException,
1142
- errorCode: errorCode,
1143
- });
1144
- _d.label = 17;
1145
- case 17: return [2];
1146
- }
1147
- });
1148
- }); };
1149
- export var deserializeAws_json1_1ListMigrationTasksCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1150
- var data, contents, response;
1151
- return __generator(this, function (_a) {
1152
- switch (_a.label) {
1153
- case 0:
1154
- if (output.statusCode >= 300) {
1155
- return [2, deserializeAws_json1_1ListMigrationTasksCommandError(output, context)];
1156
- }
1157
- return [4, parseBody(output.body, context)];
1158
- case 1:
1159
- data = _a.sent();
1160
- contents = {};
1161
- contents = deserializeAws_json1_1ListMigrationTasksResult(data, context);
1162
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1163
- return [2, Promise.resolve(response)];
1164
- }
1165
- });
1166
- }); };
1167
- var deserializeAws_json1_1ListMigrationTasksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1168
- var parsedOutput, _a, errorCode, _b, parsedBody;
1169
- var _c;
1170
- return __generator(this, function (_d) {
1171
- switch (_d.label) {
1172
- case 0:
1173
- _a = [__assign({}, output)];
1174
- _c = {};
1175
- return [4, parseErrorBody(output.body, context)];
1176
- case 1:
1177
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1178
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
- _b = errorCode;
1180
- switch (_b) {
1181
- case "AccessDeniedException": return [3, 2];
1182
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1183
- case "HomeRegionNotSetException": return [3, 4];
1184
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
1185
- case "InternalServerError": return [3, 6];
1186
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
1187
- case "InvalidInputException": return [3, 8];
1188
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
1189
- case "PolicyErrorException": return [3, 10];
1190
- case "com.amazonaws.migrationhub#PolicyErrorException": return [3, 10];
1191
- case "ResourceNotFoundException": return [3, 12];
1192
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
1193
- case "ServiceUnavailableException": return [3, 14];
1194
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
1195
- case "ThrottlingException": return [3, 16];
1196
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
1197
- }
1198
- return [3, 18];
1199
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1200
- case 3: throw _d.sent();
1201
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1202
- case 5: throw _d.sent();
1203
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1204
- case 7: throw _d.sent();
1205
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1206
- case 9: throw _d.sent();
1207
- case 10: return [4, deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context)];
1208
- case 11: throw _d.sent();
1209
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1210
- case 13: throw _d.sent();
1211
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1212
- case 15: throw _d.sent();
1213
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1214
- case 17: throw _d.sent();
1215
- case 18:
1216
- parsedBody = parsedOutput.body;
1217
- throwDefaultError({
1218
- output: output,
1219
- parsedBody: parsedBody,
1220
- exceptionCtor: __BaseException,
1221
- errorCode: errorCode,
1222
- });
1223
- _d.label = 19;
1224
- case 19: return [2];
1225
- }
1226
- });
1227
- }); };
1228
- export var deserializeAws_json1_1ListProgressUpdateStreamsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1229
- var data, contents, response;
1230
- return __generator(this, function (_a) {
1231
- switch (_a.label) {
1232
- case 0:
1233
- if (output.statusCode >= 300) {
1234
- return [2, deserializeAws_json1_1ListProgressUpdateStreamsCommandError(output, context)];
1235
- }
1236
- return [4, parseBody(output.body, context)];
1237
- case 1:
1238
- data = _a.sent();
1239
- contents = {};
1240
- contents = deserializeAws_json1_1ListProgressUpdateStreamsResult(data, context);
1241
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1242
- return [2, Promise.resolve(response)];
1243
- }
1244
- });
1245
- }); };
1246
- var deserializeAws_json1_1ListProgressUpdateStreamsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1247
- var parsedOutput, _a, errorCode, _b, parsedBody;
1248
- var _c;
1249
- return __generator(this, function (_d) {
1250
- switch (_d.label) {
1251
- case 0:
1252
- _a = [__assign({}, output)];
1253
- _c = {};
1254
- return [4, parseErrorBody(output.body, context)];
1255
- case 1:
1256
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1257
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1258
- _b = errorCode;
1259
- switch (_b) {
1260
- case "AccessDeniedException": return [3, 2];
1261
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1262
- case "HomeRegionNotSetException": return [3, 4];
1263
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 4];
1264
- case "InternalServerError": return [3, 6];
1265
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 6];
1266
- case "InvalidInputException": return [3, 8];
1267
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 8];
1268
- case "ServiceUnavailableException": return [3, 10];
1269
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 10];
1270
- case "ThrottlingException": return [3, 12];
1271
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 12];
1272
- }
1273
- return [3, 14];
1274
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1275
- case 3: throw _d.sent();
1276
- case 4: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1277
- case 5: throw _d.sent();
1278
- case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1279
- case 7: throw _d.sent();
1280
- case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1281
- case 9: throw _d.sent();
1282
- case 10: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1283
- case 11: throw _d.sent();
1284
- case 12: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1285
- case 13: throw _d.sent();
1286
- case 14:
1287
- parsedBody = parsedOutput.body;
1288
- throwDefaultError({
1289
- output: output,
1290
- parsedBody: parsedBody,
1291
- exceptionCtor: __BaseException,
1292
- errorCode: errorCode,
1293
- });
1294
- _d.label = 15;
1295
- case 15: return [2];
1296
- }
1297
- });
1298
- }); };
1299
- export var deserializeAws_json1_1NotifyApplicationStateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1300
- var data, contents, response;
1301
- return __generator(this, function (_a) {
1302
- switch (_a.label) {
1303
- case 0:
1304
- if (output.statusCode >= 300) {
1305
- return [2, deserializeAws_json1_1NotifyApplicationStateCommandError(output, context)];
1306
- }
1307
- return [4, parseBody(output.body, context)];
1308
- case 1:
1309
- data = _a.sent();
1310
- contents = {};
1311
- contents = deserializeAws_json1_1NotifyApplicationStateResult(data, context);
1312
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1313
- return [2, Promise.resolve(response)];
1314
- }
1315
- });
1316
- }); };
1317
- var deserializeAws_json1_1NotifyApplicationStateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1318
- var parsedOutput, _a, errorCode, _b, parsedBody;
1319
- var _c;
1320
- return __generator(this, function (_d) {
1321
- switch (_d.label) {
1322
- case 0:
1323
- _a = [__assign({}, output)];
1324
- _c = {};
1325
- return [4, parseErrorBody(output.body, context)];
1326
- case 1:
1327
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1328
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1329
- _b = errorCode;
1330
- switch (_b) {
1331
- case "AccessDeniedException": return [3, 2];
1332
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1333
- case "DryRunOperation": return [3, 4];
1334
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
1335
- case "HomeRegionNotSetException": return [3, 6];
1336
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
1337
- case "InternalServerError": return [3, 8];
1338
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
1339
- case "InvalidInputException": return [3, 10];
1340
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
1341
- case "PolicyErrorException": return [3, 12];
1342
- case "com.amazonaws.migrationhub#PolicyErrorException": return [3, 12];
1343
- case "ResourceNotFoundException": return [3, 14];
1344
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 14];
1345
- case "ServiceUnavailableException": return [3, 16];
1346
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 16];
1347
- case "ThrottlingException": return [3, 18];
1348
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 18];
1349
- case "UnauthorizedOperation": return [3, 20];
1350
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 20];
1351
- }
1352
- return [3, 22];
1353
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1354
- case 3: throw _d.sent();
1355
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
1356
- case 5: throw _d.sent();
1357
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1358
- case 7: throw _d.sent();
1359
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1360
- case 9: throw _d.sent();
1361
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1362
- case 11: throw _d.sent();
1363
- case 12: return [4, deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context)];
1364
- case 13: throw _d.sent();
1365
- case 14: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1366
- case 15: throw _d.sent();
1367
- case 16: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1368
- case 17: throw _d.sent();
1369
- case 18: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1370
- case 19: throw _d.sent();
1371
- case 20: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
1372
- case 21: throw _d.sent();
1373
- case 22:
1374
- parsedBody = parsedOutput.body;
1375
- throwDefaultError({
1376
- output: output,
1377
- parsedBody: parsedBody,
1378
- exceptionCtor: __BaseException,
1379
- errorCode: errorCode,
1380
- });
1381
- _d.label = 23;
1382
- case 23: return [2];
1383
- }
1384
- });
1385
- }); };
1386
- export var deserializeAws_json1_1NotifyMigrationTaskStateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1387
- var data, contents, response;
1388
- return __generator(this, function (_a) {
1389
- switch (_a.label) {
1390
- case 0:
1391
- if (output.statusCode >= 300) {
1392
- return [2, deserializeAws_json1_1NotifyMigrationTaskStateCommandError(output, context)];
1393
- }
1394
- return [4, parseBody(output.body, context)];
1395
- case 1:
1396
- data = _a.sent();
1397
- contents = {};
1398
- contents = deserializeAws_json1_1NotifyMigrationTaskStateResult(data, context);
1399
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1400
- return [2, Promise.resolve(response)];
1401
- }
1402
- });
1403
- }); };
1404
- var deserializeAws_json1_1NotifyMigrationTaskStateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1405
- var parsedOutput, _a, errorCode, _b, parsedBody;
1406
- var _c;
1407
- return __generator(this, function (_d) {
1408
- switch (_d.label) {
1409
- case 0:
1410
- _a = [__assign({}, output)];
1411
- _c = {};
1412
- return [4, parseErrorBody(output.body, context)];
1413
- case 1:
1414
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1415
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1416
- _b = errorCode;
1417
- switch (_b) {
1418
- case "AccessDeniedException": return [3, 2];
1419
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1420
- case "DryRunOperation": return [3, 4];
1421
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
1422
- case "HomeRegionNotSetException": return [3, 6];
1423
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
1424
- case "InternalServerError": return [3, 8];
1425
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
1426
- case "InvalidInputException": return [3, 10];
1427
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
1428
- case "ResourceNotFoundException": return [3, 12];
1429
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
1430
- case "ServiceUnavailableException": return [3, 14];
1431
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
1432
- case "ThrottlingException": return [3, 16];
1433
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
1434
- case "UnauthorizedOperation": return [3, 18];
1435
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
1436
- }
1437
- return [3, 20];
1438
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1439
- case 3: throw _d.sent();
1440
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
1441
- case 5: throw _d.sent();
1442
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1443
- case 7: throw _d.sent();
1444
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1445
- case 9: throw _d.sent();
1446
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1447
- case 11: throw _d.sent();
1448
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1449
- case 13: throw _d.sent();
1450
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1451
- case 15: throw _d.sent();
1452
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1453
- case 17: throw _d.sent();
1454
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
1455
- case 19: throw _d.sent();
1456
- case 20:
1457
- parsedBody = parsedOutput.body;
1458
- throwDefaultError({
1459
- output: output,
1460
- parsedBody: parsedBody,
1461
- exceptionCtor: __BaseException,
1462
- errorCode: errorCode,
1463
- });
1464
- _d.label = 21;
1465
- case 21: return [2];
1466
- }
1467
- });
1468
- }); };
1469
- export var deserializeAws_json1_1PutResourceAttributesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1470
- var data, contents, response;
1471
- return __generator(this, function (_a) {
1472
- switch (_a.label) {
1473
- case 0:
1474
- if (output.statusCode >= 300) {
1475
- return [2, deserializeAws_json1_1PutResourceAttributesCommandError(output, context)];
1476
- }
1477
- return [4, parseBody(output.body, context)];
1478
- case 1:
1479
- data = _a.sent();
1480
- contents = {};
1481
- contents = deserializeAws_json1_1PutResourceAttributesResult(data, context);
1482
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1483
- return [2, Promise.resolve(response)];
1484
- }
1485
- });
1486
- }); };
1487
- var deserializeAws_json1_1PutResourceAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1488
- var parsedOutput, _a, errorCode, _b, parsedBody;
1489
- var _c;
1490
- return __generator(this, function (_d) {
1491
- switch (_d.label) {
1492
- case 0:
1493
- _a = [__assign({}, output)];
1494
- _c = {};
1495
- return [4, parseErrorBody(output.body, context)];
1496
- case 1:
1497
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1498
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1499
- _b = errorCode;
1500
- switch (_b) {
1501
- case "AccessDeniedException": return [3, 2];
1502
- case "com.amazonaws.migrationhub#AccessDeniedException": return [3, 2];
1503
- case "DryRunOperation": return [3, 4];
1504
- case "com.amazonaws.migrationhub#DryRunOperation": return [3, 4];
1505
- case "HomeRegionNotSetException": return [3, 6];
1506
- case "com.amazonaws.migrationhub#HomeRegionNotSetException": return [3, 6];
1507
- case "InternalServerError": return [3, 8];
1508
- case "com.amazonaws.migrationhub#InternalServerError": return [3, 8];
1509
- case "InvalidInputException": return [3, 10];
1510
- case "com.amazonaws.migrationhub#InvalidInputException": return [3, 10];
1511
- case "ResourceNotFoundException": return [3, 12];
1512
- case "com.amazonaws.migrationhub#ResourceNotFoundException": return [3, 12];
1513
- case "ServiceUnavailableException": return [3, 14];
1514
- case "com.amazonaws.migrationhub#ServiceUnavailableException": return [3, 14];
1515
- case "ThrottlingException": return [3, 16];
1516
- case "com.amazonaws.migrationhub#ThrottlingException": return [3, 16];
1517
- case "UnauthorizedOperation": return [3, 18];
1518
- case "com.amazonaws.migrationhub#UnauthorizedOperation": return [3, 18];
1519
- }
1520
- return [3, 20];
1521
- case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
1522
- case 3: throw _d.sent();
1523
- case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
1524
- case 5: throw _d.sent();
1525
- case 6: return [4, deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context)];
1526
- case 7: throw _d.sent();
1527
- case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
1528
- case 9: throw _d.sent();
1529
- case 10: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
1530
- case 11: throw _d.sent();
1531
- case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1532
- case 13: throw _d.sent();
1533
- case 14: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1534
- case 15: throw _d.sent();
1535
- case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
1536
- case 17: throw _d.sent();
1537
- case 18: return [4, deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context)];
1538
- case 19: throw _d.sent();
1539
- case 20:
1540
- parsedBody = parsedOutput.body;
1541
- throwDefaultError({
1542
- output: output,
1543
- parsedBody: parsedBody,
1544
- exceptionCtor: __BaseException,
1545
- errorCode: errorCode,
1546
- });
1547
- _d.label = 21;
1548
- case 21: return [2];
1549
- }
1550
- });
1551
- }); };
1552
- var deserializeAws_json1_1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1553
- var body, deserialized, exception;
1554
- return __generator(this, function (_a) {
1555
- body = parsedOutput.body;
1556
- deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
1557
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1558
- return [2, __decorateServiceException(exception, body)];
1559
- });
1560
- }); };
1561
- var deserializeAws_json1_1DryRunOperationResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1562
- var body, deserialized, exception;
1563
- return __generator(this, function (_a) {
1564
- body = parsedOutput.body;
1565
- deserialized = deserializeAws_json1_1DryRunOperation(body, context);
1566
- exception = new DryRunOperation(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1567
- return [2, __decorateServiceException(exception, body)];
1568
- });
1569
- }); };
1570
- var deserializeAws_json1_1HomeRegionNotSetExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1571
- var body, deserialized, exception;
1572
- return __generator(this, function (_a) {
1573
- body = parsedOutput.body;
1574
- deserialized = deserializeAws_json1_1HomeRegionNotSetException(body, context);
1575
- exception = new HomeRegionNotSetException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1576
- return [2, __decorateServiceException(exception, body)];
1577
- });
1578
- }); };
1579
- var deserializeAws_json1_1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1580
- var body, deserialized, exception;
1581
- return __generator(this, function (_a) {
1582
- body = parsedOutput.body;
1583
- deserialized = deserializeAws_json1_1InternalServerError(body, context);
1584
- exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1585
- return [2, __decorateServiceException(exception, body)];
1586
- });
1587
- }); };
1588
- var deserializeAws_json1_1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1589
- var body, deserialized, exception;
1590
- return __generator(this, function (_a) {
1591
- body = parsedOutput.body;
1592
- deserialized = deserializeAws_json1_1InvalidInputException(body, context);
1593
- exception = new InvalidInputException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1594
- return [2, __decorateServiceException(exception, body)];
1595
- });
1596
- }); };
1597
- var deserializeAws_json1_1PolicyErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1598
- var body, deserialized, exception;
1599
- return __generator(this, function (_a) {
1600
- body = parsedOutput.body;
1601
- deserialized = deserializeAws_json1_1PolicyErrorException(body, context);
1602
- exception = new PolicyErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1603
- return [2, __decorateServiceException(exception, body)];
1604
- });
1605
- }); };
1606
- var deserializeAws_json1_1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1607
- var body, deserialized, exception;
1608
- return __generator(this, function (_a) {
1609
- body = parsedOutput.body;
1610
- deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
1611
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1612
- return [2, __decorateServiceException(exception, body)];
1613
- });
1614
- }); };
1615
- var deserializeAws_json1_1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1616
- var body, deserialized, exception;
1617
- return __generator(this, function (_a) {
1618
- body = parsedOutput.body;
1619
- deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
1620
- exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1621
- return [2, __decorateServiceException(exception, body)];
1622
- });
1623
- }); };
1624
- var deserializeAws_json1_1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1625
- var body, deserialized, exception;
1626
- return __generator(this, function (_a) {
1627
- body = parsedOutput.body;
1628
- deserialized = deserializeAws_json1_1ThrottlingException(body, context);
1629
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1630
- return [2, __decorateServiceException(exception, body)];
1631
- });
1632
- }); };
1633
- var deserializeAws_json1_1UnauthorizedOperationResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1634
- var body, deserialized, exception;
1635
- return __generator(this, function (_a) {
1636
- body = parsedOutput.body;
1637
- deserialized = deserializeAws_json1_1UnauthorizedOperation(body, context);
1638
- exception = new UnauthorizedOperation(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1639
- return [2, __decorateServiceException(exception, body)];
1640
- });
1641
- }); };
1642
- var serializeAws_json1_1ApplicationIds = function (input, context) {
5
+ export const serializeAws_json1_1AssociateCreatedArtifactCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "AWSMigrationHub.AssociateCreatedArtifact",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1AssociateCreatedArtifactRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1AssociateDiscoveredResourceCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "AWSMigrationHub.AssociateDiscoveredResource",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1AssociateDiscoveredResourceRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1CreateProgressUpdateStreamCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "AWSMigrationHub.CreateProgressUpdateStream",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1CreateProgressUpdateStreamRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1DeleteProgressUpdateStreamCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "AWSMigrationHub.DeleteProgressUpdateStream",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1DeleteProgressUpdateStreamRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1DescribeApplicationStateCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "AWSMigrationHub.DescribeApplicationState",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1DescribeApplicationStateRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1DescribeMigrationTaskCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "AWSMigrationHub.DescribeMigrationTask",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1DescribeMigrationTaskRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_1DisassociateCreatedArtifactCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.1",
62
+ "x-amz-target": "AWSMigrationHub.DisassociateCreatedArtifact",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_1DisassociateCreatedArtifactRequest(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_1DisassociateDiscoveredResourceCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.1",
71
+ "x-amz-target": "AWSMigrationHub.DisassociateDiscoveredResource",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_1DisassociateDiscoveredResourceRequest(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const serializeAws_json1_1ImportMigrationTaskCommand = async (input, context) => {
78
+ const headers = {
79
+ "content-type": "application/x-amz-json-1.1",
80
+ "x-amz-target": "AWSMigrationHub.ImportMigrationTask",
81
+ };
82
+ let body;
83
+ body = JSON.stringify(serializeAws_json1_1ImportMigrationTaskRequest(input, context));
84
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
+ };
86
+ export const serializeAws_json1_1ListApplicationStatesCommand = async (input, context) => {
87
+ const headers = {
88
+ "content-type": "application/x-amz-json-1.1",
89
+ "x-amz-target": "AWSMigrationHub.ListApplicationStates",
90
+ };
91
+ let body;
92
+ body = JSON.stringify(serializeAws_json1_1ListApplicationStatesRequest(input, context));
93
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
+ };
95
+ export const serializeAws_json1_1ListCreatedArtifactsCommand = async (input, context) => {
96
+ const headers = {
97
+ "content-type": "application/x-amz-json-1.1",
98
+ "x-amz-target": "AWSMigrationHub.ListCreatedArtifacts",
99
+ };
100
+ let body;
101
+ body = JSON.stringify(serializeAws_json1_1ListCreatedArtifactsRequest(input, context));
102
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
+ };
104
+ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async (input, context) => {
105
+ const headers = {
106
+ "content-type": "application/x-amz-json-1.1",
107
+ "x-amz-target": "AWSMigrationHub.ListDiscoveredResources",
108
+ };
109
+ let body;
110
+ body = JSON.stringify(serializeAws_json1_1ListDiscoveredResourcesRequest(input, context));
111
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
+ };
113
+ export const serializeAws_json1_1ListMigrationTasksCommand = async (input, context) => {
114
+ const headers = {
115
+ "content-type": "application/x-amz-json-1.1",
116
+ "x-amz-target": "AWSMigrationHub.ListMigrationTasks",
117
+ };
118
+ let body;
119
+ body = JSON.stringify(serializeAws_json1_1ListMigrationTasksRequest(input, context));
120
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
121
+ };
122
+ export const serializeAws_json1_1ListProgressUpdateStreamsCommand = async (input, context) => {
123
+ const headers = {
124
+ "content-type": "application/x-amz-json-1.1",
125
+ "x-amz-target": "AWSMigrationHub.ListProgressUpdateStreams",
126
+ };
127
+ let body;
128
+ body = JSON.stringify(serializeAws_json1_1ListProgressUpdateStreamsRequest(input, context));
129
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
130
+ };
131
+ export const serializeAws_json1_1NotifyApplicationStateCommand = async (input, context) => {
132
+ const headers = {
133
+ "content-type": "application/x-amz-json-1.1",
134
+ "x-amz-target": "AWSMigrationHub.NotifyApplicationState",
135
+ };
136
+ let body;
137
+ body = JSON.stringify(serializeAws_json1_1NotifyApplicationStateRequest(input, context));
138
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
139
+ };
140
+ export const serializeAws_json1_1NotifyMigrationTaskStateCommand = async (input, context) => {
141
+ const headers = {
142
+ "content-type": "application/x-amz-json-1.1",
143
+ "x-amz-target": "AWSMigrationHub.NotifyMigrationTaskState",
144
+ };
145
+ let body;
146
+ body = JSON.stringify(serializeAws_json1_1NotifyMigrationTaskStateRequest(input, context));
147
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
148
+ };
149
+ export const serializeAws_json1_1PutResourceAttributesCommand = async (input, context) => {
150
+ const headers = {
151
+ "content-type": "application/x-amz-json-1.1",
152
+ "x-amz-target": "AWSMigrationHub.PutResourceAttributes",
153
+ };
154
+ let body;
155
+ body = JSON.stringify(serializeAws_json1_1PutResourceAttributesRequest(input, context));
156
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
157
+ };
158
+ export const deserializeAws_json1_1AssociateCreatedArtifactCommand = async (output, context) => {
159
+ if (output.statusCode >= 300) {
160
+ return deserializeAws_json1_1AssociateCreatedArtifactCommandError(output, context);
161
+ }
162
+ const data = await parseBody(output.body, context);
163
+ let contents = {};
164
+ contents = deserializeAws_json1_1AssociateCreatedArtifactResult(data, context);
165
+ const response = {
166
+ $metadata: deserializeMetadata(output),
167
+ ...contents,
168
+ };
169
+ return Promise.resolve(response);
170
+ };
171
+ const deserializeAws_json1_1AssociateCreatedArtifactCommandError = async (output, context) => {
172
+ const parsedOutput = {
173
+ ...output,
174
+ body: await parseErrorBody(output.body, context),
175
+ };
176
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
177
+ switch (errorCode) {
178
+ case "AccessDeniedException":
179
+ case "com.amazonaws.migrationhub#AccessDeniedException":
180
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
181
+ case "DryRunOperation":
182
+ case "com.amazonaws.migrationhub#DryRunOperation":
183
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
184
+ case "HomeRegionNotSetException":
185
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
186
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
187
+ case "InternalServerError":
188
+ case "com.amazonaws.migrationhub#InternalServerError":
189
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
190
+ case "InvalidInputException":
191
+ case "com.amazonaws.migrationhub#InvalidInputException":
192
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
193
+ case "ResourceNotFoundException":
194
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
195
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
196
+ case "ServiceUnavailableException":
197
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
198
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
199
+ case "ThrottlingException":
200
+ case "com.amazonaws.migrationhub#ThrottlingException":
201
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
202
+ case "UnauthorizedOperation":
203
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
204
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
205
+ default:
206
+ const parsedBody = parsedOutput.body;
207
+ throwDefaultError({
208
+ output,
209
+ parsedBody,
210
+ exceptionCtor: __BaseException,
211
+ errorCode,
212
+ });
213
+ }
214
+ };
215
+ export const deserializeAws_json1_1AssociateDiscoveredResourceCommand = async (output, context) => {
216
+ if (output.statusCode >= 300) {
217
+ return deserializeAws_json1_1AssociateDiscoveredResourceCommandError(output, context);
218
+ }
219
+ const data = await parseBody(output.body, context);
220
+ let contents = {};
221
+ contents = deserializeAws_json1_1AssociateDiscoveredResourceResult(data, context);
222
+ const response = {
223
+ $metadata: deserializeMetadata(output),
224
+ ...contents,
225
+ };
226
+ return Promise.resolve(response);
227
+ };
228
+ const deserializeAws_json1_1AssociateDiscoveredResourceCommandError = async (output, context) => {
229
+ const parsedOutput = {
230
+ ...output,
231
+ body: await parseErrorBody(output.body, context),
232
+ };
233
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
234
+ switch (errorCode) {
235
+ case "AccessDeniedException":
236
+ case "com.amazonaws.migrationhub#AccessDeniedException":
237
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
238
+ case "DryRunOperation":
239
+ case "com.amazonaws.migrationhub#DryRunOperation":
240
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
241
+ case "HomeRegionNotSetException":
242
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
243
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
244
+ case "InternalServerError":
245
+ case "com.amazonaws.migrationhub#InternalServerError":
246
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
247
+ case "InvalidInputException":
248
+ case "com.amazonaws.migrationhub#InvalidInputException":
249
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
250
+ case "PolicyErrorException":
251
+ case "com.amazonaws.migrationhub#PolicyErrorException":
252
+ throw await deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context);
253
+ case "ResourceNotFoundException":
254
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
255
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
256
+ case "ServiceUnavailableException":
257
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
258
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
259
+ case "ThrottlingException":
260
+ case "com.amazonaws.migrationhub#ThrottlingException":
261
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
262
+ case "UnauthorizedOperation":
263
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
264
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
265
+ default:
266
+ const parsedBody = parsedOutput.body;
267
+ throwDefaultError({
268
+ output,
269
+ parsedBody,
270
+ exceptionCtor: __BaseException,
271
+ errorCode,
272
+ });
273
+ }
274
+ };
275
+ export const deserializeAws_json1_1CreateProgressUpdateStreamCommand = async (output, context) => {
276
+ if (output.statusCode >= 300) {
277
+ return deserializeAws_json1_1CreateProgressUpdateStreamCommandError(output, context);
278
+ }
279
+ const data = await parseBody(output.body, context);
280
+ let contents = {};
281
+ contents = deserializeAws_json1_1CreateProgressUpdateStreamResult(data, context);
282
+ const response = {
283
+ $metadata: deserializeMetadata(output),
284
+ ...contents,
285
+ };
286
+ return Promise.resolve(response);
287
+ };
288
+ const deserializeAws_json1_1CreateProgressUpdateStreamCommandError = async (output, context) => {
289
+ const parsedOutput = {
290
+ ...output,
291
+ body: await parseErrorBody(output.body, context),
292
+ };
293
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
294
+ switch (errorCode) {
295
+ case "AccessDeniedException":
296
+ case "com.amazonaws.migrationhub#AccessDeniedException":
297
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
298
+ case "DryRunOperation":
299
+ case "com.amazonaws.migrationhub#DryRunOperation":
300
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
301
+ case "HomeRegionNotSetException":
302
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
303
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
304
+ case "InternalServerError":
305
+ case "com.amazonaws.migrationhub#InternalServerError":
306
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
307
+ case "InvalidInputException":
308
+ case "com.amazonaws.migrationhub#InvalidInputException":
309
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
310
+ case "ServiceUnavailableException":
311
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
312
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
313
+ case "ThrottlingException":
314
+ case "com.amazonaws.migrationhub#ThrottlingException":
315
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
316
+ case "UnauthorizedOperation":
317
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
318
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
319
+ default:
320
+ const parsedBody = parsedOutput.body;
321
+ throwDefaultError({
322
+ output,
323
+ parsedBody,
324
+ exceptionCtor: __BaseException,
325
+ errorCode,
326
+ });
327
+ }
328
+ };
329
+ export const deserializeAws_json1_1DeleteProgressUpdateStreamCommand = async (output, context) => {
330
+ if (output.statusCode >= 300) {
331
+ return deserializeAws_json1_1DeleteProgressUpdateStreamCommandError(output, context);
332
+ }
333
+ const data = await parseBody(output.body, context);
334
+ let contents = {};
335
+ contents = deserializeAws_json1_1DeleteProgressUpdateStreamResult(data, context);
336
+ const response = {
337
+ $metadata: deserializeMetadata(output),
338
+ ...contents,
339
+ };
340
+ return Promise.resolve(response);
341
+ };
342
+ const deserializeAws_json1_1DeleteProgressUpdateStreamCommandError = async (output, context) => {
343
+ const parsedOutput = {
344
+ ...output,
345
+ body: await parseErrorBody(output.body, context),
346
+ };
347
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
348
+ switch (errorCode) {
349
+ case "AccessDeniedException":
350
+ case "com.amazonaws.migrationhub#AccessDeniedException":
351
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
352
+ case "DryRunOperation":
353
+ case "com.amazonaws.migrationhub#DryRunOperation":
354
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
355
+ case "HomeRegionNotSetException":
356
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
357
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
358
+ case "InternalServerError":
359
+ case "com.amazonaws.migrationhub#InternalServerError":
360
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
361
+ case "InvalidInputException":
362
+ case "com.amazonaws.migrationhub#InvalidInputException":
363
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
364
+ case "ResourceNotFoundException":
365
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
366
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
367
+ case "ServiceUnavailableException":
368
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
369
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
370
+ case "ThrottlingException":
371
+ case "com.amazonaws.migrationhub#ThrottlingException":
372
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
373
+ case "UnauthorizedOperation":
374
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
375
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
376
+ default:
377
+ const parsedBody = parsedOutput.body;
378
+ throwDefaultError({
379
+ output,
380
+ parsedBody,
381
+ exceptionCtor: __BaseException,
382
+ errorCode,
383
+ });
384
+ }
385
+ };
386
+ export const deserializeAws_json1_1DescribeApplicationStateCommand = async (output, context) => {
387
+ if (output.statusCode >= 300) {
388
+ return deserializeAws_json1_1DescribeApplicationStateCommandError(output, context);
389
+ }
390
+ const data = await parseBody(output.body, context);
391
+ let contents = {};
392
+ contents = deserializeAws_json1_1DescribeApplicationStateResult(data, context);
393
+ const response = {
394
+ $metadata: deserializeMetadata(output),
395
+ ...contents,
396
+ };
397
+ return Promise.resolve(response);
398
+ };
399
+ const deserializeAws_json1_1DescribeApplicationStateCommandError = async (output, context) => {
400
+ const parsedOutput = {
401
+ ...output,
402
+ body: await parseErrorBody(output.body, context),
403
+ };
404
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
405
+ switch (errorCode) {
406
+ case "AccessDeniedException":
407
+ case "com.amazonaws.migrationhub#AccessDeniedException":
408
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
409
+ case "HomeRegionNotSetException":
410
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
411
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
412
+ case "InternalServerError":
413
+ case "com.amazonaws.migrationhub#InternalServerError":
414
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
415
+ case "InvalidInputException":
416
+ case "com.amazonaws.migrationhub#InvalidInputException":
417
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
418
+ case "PolicyErrorException":
419
+ case "com.amazonaws.migrationhub#PolicyErrorException":
420
+ throw await deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context);
421
+ case "ResourceNotFoundException":
422
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
423
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
424
+ case "ServiceUnavailableException":
425
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
426
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
427
+ case "ThrottlingException":
428
+ case "com.amazonaws.migrationhub#ThrottlingException":
429
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
430
+ default:
431
+ const parsedBody = parsedOutput.body;
432
+ throwDefaultError({
433
+ output,
434
+ parsedBody,
435
+ exceptionCtor: __BaseException,
436
+ errorCode,
437
+ });
438
+ }
439
+ };
440
+ export const deserializeAws_json1_1DescribeMigrationTaskCommand = async (output, context) => {
441
+ if (output.statusCode >= 300) {
442
+ return deserializeAws_json1_1DescribeMigrationTaskCommandError(output, context);
443
+ }
444
+ const data = await parseBody(output.body, context);
445
+ let contents = {};
446
+ contents = deserializeAws_json1_1DescribeMigrationTaskResult(data, context);
447
+ const response = {
448
+ $metadata: deserializeMetadata(output),
449
+ ...contents,
450
+ };
451
+ return Promise.resolve(response);
452
+ };
453
+ const deserializeAws_json1_1DescribeMigrationTaskCommandError = async (output, context) => {
454
+ const parsedOutput = {
455
+ ...output,
456
+ body: await parseErrorBody(output.body, context),
457
+ };
458
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
+ switch (errorCode) {
460
+ case "AccessDeniedException":
461
+ case "com.amazonaws.migrationhub#AccessDeniedException":
462
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
463
+ case "HomeRegionNotSetException":
464
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
465
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
466
+ case "InternalServerError":
467
+ case "com.amazonaws.migrationhub#InternalServerError":
468
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
469
+ case "InvalidInputException":
470
+ case "com.amazonaws.migrationhub#InvalidInputException":
471
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
472
+ case "ResourceNotFoundException":
473
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
474
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
475
+ case "ServiceUnavailableException":
476
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
477
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
478
+ case "ThrottlingException":
479
+ case "com.amazonaws.migrationhub#ThrottlingException":
480
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
481
+ default:
482
+ const parsedBody = parsedOutput.body;
483
+ throwDefaultError({
484
+ output,
485
+ parsedBody,
486
+ exceptionCtor: __BaseException,
487
+ errorCode,
488
+ });
489
+ }
490
+ };
491
+ export const deserializeAws_json1_1DisassociateCreatedArtifactCommand = async (output, context) => {
492
+ if (output.statusCode >= 300) {
493
+ return deserializeAws_json1_1DisassociateCreatedArtifactCommandError(output, context);
494
+ }
495
+ const data = await parseBody(output.body, context);
496
+ let contents = {};
497
+ contents = deserializeAws_json1_1DisassociateCreatedArtifactResult(data, context);
498
+ const response = {
499
+ $metadata: deserializeMetadata(output),
500
+ ...contents,
501
+ };
502
+ return Promise.resolve(response);
503
+ };
504
+ const deserializeAws_json1_1DisassociateCreatedArtifactCommandError = async (output, context) => {
505
+ const parsedOutput = {
506
+ ...output,
507
+ body: await parseErrorBody(output.body, context),
508
+ };
509
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
+ switch (errorCode) {
511
+ case "AccessDeniedException":
512
+ case "com.amazonaws.migrationhub#AccessDeniedException":
513
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
514
+ case "DryRunOperation":
515
+ case "com.amazonaws.migrationhub#DryRunOperation":
516
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
517
+ case "HomeRegionNotSetException":
518
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
519
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
520
+ case "InternalServerError":
521
+ case "com.amazonaws.migrationhub#InternalServerError":
522
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
523
+ case "InvalidInputException":
524
+ case "com.amazonaws.migrationhub#InvalidInputException":
525
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
526
+ case "ResourceNotFoundException":
527
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
528
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
529
+ case "ServiceUnavailableException":
530
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
531
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
532
+ case "ThrottlingException":
533
+ case "com.amazonaws.migrationhub#ThrottlingException":
534
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
535
+ case "UnauthorizedOperation":
536
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
537
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
538
+ default:
539
+ const parsedBody = parsedOutput.body;
540
+ throwDefaultError({
541
+ output,
542
+ parsedBody,
543
+ exceptionCtor: __BaseException,
544
+ errorCode,
545
+ });
546
+ }
547
+ };
548
+ export const deserializeAws_json1_1DisassociateDiscoveredResourceCommand = async (output, context) => {
549
+ if (output.statusCode >= 300) {
550
+ return deserializeAws_json1_1DisassociateDiscoveredResourceCommandError(output, context);
551
+ }
552
+ const data = await parseBody(output.body, context);
553
+ let contents = {};
554
+ contents = deserializeAws_json1_1DisassociateDiscoveredResourceResult(data, context);
555
+ const response = {
556
+ $metadata: deserializeMetadata(output),
557
+ ...contents,
558
+ };
559
+ return Promise.resolve(response);
560
+ };
561
+ const deserializeAws_json1_1DisassociateDiscoveredResourceCommandError = async (output, context) => {
562
+ const parsedOutput = {
563
+ ...output,
564
+ body: await parseErrorBody(output.body, context),
565
+ };
566
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
567
+ switch (errorCode) {
568
+ case "AccessDeniedException":
569
+ case "com.amazonaws.migrationhub#AccessDeniedException":
570
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
571
+ case "DryRunOperation":
572
+ case "com.amazonaws.migrationhub#DryRunOperation":
573
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
574
+ case "HomeRegionNotSetException":
575
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
576
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
577
+ case "InternalServerError":
578
+ case "com.amazonaws.migrationhub#InternalServerError":
579
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
580
+ case "InvalidInputException":
581
+ case "com.amazonaws.migrationhub#InvalidInputException":
582
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
583
+ case "ResourceNotFoundException":
584
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
585
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
586
+ case "ServiceUnavailableException":
587
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
588
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
589
+ case "ThrottlingException":
590
+ case "com.amazonaws.migrationhub#ThrottlingException":
591
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
592
+ case "UnauthorizedOperation":
593
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
594
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
595
+ default:
596
+ const parsedBody = parsedOutput.body;
597
+ throwDefaultError({
598
+ output,
599
+ parsedBody,
600
+ exceptionCtor: __BaseException,
601
+ errorCode,
602
+ });
603
+ }
604
+ };
605
+ export const deserializeAws_json1_1ImportMigrationTaskCommand = async (output, context) => {
606
+ if (output.statusCode >= 300) {
607
+ return deserializeAws_json1_1ImportMigrationTaskCommandError(output, context);
608
+ }
609
+ const data = await parseBody(output.body, context);
610
+ let contents = {};
611
+ contents = deserializeAws_json1_1ImportMigrationTaskResult(data, context);
612
+ const response = {
613
+ $metadata: deserializeMetadata(output),
614
+ ...contents,
615
+ };
616
+ return Promise.resolve(response);
617
+ };
618
+ const deserializeAws_json1_1ImportMigrationTaskCommandError = async (output, context) => {
619
+ const parsedOutput = {
620
+ ...output,
621
+ body: await parseErrorBody(output.body, context),
622
+ };
623
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
624
+ switch (errorCode) {
625
+ case "AccessDeniedException":
626
+ case "com.amazonaws.migrationhub#AccessDeniedException":
627
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
628
+ case "DryRunOperation":
629
+ case "com.amazonaws.migrationhub#DryRunOperation":
630
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
631
+ case "HomeRegionNotSetException":
632
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
633
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
634
+ case "InternalServerError":
635
+ case "com.amazonaws.migrationhub#InternalServerError":
636
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
637
+ case "InvalidInputException":
638
+ case "com.amazonaws.migrationhub#InvalidInputException":
639
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
640
+ case "ResourceNotFoundException":
641
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
642
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
643
+ case "ServiceUnavailableException":
644
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
645
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
646
+ case "ThrottlingException":
647
+ case "com.amazonaws.migrationhub#ThrottlingException":
648
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
649
+ case "UnauthorizedOperation":
650
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
651
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(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_json1_1ListApplicationStatesCommand = async (output, context) => {
663
+ if (output.statusCode >= 300) {
664
+ return deserializeAws_json1_1ListApplicationStatesCommandError(output, context);
665
+ }
666
+ const data = await parseBody(output.body, context);
667
+ let contents = {};
668
+ contents = deserializeAws_json1_1ListApplicationStatesResult(data, context);
669
+ const response = {
670
+ $metadata: deserializeMetadata(output),
671
+ ...contents,
672
+ };
673
+ return Promise.resolve(response);
674
+ };
675
+ const deserializeAws_json1_1ListApplicationStatesCommandError = async (output, context) => {
676
+ const parsedOutput = {
677
+ ...output,
678
+ body: await parseErrorBody(output.body, context),
679
+ };
680
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
681
+ switch (errorCode) {
682
+ case "AccessDeniedException":
683
+ case "com.amazonaws.migrationhub#AccessDeniedException":
684
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
685
+ case "HomeRegionNotSetException":
686
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
687
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
688
+ case "InternalServerError":
689
+ case "com.amazonaws.migrationhub#InternalServerError":
690
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
691
+ case "InvalidInputException":
692
+ case "com.amazonaws.migrationhub#InvalidInputException":
693
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
694
+ case "ServiceUnavailableException":
695
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
696
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
697
+ case "ThrottlingException":
698
+ case "com.amazonaws.migrationhub#ThrottlingException":
699
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
700
+ default:
701
+ const parsedBody = parsedOutput.body;
702
+ throwDefaultError({
703
+ output,
704
+ parsedBody,
705
+ exceptionCtor: __BaseException,
706
+ errorCode,
707
+ });
708
+ }
709
+ };
710
+ export const deserializeAws_json1_1ListCreatedArtifactsCommand = async (output, context) => {
711
+ if (output.statusCode >= 300) {
712
+ return deserializeAws_json1_1ListCreatedArtifactsCommandError(output, context);
713
+ }
714
+ const data = await parseBody(output.body, context);
715
+ let contents = {};
716
+ contents = deserializeAws_json1_1ListCreatedArtifactsResult(data, context);
717
+ const response = {
718
+ $metadata: deserializeMetadata(output),
719
+ ...contents,
720
+ };
721
+ return Promise.resolve(response);
722
+ };
723
+ const deserializeAws_json1_1ListCreatedArtifactsCommandError = async (output, context) => {
724
+ const parsedOutput = {
725
+ ...output,
726
+ body: await parseErrorBody(output.body, context),
727
+ };
728
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
+ switch (errorCode) {
730
+ case "AccessDeniedException":
731
+ case "com.amazonaws.migrationhub#AccessDeniedException":
732
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
733
+ case "HomeRegionNotSetException":
734
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
735
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
736
+ case "InternalServerError":
737
+ case "com.amazonaws.migrationhub#InternalServerError":
738
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
739
+ case "InvalidInputException":
740
+ case "com.amazonaws.migrationhub#InvalidInputException":
741
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
742
+ case "ResourceNotFoundException":
743
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
744
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
745
+ case "ServiceUnavailableException":
746
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
747
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
748
+ case "ThrottlingException":
749
+ case "com.amazonaws.migrationhub#ThrottlingException":
750
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
751
+ default:
752
+ const parsedBody = parsedOutput.body;
753
+ throwDefaultError({
754
+ output,
755
+ parsedBody,
756
+ exceptionCtor: __BaseException,
757
+ errorCode,
758
+ });
759
+ }
760
+ };
761
+ export const deserializeAws_json1_1ListDiscoveredResourcesCommand = async (output, context) => {
762
+ if (output.statusCode >= 300) {
763
+ return deserializeAws_json1_1ListDiscoveredResourcesCommandError(output, context);
764
+ }
765
+ const data = await parseBody(output.body, context);
766
+ let contents = {};
767
+ contents = deserializeAws_json1_1ListDiscoveredResourcesResult(data, context);
768
+ const response = {
769
+ $metadata: deserializeMetadata(output),
770
+ ...contents,
771
+ };
772
+ return Promise.resolve(response);
773
+ };
774
+ const deserializeAws_json1_1ListDiscoveredResourcesCommandError = async (output, context) => {
775
+ const parsedOutput = {
776
+ ...output,
777
+ body: await parseErrorBody(output.body, context),
778
+ };
779
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
780
+ switch (errorCode) {
781
+ case "AccessDeniedException":
782
+ case "com.amazonaws.migrationhub#AccessDeniedException":
783
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
784
+ case "HomeRegionNotSetException":
785
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
786
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
787
+ case "InternalServerError":
788
+ case "com.amazonaws.migrationhub#InternalServerError":
789
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
790
+ case "InvalidInputException":
791
+ case "com.amazonaws.migrationhub#InvalidInputException":
792
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
793
+ case "ResourceNotFoundException":
794
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
795
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
796
+ case "ServiceUnavailableException":
797
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
798
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
799
+ case "ThrottlingException":
800
+ case "com.amazonaws.migrationhub#ThrottlingException":
801
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
802
+ default:
803
+ const parsedBody = parsedOutput.body;
804
+ throwDefaultError({
805
+ output,
806
+ parsedBody,
807
+ exceptionCtor: __BaseException,
808
+ errorCode,
809
+ });
810
+ }
811
+ };
812
+ export const deserializeAws_json1_1ListMigrationTasksCommand = async (output, context) => {
813
+ if (output.statusCode >= 300) {
814
+ return deserializeAws_json1_1ListMigrationTasksCommandError(output, context);
815
+ }
816
+ const data = await parseBody(output.body, context);
817
+ let contents = {};
818
+ contents = deserializeAws_json1_1ListMigrationTasksResult(data, context);
819
+ const response = {
820
+ $metadata: deserializeMetadata(output),
821
+ ...contents,
822
+ };
823
+ return Promise.resolve(response);
824
+ };
825
+ const deserializeAws_json1_1ListMigrationTasksCommandError = async (output, context) => {
826
+ const parsedOutput = {
827
+ ...output,
828
+ body: await parseErrorBody(output.body, context),
829
+ };
830
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
831
+ switch (errorCode) {
832
+ case "AccessDeniedException":
833
+ case "com.amazonaws.migrationhub#AccessDeniedException":
834
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
835
+ case "HomeRegionNotSetException":
836
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
837
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
838
+ case "InternalServerError":
839
+ case "com.amazonaws.migrationhub#InternalServerError":
840
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
841
+ case "InvalidInputException":
842
+ case "com.amazonaws.migrationhub#InvalidInputException":
843
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
844
+ case "PolicyErrorException":
845
+ case "com.amazonaws.migrationhub#PolicyErrorException":
846
+ throw await deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context);
847
+ case "ResourceNotFoundException":
848
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
849
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
850
+ case "ServiceUnavailableException":
851
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
852
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
853
+ case "ThrottlingException":
854
+ case "com.amazonaws.migrationhub#ThrottlingException":
855
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
856
+ default:
857
+ const parsedBody = parsedOutput.body;
858
+ throwDefaultError({
859
+ output,
860
+ parsedBody,
861
+ exceptionCtor: __BaseException,
862
+ errorCode,
863
+ });
864
+ }
865
+ };
866
+ export const deserializeAws_json1_1ListProgressUpdateStreamsCommand = async (output, context) => {
867
+ if (output.statusCode >= 300) {
868
+ return deserializeAws_json1_1ListProgressUpdateStreamsCommandError(output, context);
869
+ }
870
+ const data = await parseBody(output.body, context);
871
+ let contents = {};
872
+ contents = deserializeAws_json1_1ListProgressUpdateStreamsResult(data, context);
873
+ const response = {
874
+ $metadata: deserializeMetadata(output),
875
+ ...contents,
876
+ };
877
+ return Promise.resolve(response);
878
+ };
879
+ const deserializeAws_json1_1ListProgressUpdateStreamsCommandError = async (output, context) => {
880
+ const parsedOutput = {
881
+ ...output,
882
+ body: await parseErrorBody(output.body, context),
883
+ };
884
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
885
+ switch (errorCode) {
886
+ case "AccessDeniedException":
887
+ case "com.amazonaws.migrationhub#AccessDeniedException":
888
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
889
+ case "HomeRegionNotSetException":
890
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
891
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
892
+ case "InternalServerError":
893
+ case "com.amazonaws.migrationhub#InternalServerError":
894
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
895
+ case "InvalidInputException":
896
+ case "com.amazonaws.migrationhub#InvalidInputException":
897
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
898
+ case "ServiceUnavailableException":
899
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
900
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
901
+ case "ThrottlingException":
902
+ case "com.amazonaws.migrationhub#ThrottlingException":
903
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
904
+ default:
905
+ const parsedBody = parsedOutput.body;
906
+ throwDefaultError({
907
+ output,
908
+ parsedBody,
909
+ exceptionCtor: __BaseException,
910
+ errorCode,
911
+ });
912
+ }
913
+ };
914
+ export const deserializeAws_json1_1NotifyApplicationStateCommand = async (output, context) => {
915
+ if (output.statusCode >= 300) {
916
+ return deserializeAws_json1_1NotifyApplicationStateCommandError(output, context);
917
+ }
918
+ const data = await parseBody(output.body, context);
919
+ let contents = {};
920
+ contents = deserializeAws_json1_1NotifyApplicationStateResult(data, context);
921
+ const response = {
922
+ $metadata: deserializeMetadata(output),
923
+ ...contents,
924
+ };
925
+ return Promise.resolve(response);
926
+ };
927
+ const deserializeAws_json1_1NotifyApplicationStateCommandError = async (output, context) => {
928
+ const parsedOutput = {
929
+ ...output,
930
+ body: await parseErrorBody(output.body, context),
931
+ };
932
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
933
+ switch (errorCode) {
934
+ case "AccessDeniedException":
935
+ case "com.amazonaws.migrationhub#AccessDeniedException":
936
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
937
+ case "DryRunOperation":
938
+ case "com.amazonaws.migrationhub#DryRunOperation":
939
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
940
+ case "HomeRegionNotSetException":
941
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
942
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
943
+ case "InternalServerError":
944
+ case "com.amazonaws.migrationhub#InternalServerError":
945
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
946
+ case "InvalidInputException":
947
+ case "com.amazonaws.migrationhub#InvalidInputException":
948
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
949
+ case "PolicyErrorException":
950
+ case "com.amazonaws.migrationhub#PolicyErrorException":
951
+ throw await deserializeAws_json1_1PolicyErrorExceptionResponse(parsedOutput, context);
952
+ case "ResourceNotFoundException":
953
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
954
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
955
+ case "ServiceUnavailableException":
956
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
957
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
958
+ case "ThrottlingException":
959
+ case "com.amazonaws.migrationhub#ThrottlingException":
960
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
961
+ case "UnauthorizedOperation":
962
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
963
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
964
+ default:
965
+ const parsedBody = parsedOutput.body;
966
+ throwDefaultError({
967
+ output,
968
+ parsedBody,
969
+ exceptionCtor: __BaseException,
970
+ errorCode,
971
+ });
972
+ }
973
+ };
974
+ export const deserializeAws_json1_1NotifyMigrationTaskStateCommand = async (output, context) => {
975
+ if (output.statusCode >= 300) {
976
+ return deserializeAws_json1_1NotifyMigrationTaskStateCommandError(output, context);
977
+ }
978
+ const data = await parseBody(output.body, context);
979
+ let contents = {};
980
+ contents = deserializeAws_json1_1NotifyMigrationTaskStateResult(data, context);
981
+ const response = {
982
+ $metadata: deserializeMetadata(output),
983
+ ...contents,
984
+ };
985
+ return Promise.resolve(response);
986
+ };
987
+ const deserializeAws_json1_1NotifyMigrationTaskStateCommandError = async (output, context) => {
988
+ const parsedOutput = {
989
+ ...output,
990
+ body: await parseErrorBody(output.body, context),
991
+ };
992
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
993
+ switch (errorCode) {
994
+ case "AccessDeniedException":
995
+ case "com.amazonaws.migrationhub#AccessDeniedException":
996
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
997
+ case "DryRunOperation":
998
+ case "com.amazonaws.migrationhub#DryRunOperation":
999
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
1000
+ case "HomeRegionNotSetException":
1001
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
1002
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
1003
+ case "InternalServerError":
1004
+ case "com.amazonaws.migrationhub#InternalServerError":
1005
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1006
+ case "InvalidInputException":
1007
+ case "com.amazonaws.migrationhub#InvalidInputException":
1008
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1009
+ case "ResourceNotFoundException":
1010
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
1011
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1012
+ case "ServiceUnavailableException":
1013
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
1014
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
1015
+ case "ThrottlingException":
1016
+ case "com.amazonaws.migrationhub#ThrottlingException":
1017
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
1018
+ case "UnauthorizedOperation":
1019
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
1020
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
1021
+ default:
1022
+ const parsedBody = parsedOutput.body;
1023
+ throwDefaultError({
1024
+ output,
1025
+ parsedBody,
1026
+ exceptionCtor: __BaseException,
1027
+ errorCode,
1028
+ });
1029
+ }
1030
+ };
1031
+ export const deserializeAws_json1_1PutResourceAttributesCommand = async (output, context) => {
1032
+ if (output.statusCode >= 300) {
1033
+ return deserializeAws_json1_1PutResourceAttributesCommandError(output, context);
1034
+ }
1035
+ const data = await parseBody(output.body, context);
1036
+ let contents = {};
1037
+ contents = deserializeAws_json1_1PutResourceAttributesResult(data, context);
1038
+ const response = {
1039
+ $metadata: deserializeMetadata(output),
1040
+ ...contents,
1041
+ };
1042
+ return Promise.resolve(response);
1043
+ };
1044
+ const deserializeAws_json1_1PutResourceAttributesCommandError = async (output, context) => {
1045
+ const parsedOutput = {
1046
+ ...output,
1047
+ body: await parseErrorBody(output.body, context),
1048
+ };
1049
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1050
+ switch (errorCode) {
1051
+ case "AccessDeniedException":
1052
+ case "com.amazonaws.migrationhub#AccessDeniedException":
1053
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1054
+ case "DryRunOperation":
1055
+ case "com.amazonaws.migrationhub#DryRunOperation":
1056
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
1057
+ case "HomeRegionNotSetException":
1058
+ case "com.amazonaws.migrationhub#HomeRegionNotSetException":
1059
+ throw await deserializeAws_json1_1HomeRegionNotSetExceptionResponse(parsedOutput, context);
1060
+ case "InternalServerError":
1061
+ case "com.amazonaws.migrationhub#InternalServerError":
1062
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1063
+ case "InvalidInputException":
1064
+ case "com.amazonaws.migrationhub#InvalidInputException":
1065
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1066
+ case "ResourceNotFoundException":
1067
+ case "com.amazonaws.migrationhub#ResourceNotFoundException":
1068
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1069
+ case "ServiceUnavailableException":
1070
+ case "com.amazonaws.migrationhub#ServiceUnavailableException":
1071
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
1072
+ case "ThrottlingException":
1073
+ case "com.amazonaws.migrationhub#ThrottlingException":
1074
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
1075
+ case "UnauthorizedOperation":
1076
+ case "com.amazonaws.migrationhub#UnauthorizedOperation":
1077
+ throw await deserializeAws_json1_1UnauthorizedOperationResponse(parsedOutput, context);
1078
+ default:
1079
+ const parsedBody = parsedOutput.body;
1080
+ throwDefaultError({
1081
+ output,
1082
+ parsedBody,
1083
+ exceptionCtor: __BaseException,
1084
+ errorCode,
1085
+ });
1086
+ }
1087
+ };
1088
+ const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1089
+ const body = parsedOutput.body;
1090
+ const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
1091
+ const exception = new AccessDeniedException({
1092
+ $metadata: deserializeMetadata(parsedOutput),
1093
+ ...deserialized,
1094
+ });
1095
+ return __decorateServiceException(exception, body);
1096
+ };
1097
+ const deserializeAws_json1_1DryRunOperationResponse = async (parsedOutput, context) => {
1098
+ const body = parsedOutput.body;
1099
+ const deserialized = deserializeAws_json1_1DryRunOperation(body, context);
1100
+ const exception = new DryRunOperation({
1101
+ $metadata: deserializeMetadata(parsedOutput),
1102
+ ...deserialized,
1103
+ });
1104
+ return __decorateServiceException(exception, body);
1105
+ };
1106
+ const deserializeAws_json1_1HomeRegionNotSetExceptionResponse = async (parsedOutput, context) => {
1107
+ const body = parsedOutput.body;
1108
+ const deserialized = deserializeAws_json1_1HomeRegionNotSetException(body, context);
1109
+ const exception = new HomeRegionNotSetException({
1110
+ $metadata: deserializeMetadata(parsedOutput),
1111
+ ...deserialized,
1112
+ });
1113
+ return __decorateServiceException(exception, body);
1114
+ };
1115
+ const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
1116
+ const body = parsedOutput.body;
1117
+ const deserialized = deserializeAws_json1_1InternalServerError(body, context);
1118
+ const exception = new InternalServerError({
1119
+ $metadata: deserializeMetadata(parsedOutput),
1120
+ ...deserialized,
1121
+ });
1122
+ return __decorateServiceException(exception, body);
1123
+ };
1124
+ const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
1125
+ const body = parsedOutput.body;
1126
+ const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
1127
+ const exception = new InvalidInputException({
1128
+ $metadata: deserializeMetadata(parsedOutput),
1129
+ ...deserialized,
1130
+ });
1131
+ return __decorateServiceException(exception, body);
1132
+ };
1133
+ const deserializeAws_json1_1PolicyErrorExceptionResponse = async (parsedOutput, context) => {
1134
+ const body = parsedOutput.body;
1135
+ const deserialized = deserializeAws_json1_1PolicyErrorException(body, context);
1136
+ const exception = new PolicyErrorException({
1137
+ $metadata: deserializeMetadata(parsedOutput),
1138
+ ...deserialized,
1139
+ });
1140
+ return __decorateServiceException(exception, body);
1141
+ };
1142
+ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1143
+ const body = parsedOutput.body;
1144
+ const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
1145
+ const exception = new ResourceNotFoundException({
1146
+ $metadata: deserializeMetadata(parsedOutput),
1147
+ ...deserialized,
1148
+ });
1149
+ return __decorateServiceException(exception, body);
1150
+ };
1151
+ const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1152
+ const body = parsedOutput.body;
1153
+ const deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
1154
+ const exception = new ServiceUnavailableException({
1155
+ $metadata: deserializeMetadata(parsedOutput),
1156
+ ...deserialized,
1157
+ });
1158
+ return __decorateServiceException(exception, body);
1159
+ };
1160
+ const deserializeAws_json1_1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1161
+ const body = parsedOutput.body;
1162
+ const deserialized = deserializeAws_json1_1ThrottlingException(body, context);
1163
+ const exception = new ThrottlingException({
1164
+ $metadata: deserializeMetadata(parsedOutput),
1165
+ ...deserialized,
1166
+ });
1167
+ return __decorateServiceException(exception, body);
1168
+ };
1169
+ const deserializeAws_json1_1UnauthorizedOperationResponse = async (parsedOutput, context) => {
1170
+ const body = parsedOutput.body;
1171
+ const deserialized = deserializeAws_json1_1UnauthorizedOperation(body, context);
1172
+ const exception = new UnauthorizedOperation({
1173
+ $metadata: deserializeMetadata(parsedOutput),
1174
+ ...deserialized,
1175
+ });
1176
+ return __decorateServiceException(exception, body);
1177
+ };
1178
+ const serializeAws_json1_1ApplicationIds = (input, context) => {
1643
1179
  return input
1644
- .filter(function (e) { return e != null; })
1645
- .map(function (entry) {
1180
+ .filter((e) => e != null)
1181
+ .map((entry) => {
1646
1182
  return entry;
1647
1183
  });
1648
1184
  };
1649
- var serializeAws_json1_1AssociateCreatedArtifactRequest = function (input, context) {
1650
- return __assign(__assign(__assign(__assign({}, (input.CreatedArtifact != null && {
1651
- CreatedArtifact: serializeAws_json1_1CreatedArtifact(input.CreatedArtifact, context),
1652
- })), (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1185
+ const serializeAws_json1_1AssociateCreatedArtifactRequest = (input, context) => {
1186
+ return {
1187
+ ...(input.CreatedArtifact != null && {
1188
+ CreatedArtifact: serializeAws_json1_1CreatedArtifact(input.CreatedArtifact, context),
1189
+ }),
1190
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1191
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1192
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1193
+ };
1653
1194
  };
1654
- var serializeAws_json1_1AssociateDiscoveredResourceRequest = function (input, context) {
1655
- return __assign(__assign(__assign(__assign({}, (input.DiscoveredResource != null && {
1656
- DiscoveredResource: serializeAws_json1_1DiscoveredResource(input.DiscoveredResource, context),
1657
- })), (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1195
+ const serializeAws_json1_1AssociateDiscoveredResourceRequest = (input, context) => {
1196
+ return {
1197
+ ...(input.DiscoveredResource != null && {
1198
+ DiscoveredResource: serializeAws_json1_1DiscoveredResource(input.DiscoveredResource, context),
1199
+ }),
1200
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1201
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1202
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1203
+ };
1658
1204
  };
1659
- var serializeAws_json1_1CreatedArtifact = function (input, context) {
1660
- return __assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name }));
1205
+ const serializeAws_json1_1CreatedArtifact = (input, context) => {
1206
+ return {
1207
+ ...(input.Description != null && { Description: input.Description }),
1208
+ ...(input.Name != null && { Name: input.Name }),
1209
+ };
1661
1210
  };
1662
- var serializeAws_json1_1CreateProgressUpdateStreamRequest = function (input, context) {
1663
- return __assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.ProgressUpdateStreamName != null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }));
1211
+ const serializeAws_json1_1CreateProgressUpdateStreamRequest = (input, context) => {
1212
+ return {
1213
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1214
+ ...(input.ProgressUpdateStreamName != null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }),
1215
+ };
1664
1216
  };
1665
- var serializeAws_json1_1DeleteProgressUpdateStreamRequest = function (input, context) {
1666
- return __assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.ProgressUpdateStreamName != null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }));
1217
+ const serializeAws_json1_1DeleteProgressUpdateStreamRequest = (input, context) => {
1218
+ return {
1219
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1220
+ ...(input.ProgressUpdateStreamName != null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }),
1221
+ };
1667
1222
  };
1668
- var serializeAws_json1_1DescribeApplicationStateRequest = function (input, context) {
1669
- return __assign({}, (input.ApplicationId != null && { ApplicationId: input.ApplicationId }));
1223
+ const serializeAws_json1_1DescribeApplicationStateRequest = (input, context) => {
1224
+ return {
1225
+ ...(input.ApplicationId != null && { ApplicationId: input.ApplicationId }),
1226
+ };
1670
1227
  };
1671
- var serializeAws_json1_1DescribeMigrationTaskRequest = function (input, context) {
1672
- return __assign(__assign({}, (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1228
+ const serializeAws_json1_1DescribeMigrationTaskRequest = (input, context) => {
1229
+ return {
1230
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1231
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1232
+ };
1673
1233
  };
1674
- var serializeAws_json1_1DisassociateCreatedArtifactRequest = function (input, context) {
1675
- return __assign(__assign(__assign(__assign({}, (input.CreatedArtifactName != null && { CreatedArtifactName: input.CreatedArtifactName })), (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1234
+ const serializeAws_json1_1DisassociateCreatedArtifactRequest = (input, context) => {
1235
+ return {
1236
+ ...(input.CreatedArtifactName != null && { CreatedArtifactName: input.CreatedArtifactName }),
1237
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1238
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1239
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1240
+ };
1676
1241
  };
1677
- var serializeAws_json1_1DisassociateDiscoveredResourceRequest = function (input, context) {
1678
- return __assign(__assign(__assign(__assign({}, (input.ConfigurationId != null && { ConfigurationId: input.ConfigurationId })), (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1242
+ const serializeAws_json1_1DisassociateDiscoveredResourceRequest = (input, context) => {
1243
+ return {
1244
+ ...(input.ConfigurationId != null && { ConfigurationId: input.ConfigurationId }),
1245
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1246
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1247
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1248
+ };
1679
1249
  };
1680
- var serializeAws_json1_1DiscoveredResource = function (input, context) {
1681
- return __assign(__assign({}, (input.ConfigurationId != null && { ConfigurationId: input.ConfigurationId })), (input.Description != null && { Description: input.Description }));
1250
+ const serializeAws_json1_1DiscoveredResource = (input, context) => {
1251
+ return {
1252
+ ...(input.ConfigurationId != null && { ConfigurationId: input.ConfigurationId }),
1253
+ ...(input.Description != null && { Description: input.Description }),
1254
+ };
1682
1255
  };
1683
- var serializeAws_json1_1ImportMigrationTaskRequest = function (input, context) {
1684
- return __assign(__assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1256
+ const serializeAws_json1_1ImportMigrationTaskRequest = (input, context) => {
1257
+ return {
1258
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1259
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1260
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1261
+ };
1685
1262
  };
1686
- var serializeAws_json1_1ListApplicationStatesRequest = function (input, context) {
1687
- return __assign(__assign(__assign({}, (input.ApplicationIds != null && {
1688
- ApplicationIds: serializeAws_json1_1ApplicationIds(input.ApplicationIds, context),
1689
- })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
1263
+ const serializeAws_json1_1ListApplicationStatesRequest = (input, context) => {
1264
+ return {
1265
+ ...(input.ApplicationIds != null && {
1266
+ ApplicationIds: serializeAws_json1_1ApplicationIds(input.ApplicationIds, context),
1267
+ }),
1268
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1269
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1270
+ };
1690
1271
  };
1691
- var serializeAws_json1_1ListCreatedArtifactsRequest = function (input, context) {
1692
- return __assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1272
+ const serializeAws_json1_1ListCreatedArtifactsRequest = (input, context) => {
1273
+ return {
1274
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1275
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1276
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1277
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1278
+ };
1693
1279
  };
1694
- var serializeAws_json1_1ListDiscoveredResourcesRequest = function (input, context) {
1695
- return __assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }));
1280
+ const serializeAws_json1_1ListDiscoveredResourcesRequest = (input, context) => {
1281
+ return {
1282
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1283
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1284
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1285
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1286
+ };
1696
1287
  };
1697
- var serializeAws_json1_1ListMigrationTasksRequest = function (input, context) {
1698
- return __assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ResourceName != null && { ResourceName: input.ResourceName }));
1288
+ const serializeAws_json1_1ListMigrationTasksRequest = (input, context) => {
1289
+ return {
1290
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1291
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1292
+ ...(input.ResourceName != null && { ResourceName: input.ResourceName }),
1293
+ };
1699
1294
  };
1700
- var serializeAws_json1_1ListProgressUpdateStreamsRequest = function (input, context) {
1701
- return __assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
1295
+ const serializeAws_json1_1ListProgressUpdateStreamsRequest = (input, context) => {
1296
+ return {
1297
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1298
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1299
+ };
1702
1300
  };
1703
- var serializeAws_json1_1NotifyApplicationStateRequest = function (input, context) {
1704
- return __assign(__assign(__assign(__assign({}, (input.ApplicationId != null && { ApplicationId: input.ApplicationId })), (input.DryRun != null && { DryRun: input.DryRun })), (input.Status != null && { Status: input.Status })), (input.UpdateDateTime != null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }));
1301
+ const serializeAws_json1_1NotifyApplicationStateRequest = (input, context) => {
1302
+ return {
1303
+ ...(input.ApplicationId != null && { ApplicationId: input.ApplicationId }),
1304
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1305
+ ...(input.Status != null && { Status: input.Status }),
1306
+ ...(input.UpdateDateTime != null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }),
1307
+ };
1705
1308
  };
1706
- var serializeAws_json1_1NotifyMigrationTaskStateRequest = function (input, context) {
1707
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.NextUpdateSeconds != null && { NextUpdateSeconds: input.NextUpdateSeconds })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream })), (input.Task != null && { Task: serializeAws_json1_1Task(input.Task, context) })), (input.UpdateDateTime != null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }));
1309
+ const serializeAws_json1_1NotifyMigrationTaskStateRequest = (input, context) => {
1310
+ return {
1311
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1312
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1313
+ ...(input.NextUpdateSeconds != null && { NextUpdateSeconds: input.NextUpdateSeconds }),
1314
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1315
+ ...(input.Task != null && { Task: serializeAws_json1_1Task(input.Task, context) }),
1316
+ ...(input.UpdateDateTime != null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }),
1317
+ };
1708
1318
  };
1709
- var serializeAws_json1_1PutResourceAttributesRequest = function (input, context) {
1710
- return __assign(__assign(__assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName })), (input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream })), (input.ResourceAttributeList != null && {
1711
- ResourceAttributeList: serializeAws_json1_1ResourceAttributeList(input.ResourceAttributeList, context),
1712
- }));
1319
+ const serializeAws_json1_1PutResourceAttributesRequest = (input, context) => {
1320
+ return {
1321
+ ...(input.DryRun != null && { DryRun: input.DryRun }),
1322
+ ...(input.MigrationTaskName != null && { MigrationTaskName: input.MigrationTaskName }),
1323
+ ...(input.ProgressUpdateStream != null && { ProgressUpdateStream: input.ProgressUpdateStream }),
1324
+ ...(input.ResourceAttributeList != null && {
1325
+ ResourceAttributeList: serializeAws_json1_1ResourceAttributeList(input.ResourceAttributeList, context),
1326
+ }),
1327
+ };
1713
1328
  };
1714
- var serializeAws_json1_1ResourceAttribute = function (input, context) {
1715
- return __assign(__assign({}, (input.Type != null && { Type: input.Type })), (input.Value != null && { Value: input.Value }));
1329
+ const serializeAws_json1_1ResourceAttribute = (input, context) => {
1330
+ return {
1331
+ ...(input.Type != null && { Type: input.Type }),
1332
+ ...(input.Value != null && { Value: input.Value }),
1333
+ };
1716
1334
  };
1717
- var serializeAws_json1_1ResourceAttributeList = function (input, context) {
1335
+ const serializeAws_json1_1ResourceAttributeList = (input, context) => {
1718
1336
  return input
1719
- .filter(function (e) { return e != null; })
1720
- .map(function (entry) {
1337
+ .filter((e) => e != null)
1338
+ .map((entry) => {
1721
1339
  return serializeAws_json1_1ResourceAttribute(entry, context);
1722
1340
  });
1723
1341
  };
1724
- var serializeAws_json1_1Task = function (input, context) {
1725
- return __assign(__assign(__assign({}, (input.ProgressPercent != null && { ProgressPercent: input.ProgressPercent })), (input.Status != null && { Status: input.Status })), (input.StatusDetail != null && { StatusDetail: input.StatusDetail }));
1342
+ const serializeAws_json1_1Task = (input, context) => {
1343
+ return {
1344
+ ...(input.ProgressPercent != null && { ProgressPercent: input.ProgressPercent }),
1345
+ ...(input.Status != null && { Status: input.Status }),
1346
+ ...(input.StatusDetail != null && { StatusDetail: input.StatusDetail }),
1347
+ };
1726
1348
  };
1727
- var deserializeAws_json1_1AccessDeniedException = function (output, context) {
1349
+ const deserializeAws_json1_1AccessDeniedException = (output, context) => {
1728
1350
  return {
1729
1351
  Message: __expectString(output.Message),
1730
1352
  };
1731
1353
  };
1732
- var deserializeAws_json1_1ApplicationState = function (output, context) {
1354
+ const deserializeAws_json1_1ApplicationState = (output, context) => {
1733
1355
  return {
1734
1356
  ApplicationId: __expectString(output.ApplicationId),
1735
1357
  ApplicationStatus: __expectString(output.ApplicationStatus),
@@ -1738,10 +1360,10 @@ var deserializeAws_json1_1ApplicationState = function (output, context) {
1738
1360
  : undefined,
1739
1361
  };
1740
1362
  };
1741
- var deserializeAws_json1_1ApplicationStateList = function (output, context) {
1742
- var retVal = (output || [])
1743
- .filter(function (e) { return e != null; })
1744
- .map(function (entry) {
1363
+ const deserializeAws_json1_1ApplicationStateList = (output, context) => {
1364
+ const retVal = (output || [])
1365
+ .filter((e) => e != null)
1366
+ .map((entry) => {
1745
1367
  if (entry === null) {
1746
1368
  return null;
1747
1369
  }
@@ -1749,22 +1371,22 @@ var deserializeAws_json1_1ApplicationStateList = function (output, context) {
1749
1371
  });
1750
1372
  return retVal;
1751
1373
  };
1752
- var deserializeAws_json1_1AssociateCreatedArtifactResult = function (output, context) {
1374
+ const deserializeAws_json1_1AssociateCreatedArtifactResult = (output, context) => {
1753
1375
  return {};
1754
1376
  };
1755
- var deserializeAws_json1_1AssociateDiscoveredResourceResult = function (output, context) {
1377
+ const deserializeAws_json1_1AssociateDiscoveredResourceResult = (output, context) => {
1756
1378
  return {};
1757
1379
  };
1758
- var deserializeAws_json1_1CreatedArtifact = function (output, context) {
1380
+ const deserializeAws_json1_1CreatedArtifact = (output, context) => {
1759
1381
  return {
1760
1382
  Description: __expectString(output.Description),
1761
1383
  Name: __expectString(output.Name),
1762
1384
  };
1763
1385
  };
1764
- var deserializeAws_json1_1CreatedArtifactList = function (output, context) {
1765
- var retVal = (output || [])
1766
- .filter(function (e) { return e != null; })
1767
- .map(function (entry) {
1386
+ const deserializeAws_json1_1CreatedArtifactList = (output, context) => {
1387
+ const retVal = (output || [])
1388
+ .filter((e) => e != null)
1389
+ .map((entry) => {
1768
1390
  if (entry === null) {
1769
1391
  return null;
1770
1392
  }
@@ -1772,13 +1394,13 @@ var deserializeAws_json1_1CreatedArtifactList = function (output, context) {
1772
1394
  });
1773
1395
  return retVal;
1774
1396
  };
1775
- var deserializeAws_json1_1CreateProgressUpdateStreamResult = function (output, context) {
1397
+ const deserializeAws_json1_1CreateProgressUpdateStreamResult = (output, context) => {
1776
1398
  return {};
1777
1399
  };
1778
- var deserializeAws_json1_1DeleteProgressUpdateStreamResult = function (output, context) {
1400
+ const deserializeAws_json1_1DeleteProgressUpdateStreamResult = (output, context) => {
1779
1401
  return {};
1780
1402
  };
1781
- var deserializeAws_json1_1DescribeApplicationStateResult = function (output, context) {
1403
+ const deserializeAws_json1_1DescribeApplicationStateResult = (output, context) => {
1782
1404
  return {
1783
1405
  ApplicationStatus: __expectString(output.ApplicationStatus),
1784
1406
  LastUpdatedTime: output.LastUpdatedTime != null
@@ -1786,27 +1408,27 @@ var deserializeAws_json1_1DescribeApplicationStateResult = function (output, con
1786
1408
  : undefined,
1787
1409
  };
1788
1410
  };
1789
- var deserializeAws_json1_1DescribeMigrationTaskResult = function (output, context) {
1411
+ const deserializeAws_json1_1DescribeMigrationTaskResult = (output, context) => {
1790
1412
  return {
1791
1413
  MigrationTask: output.MigrationTask != null ? deserializeAws_json1_1MigrationTask(output.MigrationTask, context) : undefined,
1792
1414
  };
1793
1415
  };
1794
- var deserializeAws_json1_1DisassociateCreatedArtifactResult = function (output, context) {
1416
+ const deserializeAws_json1_1DisassociateCreatedArtifactResult = (output, context) => {
1795
1417
  return {};
1796
1418
  };
1797
- var deserializeAws_json1_1DisassociateDiscoveredResourceResult = function (output, context) {
1419
+ const deserializeAws_json1_1DisassociateDiscoveredResourceResult = (output, context) => {
1798
1420
  return {};
1799
1421
  };
1800
- var deserializeAws_json1_1DiscoveredResource = function (output, context) {
1422
+ const deserializeAws_json1_1DiscoveredResource = (output, context) => {
1801
1423
  return {
1802
1424
  ConfigurationId: __expectString(output.ConfigurationId),
1803
1425
  Description: __expectString(output.Description),
1804
1426
  };
1805
1427
  };
1806
- var deserializeAws_json1_1DiscoveredResourceList = function (output, context) {
1807
- var retVal = (output || [])
1808
- .filter(function (e) { return e != null; })
1809
- .map(function (entry) {
1428
+ const deserializeAws_json1_1DiscoveredResourceList = (output, context) => {
1429
+ const retVal = (output || [])
1430
+ .filter((e) => e != null)
1431
+ .map((entry) => {
1810
1432
  if (entry === null) {
1811
1433
  return null;
1812
1434
  }
@@ -1814,33 +1436,33 @@ var deserializeAws_json1_1DiscoveredResourceList = function (output, context) {
1814
1436
  });
1815
1437
  return retVal;
1816
1438
  };
1817
- var deserializeAws_json1_1DryRunOperation = function (output, context) {
1439
+ const deserializeAws_json1_1DryRunOperation = (output, context) => {
1818
1440
  return {
1819
1441
  Message: __expectString(output.Message),
1820
1442
  };
1821
1443
  };
1822
- var deserializeAws_json1_1HomeRegionNotSetException = function (output, context) {
1444
+ const deserializeAws_json1_1HomeRegionNotSetException = (output, context) => {
1823
1445
  return {
1824
1446
  Message: __expectString(output.Message),
1825
1447
  };
1826
1448
  };
1827
- var deserializeAws_json1_1ImportMigrationTaskResult = function (output, context) {
1449
+ const deserializeAws_json1_1ImportMigrationTaskResult = (output, context) => {
1828
1450
  return {};
1829
1451
  };
1830
- var deserializeAws_json1_1InternalServerError = function (output, context) {
1452
+ const deserializeAws_json1_1InternalServerError = (output, context) => {
1831
1453
  return {
1832
1454
  Message: __expectString(output.Message),
1833
1455
  };
1834
1456
  };
1835
- var deserializeAws_json1_1InvalidInputException = function (output, context) {
1457
+ const deserializeAws_json1_1InvalidInputException = (output, context) => {
1836
1458
  return {
1837
1459
  Message: __expectString(output.Message),
1838
1460
  };
1839
1461
  };
1840
- var deserializeAws_json1_1LatestResourceAttributeList = function (output, context) {
1841
- var retVal = (output || [])
1842
- .filter(function (e) { return e != null; })
1843
- .map(function (entry) {
1462
+ const deserializeAws_json1_1LatestResourceAttributeList = (output, context) => {
1463
+ const retVal = (output || [])
1464
+ .filter((e) => e != null)
1465
+ .map((entry) => {
1844
1466
  if (entry === null) {
1845
1467
  return null;
1846
1468
  }
@@ -1848,7 +1470,7 @@ var deserializeAws_json1_1LatestResourceAttributeList = function (output, contex
1848
1470
  });
1849
1471
  return retVal;
1850
1472
  };
1851
- var deserializeAws_json1_1ListApplicationStatesResult = function (output, context) {
1473
+ const deserializeAws_json1_1ListApplicationStatesResult = (output, context) => {
1852
1474
  return {
1853
1475
  ApplicationStateList: output.ApplicationStateList != null
1854
1476
  ? deserializeAws_json1_1ApplicationStateList(output.ApplicationStateList, context)
@@ -1856,7 +1478,7 @@ var deserializeAws_json1_1ListApplicationStatesResult = function (output, contex
1856
1478
  NextToken: __expectString(output.NextToken),
1857
1479
  };
1858
1480
  };
1859
- var deserializeAws_json1_1ListCreatedArtifactsResult = function (output, context) {
1481
+ const deserializeAws_json1_1ListCreatedArtifactsResult = (output, context) => {
1860
1482
  return {
1861
1483
  CreatedArtifactList: output.CreatedArtifactList != null
1862
1484
  ? deserializeAws_json1_1CreatedArtifactList(output.CreatedArtifactList, context)
@@ -1864,7 +1486,7 @@ var deserializeAws_json1_1ListCreatedArtifactsResult = function (output, context
1864
1486
  NextToken: __expectString(output.NextToken),
1865
1487
  };
1866
1488
  };
1867
- var deserializeAws_json1_1ListDiscoveredResourcesResult = function (output, context) {
1489
+ const deserializeAws_json1_1ListDiscoveredResourcesResult = (output, context) => {
1868
1490
  return {
1869
1491
  DiscoveredResourceList: output.DiscoveredResourceList != null
1870
1492
  ? deserializeAws_json1_1DiscoveredResourceList(output.DiscoveredResourceList, context)
@@ -1872,7 +1494,7 @@ var deserializeAws_json1_1ListDiscoveredResourcesResult = function (output, cont
1872
1494
  NextToken: __expectString(output.NextToken),
1873
1495
  };
1874
1496
  };
1875
- var deserializeAws_json1_1ListMigrationTasksResult = function (output, context) {
1497
+ const deserializeAws_json1_1ListMigrationTasksResult = (output, context) => {
1876
1498
  return {
1877
1499
  MigrationTaskSummaryList: output.MigrationTaskSummaryList != null
1878
1500
  ? deserializeAws_json1_1MigrationTaskSummaryList(output.MigrationTaskSummaryList, context)
@@ -1880,7 +1502,7 @@ var deserializeAws_json1_1ListMigrationTasksResult = function (output, context)
1880
1502
  NextToken: __expectString(output.NextToken),
1881
1503
  };
1882
1504
  };
1883
- var deserializeAws_json1_1ListProgressUpdateStreamsResult = function (output, context) {
1505
+ const deserializeAws_json1_1ListProgressUpdateStreamsResult = (output, context) => {
1884
1506
  return {
1885
1507
  NextToken: __expectString(output.NextToken),
1886
1508
  ProgressUpdateStreamSummaryList: output.ProgressUpdateStreamSummaryList != null
@@ -1888,7 +1510,7 @@ var deserializeAws_json1_1ListProgressUpdateStreamsResult = function (output, co
1888
1510
  : undefined,
1889
1511
  };
1890
1512
  };
1891
- var deserializeAws_json1_1MigrationTask = function (output, context) {
1513
+ const deserializeAws_json1_1MigrationTask = (output, context) => {
1892
1514
  return {
1893
1515
  MigrationTaskName: __expectString(output.MigrationTaskName),
1894
1516
  ProgressUpdateStream: __expectString(output.ProgressUpdateStream),
@@ -1901,7 +1523,7 @@ var deserializeAws_json1_1MigrationTask = function (output, context) {
1901
1523
  : undefined,
1902
1524
  };
1903
1525
  };
1904
- var deserializeAws_json1_1MigrationTaskSummary = function (output, context) {
1526
+ const deserializeAws_json1_1MigrationTaskSummary = (output, context) => {
1905
1527
  return {
1906
1528
  MigrationTaskName: __expectString(output.MigrationTaskName),
1907
1529
  ProgressPercent: __expectInt32(output.ProgressPercent),
@@ -1913,10 +1535,10 @@ var deserializeAws_json1_1MigrationTaskSummary = function (output, context) {
1913
1535
  : undefined,
1914
1536
  };
1915
1537
  };
1916
- var deserializeAws_json1_1MigrationTaskSummaryList = function (output, context) {
1917
- var retVal = (output || [])
1918
- .filter(function (e) { return e != null; })
1919
- .map(function (entry) {
1538
+ const deserializeAws_json1_1MigrationTaskSummaryList = (output, context) => {
1539
+ const retVal = (output || [])
1540
+ .filter((e) => e != null)
1541
+ .map((entry) => {
1920
1542
  if (entry === null) {
1921
1543
  return null;
1922
1544
  }
@@ -1924,26 +1546,26 @@ var deserializeAws_json1_1MigrationTaskSummaryList = function (output, context)
1924
1546
  });
1925
1547
  return retVal;
1926
1548
  };
1927
- var deserializeAws_json1_1NotifyApplicationStateResult = function (output, context) {
1549
+ const deserializeAws_json1_1NotifyApplicationStateResult = (output, context) => {
1928
1550
  return {};
1929
1551
  };
1930
- var deserializeAws_json1_1NotifyMigrationTaskStateResult = function (output, context) {
1552
+ const deserializeAws_json1_1NotifyMigrationTaskStateResult = (output, context) => {
1931
1553
  return {};
1932
1554
  };
1933
- var deserializeAws_json1_1PolicyErrorException = function (output, context) {
1555
+ const deserializeAws_json1_1PolicyErrorException = (output, context) => {
1934
1556
  return {
1935
1557
  Message: __expectString(output.Message),
1936
1558
  };
1937
1559
  };
1938
- var deserializeAws_json1_1ProgressUpdateStreamSummary = function (output, context) {
1560
+ const deserializeAws_json1_1ProgressUpdateStreamSummary = (output, context) => {
1939
1561
  return {
1940
1562
  ProgressUpdateStreamName: __expectString(output.ProgressUpdateStreamName),
1941
1563
  };
1942
1564
  };
1943
- var deserializeAws_json1_1ProgressUpdateStreamSummaryList = function (output, context) {
1944
- var retVal = (output || [])
1945
- .filter(function (e) { return e != null; })
1946
- .map(function (entry) {
1565
+ const deserializeAws_json1_1ProgressUpdateStreamSummaryList = (output, context) => {
1566
+ const retVal = (output || [])
1567
+ .filter((e) => e != null)
1568
+ .map((entry) => {
1947
1569
  if (entry === null) {
1948
1570
  return null;
1949
1571
  }
@@ -1951,112 +1573,89 @@ var deserializeAws_json1_1ProgressUpdateStreamSummaryList = function (output, co
1951
1573
  });
1952
1574
  return retVal;
1953
1575
  };
1954
- var deserializeAws_json1_1PutResourceAttributesResult = function (output, context) {
1576
+ const deserializeAws_json1_1PutResourceAttributesResult = (output, context) => {
1955
1577
  return {};
1956
1578
  };
1957
- var deserializeAws_json1_1ResourceAttribute = function (output, context) {
1579
+ const deserializeAws_json1_1ResourceAttribute = (output, context) => {
1958
1580
  return {
1959
1581
  Type: __expectString(output.Type),
1960
1582
  Value: __expectString(output.Value),
1961
1583
  };
1962
1584
  };
1963
- var deserializeAws_json1_1ResourceNotFoundException = function (output, context) {
1585
+ const deserializeAws_json1_1ResourceNotFoundException = (output, context) => {
1964
1586
  return {
1965
1587
  Message: __expectString(output.Message),
1966
1588
  };
1967
1589
  };
1968
- var deserializeAws_json1_1ServiceUnavailableException = function (output, context) {
1590
+ const deserializeAws_json1_1ServiceUnavailableException = (output, context) => {
1969
1591
  return {
1970
1592
  Message: __expectString(output.Message),
1971
1593
  };
1972
1594
  };
1973
- var deserializeAws_json1_1Task = function (output, context) {
1595
+ const deserializeAws_json1_1Task = (output, context) => {
1974
1596
  return {
1975
1597
  ProgressPercent: __expectInt32(output.ProgressPercent),
1976
1598
  Status: __expectString(output.Status),
1977
1599
  StatusDetail: __expectString(output.StatusDetail),
1978
1600
  };
1979
1601
  };
1980
- var deserializeAws_json1_1ThrottlingException = function (output, context) {
1602
+ const deserializeAws_json1_1ThrottlingException = (output, context) => {
1981
1603
  return {
1982
1604
  Message: __expectString(output.Message),
1983
1605
  RetryAfterSeconds: __expectInt32(output.RetryAfterSeconds),
1984
1606
  };
1985
1607
  };
1986
- var deserializeAws_json1_1UnauthorizedOperation = function (output, context) {
1608
+ const deserializeAws_json1_1UnauthorizedOperation = (output, context) => {
1987
1609
  return {
1988
1610
  Message: __expectString(output.Message),
1989
1611
  };
1990
1612
  };
1991
- var deserializeMetadata = function (output) {
1992
- var _a, _b;
1993
- return ({
1994
- httpStatusCode: output.statusCode,
1995
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1996
- extendedRequestId: output.headers["x-amz-id-2"],
1997
- cfId: output.headers["x-amz-cf-id"],
1998
- });
1999
- };
2000
- var collectBody = function (streamBody, context) {
2001
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1613
+ const deserializeMetadata = (output) => ({
1614
+ httpStatusCode: output.statusCode,
1615
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1616
+ extendedRequestId: output.headers["x-amz-id-2"],
1617
+ cfId: output.headers["x-amz-cf-id"],
1618
+ });
1619
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2002
1620
  if (streamBody instanceof Uint8Array) {
2003
1621
  return Promise.resolve(streamBody);
2004
1622
  }
2005
1623
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2006
1624
  };
2007
- var collectBodyString = function (streamBody, context) {
2008
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2009
- };
2010
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
2011
- var _a, hostname, _b, protocol, port, basePath, contents;
2012
- return __generator(this, function (_c) {
2013
- switch (_c.label) {
2014
- case 0: return [4, context.endpoint()];
2015
- case 1:
2016
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
2017
- contents = {
2018
- protocol: protocol,
2019
- hostname: hostname,
2020
- port: port,
2021
- method: "POST",
2022
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2023
- headers: headers,
2024
- };
2025
- if (resolvedHostname !== undefined) {
2026
- contents.hostname = resolvedHostname;
2027
- }
2028
- if (body !== undefined) {
2029
- contents.body = body;
2030
- }
2031
- return [2, new __HttpRequest(contents)];
2032
- }
2033
- });
2034
- }); };
2035
- var parseBody = function (streamBody, context) {
2036
- return collectBodyString(streamBody, context).then(function (encoded) {
2037
- if (encoded.length) {
2038
- return JSON.parse(encoded);
2039
- }
2040
- return {};
2041
- });
1625
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1626
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1627
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1628
+ const contents = {
1629
+ protocol,
1630
+ hostname,
1631
+ port,
1632
+ method: "POST",
1633
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1634
+ headers,
1635
+ };
1636
+ if (resolvedHostname !== undefined) {
1637
+ contents.hostname = resolvedHostname;
1638
+ }
1639
+ if (body !== undefined) {
1640
+ contents.body = body;
1641
+ }
1642
+ return new __HttpRequest(contents);
2042
1643
  };
2043
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2044
- var value;
2045
- var _a;
2046
- return __generator(this, function (_b) {
2047
- switch (_b.label) {
2048
- case 0: return [4, parseBody(errorBody, context)];
2049
- case 1:
2050
- value = _b.sent();
2051
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2052
- return [2, value];
2053
- }
2054
- });
2055
- }); };
2056
- var loadRestJsonErrorCode = function (output, data) {
2057
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2058
- var sanitizeErrorCode = function (rawValue) {
2059
- var cleanValue = rawValue;
1644
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1645
+ if (encoded.length) {
1646
+ return JSON.parse(encoded);
1647
+ }
1648
+ return {};
1649
+ });
1650
+ const parseErrorBody = async (errorBody, context) => {
1651
+ const value = await parseBody(errorBody, context);
1652
+ value.message = value.message ?? value.Message;
1653
+ return value;
1654
+ };
1655
+ const loadRestJsonErrorCode = (output, data) => {
1656
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1657
+ const sanitizeErrorCode = (rawValue) => {
1658
+ let cleanValue = rawValue;
2060
1659
  if (typeof cleanValue === "number") {
2061
1660
  cleanValue = cleanValue.toString();
2062
1661
  }
@@ -2071,7 +1670,7 @@ var loadRestJsonErrorCode = function (output, data) {
2071
1670
  }
2072
1671
  return cleanValue;
2073
1672
  };
2074
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1673
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2075
1674
  if (headerKey !== undefined) {
2076
1675
  return sanitizeErrorCode(output.headers[headerKey]);
2077
1676
  }