@aws-sdk/client-healthlake 3.185.0 → 3.188.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 (28) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/HealthLake.js +54 -61
  3. package/dist-es/HealthLakeClient.js +22 -28
  4. package/dist-es/commands/CreateFHIRDatastoreCommand.js +21 -28
  5. package/dist-es/commands/DeleteFHIRDatastoreCommand.js +21 -28
  6. package/dist-es/commands/DescribeFHIRDatastoreCommand.js +21 -28
  7. package/dist-es/commands/DescribeFHIRExportJobCommand.js +21 -28
  8. package/dist-es/commands/DescribeFHIRImportJobCommand.js +21 -28
  9. package/dist-es/commands/ListFHIRDatastoresCommand.js +21 -28
  10. package/dist-es/commands/ListFHIRExportJobsCommand.js +21 -28
  11. package/dist-es/commands/ListFHIRImportJobsCommand.js +21 -28
  12. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  13. package/dist-es/commands/StartFHIRExportJobCommand.js +21 -28
  14. package/dist-es/commands/StartFHIRImportJobCommand.js +21 -28
  15. package/dist-es/commands/TagResourceCommand.js +21 -28
  16. package/dist-es/commands/UntagResourceCommand.js +21 -28
  17. package/dist-es/endpoints.js +8 -8
  18. package/dist-es/models/HealthLakeServiceException.js +5 -10
  19. package/dist-es/models/models_0.js +201 -124
  20. package/dist-es/pagination/ListFHIRDatastoresPaginator.js +25 -68
  21. package/dist-es/pagination/ListFHIRExportJobsPaginator.js +25 -68
  22. package/dist-es/pagination/ListFHIRImportJobsPaginator.js +25 -68
  23. package/dist-es/protocols/Aws_json1_0.js +932 -1181
  24. package/dist-es/runtimeConfig.browser.js +26 -12
  25. package/dist-es/runtimeConfig.js +30 -12
  26. package/dist-es/runtimeConfig.native.js +8 -5
  27. package/dist-es/runtimeConfig.shared.js +8 -11
  28. package/package.json +33 -33
@@ -1,1130 +1,904 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { HealthLakeServiceException as __BaseException } from "../models/HealthLakeServiceException";
6
5
  import { AccessDeniedException, ConflictException, InputDataConfig, InternalServerException, OutputDataConfig, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
7
- export var serializeAws_json1_0CreateFHIRDatastoreCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var headers, body;
9
- return __generator(this, function (_a) {
10
- headers = {
11
- "content-type": "application/x-amz-json-1.0",
12
- "x-amz-target": "HealthLake.CreateFHIRDatastore",
13
- };
14
- body = JSON.stringify(serializeAws_json1_0CreateFHIRDatastoreRequest(input, context));
15
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
16
- });
17
- }); };
18
- export var serializeAws_json1_0DeleteFHIRDatastoreCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
19
- var headers, body;
20
- return __generator(this, function (_a) {
21
- headers = {
22
- "content-type": "application/x-amz-json-1.0",
23
- "x-amz-target": "HealthLake.DeleteFHIRDatastore",
24
- };
25
- body = JSON.stringify(serializeAws_json1_0DeleteFHIRDatastoreRequest(input, context));
26
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
27
- });
28
- }); };
29
- export var serializeAws_json1_0DescribeFHIRDatastoreCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
30
- var headers, body;
31
- return __generator(this, function (_a) {
32
- headers = {
33
- "content-type": "application/x-amz-json-1.0",
34
- "x-amz-target": "HealthLake.DescribeFHIRDatastore",
35
- };
36
- body = JSON.stringify(serializeAws_json1_0DescribeFHIRDatastoreRequest(input, context));
37
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
38
- });
39
- }); };
40
- export var serializeAws_json1_0DescribeFHIRExportJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
41
- var headers, body;
42
- return __generator(this, function (_a) {
43
- headers = {
44
- "content-type": "application/x-amz-json-1.0",
45
- "x-amz-target": "HealthLake.DescribeFHIRExportJob",
46
- };
47
- body = JSON.stringify(serializeAws_json1_0DescribeFHIRExportJobRequest(input, context));
48
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
49
- });
50
- }); };
51
- export var serializeAws_json1_0DescribeFHIRImportJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
52
- var headers, body;
53
- return __generator(this, function (_a) {
54
- headers = {
55
- "content-type": "application/x-amz-json-1.0",
56
- "x-amz-target": "HealthLake.DescribeFHIRImportJob",
57
- };
58
- body = JSON.stringify(serializeAws_json1_0DescribeFHIRImportJobRequest(input, context));
59
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
60
- });
61
- }); };
62
- export var serializeAws_json1_0ListFHIRDatastoresCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
63
- var headers, body;
64
- return __generator(this, function (_a) {
65
- headers = {
66
- "content-type": "application/x-amz-json-1.0",
67
- "x-amz-target": "HealthLake.ListFHIRDatastores",
68
- };
69
- body = JSON.stringify(serializeAws_json1_0ListFHIRDatastoresRequest(input, context));
70
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
71
- });
72
- }); };
73
- export var serializeAws_json1_0ListFHIRExportJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
74
- var headers, body;
75
- return __generator(this, function (_a) {
76
- headers = {
77
- "content-type": "application/x-amz-json-1.0",
78
- "x-amz-target": "HealthLake.ListFHIRExportJobs",
79
- };
80
- body = JSON.stringify(serializeAws_json1_0ListFHIRExportJobsRequest(input, context));
81
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
82
- });
83
- }); };
84
- export var serializeAws_json1_0ListFHIRImportJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
85
- var headers, body;
86
- return __generator(this, function (_a) {
87
- headers = {
88
- "content-type": "application/x-amz-json-1.0",
89
- "x-amz-target": "HealthLake.ListFHIRImportJobs",
90
- };
91
- body = JSON.stringify(serializeAws_json1_0ListFHIRImportJobsRequest(input, context));
92
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
93
- });
94
- }); };
95
- export var serializeAws_json1_0ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
96
- var headers, body;
97
- return __generator(this, function (_a) {
98
- headers = {
99
- "content-type": "application/x-amz-json-1.0",
100
- "x-amz-target": "HealthLake.ListTagsForResource",
101
- };
102
- body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
103
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
104
- });
105
- }); };
106
- export var serializeAws_json1_0StartFHIRExportJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
- var headers, body;
108
- return __generator(this, function (_a) {
109
- headers = {
110
- "content-type": "application/x-amz-json-1.0",
111
- "x-amz-target": "HealthLake.StartFHIRExportJob",
112
- };
113
- body = JSON.stringify(serializeAws_json1_0StartFHIRExportJobRequest(input, context));
114
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
115
- });
116
- }); };
117
- export var serializeAws_json1_0StartFHIRImportJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
118
- var headers, body;
119
- return __generator(this, function (_a) {
120
- headers = {
121
- "content-type": "application/x-amz-json-1.0",
122
- "x-amz-target": "HealthLake.StartFHIRImportJob",
123
- };
124
- body = JSON.stringify(serializeAws_json1_0StartFHIRImportJobRequest(input, context));
125
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
126
- });
127
- }); };
128
- export var serializeAws_json1_0TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
- var headers, body;
130
- return __generator(this, function (_a) {
131
- headers = {
132
- "content-type": "application/x-amz-json-1.0",
133
- "x-amz-target": "HealthLake.TagResource",
134
- };
135
- body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
136
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
137
- });
138
- }); };
139
- export var serializeAws_json1_0UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
- var headers, body;
141
- return __generator(this, function (_a) {
142
- headers = {
143
- "content-type": "application/x-amz-json-1.0",
144
- "x-amz-target": "HealthLake.UntagResource",
145
- };
146
- body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
147
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
148
- });
149
- }); };
150
- export var deserializeAws_json1_0CreateFHIRDatastoreCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
151
- var data, contents, response;
152
- return __generator(this, function (_a) {
153
- switch (_a.label) {
154
- case 0:
155
- if (output.statusCode >= 300) {
156
- return [2, deserializeAws_json1_0CreateFHIRDatastoreCommandError(output, context)];
157
- }
158
- return [4, parseBody(output.body, context)];
159
- case 1:
160
- data = _a.sent();
161
- contents = {};
162
- contents = deserializeAws_json1_0CreateFHIRDatastoreResponse(data, context);
163
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
164
- return [2, Promise.resolve(response)];
165
- }
166
- });
167
- }); };
168
- var deserializeAws_json1_0CreateFHIRDatastoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
169
- var parsedOutput, _a, errorCode, _b, parsedBody;
170
- var _c;
171
- return __generator(this, function (_d) {
172
- switch (_d.label) {
173
- case 0:
174
- _a = [__assign({}, output)];
175
- _c = {};
176
- return [4, parseErrorBody(output.body, context)];
177
- case 1:
178
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
179
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
180
- _b = errorCode;
181
- switch (_b) {
182
- case "AccessDeniedException": return [3, 2];
183
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
184
- case "InternalServerException": return [3, 4];
185
- case "com.amazonaws.healthlake#InternalServerException": return [3, 4];
186
- case "ThrottlingException": return [3, 6];
187
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 6];
188
- case "ValidationException": return [3, 8];
189
- case "com.amazonaws.healthlake#ValidationException": return [3, 8];
190
- }
191
- return [3, 10];
192
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
193
- case 3: throw _d.sent();
194
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
195
- case 5: throw _d.sent();
196
- case 6: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
197
- case 7: throw _d.sent();
198
- case 8: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
199
- case 9: throw _d.sent();
200
- case 10:
201
- parsedBody = parsedOutput.body;
202
- throwDefaultError({
203
- output: output,
204
- parsedBody: parsedBody,
205
- exceptionCtor: __BaseException,
206
- errorCode: errorCode,
207
- });
208
- _d.label = 11;
209
- case 11: return [2];
210
- }
211
- });
212
- }); };
213
- export var deserializeAws_json1_0DeleteFHIRDatastoreCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
214
- var data, contents, response;
215
- return __generator(this, function (_a) {
216
- switch (_a.label) {
217
- case 0:
218
- if (output.statusCode >= 300) {
219
- return [2, deserializeAws_json1_0DeleteFHIRDatastoreCommandError(output, context)];
220
- }
221
- return [4, parseBody(output.body, context)];
222
- case 1:
223
- data = _a.sent();
224
- contents = {};
225
- contents = deserializeAws_json1_0DeleteFHIRDatastoreResponse(data, context);
226
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
227
- return [2, Promise.resolve(response)];
228
- }
229
- });
230
- }); };
231
- var deserializeAws_json1_0DeleteFHIRDatastoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
232
- var parsedOutput, _a, errorCode, _b, parsedBody;
233
- var _c;
234
- return __generator(this, function (_d) {
235
- switch (_d.label) {
236
- case 0:
237
- _a = [__assign({}, output)];
238
- _c = {};
239
- return [4, parseErrorBody(output.body, context)];
240
- case 1:
241
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
242
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
243
- _b = errorCode;
244
- switch (_b) {
245
- case "AccessDeniedException": return [3, 2];
246
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
247
- case "ConflictException": return [3, 4];
248
- case "com.amazonaws.healthlake#ConflictException": return [3, 4];
249
- case "InternalServerException": return [3, 6];
250
- case "com.amazonaws.healthlake#InternalServerException": return [3, 6];
251
- case "ResourceNotFoundException": return [3, 8];
252
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 8];
253
- case "ThrottlingException": return [3, 10];
254
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 10];
255
- case "ValidationException": return [3, 12];
256
- case "com.amazonaws.healthlake#ValidationException": return [3, 12];
257
- }
258
- return [3, 14];
259
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
260
- case 3: throw _d.sent();
261
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
262
- case 5: throw _d.sent();
263
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
264
- case 7: throw _d.sent();
265
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
266
- case 9: throw _d.sent();
267
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
268
- case 11: throw _d.sent();
269
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
270
- case 13: throw _d.sent();
271
- case 14:
272
- parsedBody = parsedOutput.body;
273
- throwDefaultError({
274
- output: output,
275
- parsedBody: parsedBody,
276
- exceptionCtor: __BaseException,
277
- errorCode: errorCode,
278
- });
279
- _d.label = 15;
280
- case 15: return [2];
281
- }
282
- });
283
- }); };
284
- export var deserializeAws_json1_0DescribeFHIRDatastoreCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
285
- var data, contents, response;
286
- return __generator(this, function (_a) {
287
- switch (_a.label) {
288
- case 0:
289
- if (output.statusCode >= 300) {
290
- return [2, deserializeAws_json1_0DescribeFHIRDatastoreCommandError(output, context)];
291
- }
292
- return [4, parseBody(output.body, context)];
293
- case 1:
294
- data = _a.sent();
295
- contents = {};
296
- contents = deserializeAws_json1_0DescribeFHIRDatastoreResponse(data, context);
297
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
298
- return [2, Promise.resolve(response)];
299
- }
300
- });
301
- }); };
302
- var deserializeAws_json1_0DescribeFHIRDatastoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
303
- var parsedOutput, _a, errorCode, _b, parsedBody;
304
- var _c;
305
- return __generator(this, function (_d) {
306
- switch (_d.label) {
307
- case 0:
308
- _a = [__assign({}, output)];
309
- _c = {};
310
- return [4, parseErrorBody(output.body, context)];
311
- case 1:
312
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
313
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
314
- _b = errorCode;
315
- switch (_b) {
316
- case "InternalServerException": return [3, 2];
317
- case "com.amazonaws.healthlake#InternalServerException": return [3, 2];
318
- case "ResourceNotFoundException": return [3, 4];
319
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 4];
320
- case "ThrottlingException": return [3, 6];
321
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 6];
322
- case "ValidationException": return [3, 8];
323
- case "com.amazonaws.healthlake#ValidationException": return [3, 8];
324
- }
325
- return [3, 10];
326
- case 2: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
327
- case 3: throw _d.sent();
328
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
329
- case 5: throw _d.sent();
330
- case 6: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
331
- case 7: throw _d.sent();
332
- case 8: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
333
- case 9: throw _d.sent();
334
- case 10:
335
- parsedBody = parsedOutput.body;
336
- throwDefaultError({
337
- output: output,
338
- parsedBody: parsedBody,
339
- exceptionCtor: __BaseException,
340
- errorCode: errorCode,
341
- });
342
- _d.label = 11;
343
- case 11: return [2];
344
- }
345
- });
346
- }); };
347
- export var deserializeAws_json1_0DescribeFHIRExportJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
348
- var data, contents, response;
349
- return __generator(this, function (_a) {
350
- switch (_a.label) {
351
- case 0:
352
- if (output.statusCode >= 300) {
353
- return [2, deserializeAws_json1_0DescribeFHIRExportJobCommandError(output, context)];
354
- }
355
- return [4, parseBody(output.body, context)];
356
- case 1:
357
- data = _a.sent();
358
- contents = {};
359
- contents = deserializeAws_json1_0DescribeFHIRExportJobResponse(data, context);
360
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
361
- return [2, Promise.resolve(response)];
362
- }
363
- });
364
- }); };
365
- var deserializeAws_json1_0DescribeFHIRExportJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
366
- var parsedOutput, _a, errorCode, _b, parsedBody;
367
- var _c;
368
- return __generator(this, function (_d) {
369
- switch (_d.label) {
370
- case 0:
371
- _a = [__assign({}, output)];
372
- _c = {};
373
- return [4, parseErrorBody(output.body, context)];
374
- case 1:
375
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
376
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
377
- _b = errorCode;
378
- switch (_b) {
379
- case "InternalServerException": return [3, 2];
380
- case "com.amazonaws.healthlake#InternalServerException": return [3, 2];
381
- case "ResourceNotFoundException": return [3, 4];
382
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 4];
383
- case "ThrottlingException": return [3, 6];
384
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 6];
385
- case "ValidationException": return [3, 8];
386
- case "com.amazonaws.healthlake#ValidationException": return [3, 8];
387
- }
388
- return [3, 10];
389
- case 2: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
390
- case 3: throw _d.sent();
391
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
392
- case 5: throw _d.sent();
393
- case 6: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
394
- case 7: throw _d.sent();
395
- case 8: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
396
- case 9: throw _d.sent();
397
- case 10:
398
- parsedBody = parsedOutput.body;
399
- throwDefaultError({
400
- output: output,
401
- parsedBody: parsedBody,
402
- exceptionCtor: __BaseException,
403
- errorCode: errorCode,
404
- });
405
- _d.label = 11;
406
- case 11: return [2];
407
- }
408
- });
409
- }); };
410
- export var deserializeAws_json1_0DescribeFHIRImportJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
411
- var data, contents, response;
412
- return __generator(this, function (_a) {
413
- switch (_a.label) {
414
- case 0:
415
- if (output.statusCode >= 300) {
416
- return [2, deserializeAws_json1_0DescribeFHIRImportJobCommandError(output, context)];
417
- }
418
- return [4, parseBody(output.body, context)];
419
- case 1:
420
- data = _a.sent();
421
- contents = {};
422
- contents = deserializeAws_json1_0DescribeFHIRImportJobResponse(data, context);
423
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
424
- return [2, Promise.resolve(response)];
425
- }
426
- });
427
- }); };
428
- var deserializeAws_json1_0DescribeFHIRImportJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
429
- var parsedOutput, _a, errorCode, _b, parsedBody;
430
- var _c;
431
- return __generator(this, function (_d) {
432
- switch (_d.label) {
433
- case 0:
434
- _a = [__assign({}, output)];
435
- _c = {};
436
- return [4, parseErrorBody(output.body, context)];
437
- case 1:
438
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
439
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
440
- _b = errorCode;
441
- switch (_b) {
442
- case "InternalServerException": return [3, 2];
443
- case "com.amazonaws.healthlake#InternalServerException": return [3, 2];
444
- case "ResourceNotFoundException": return [3, 4];
445
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 4];
446
- case "ThrottlingException": return [3, 6];
447
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 6];
448
- case "ValidationException": return [3, 8];
449
- case "com.amazonaws.healthlake#ValidationException": return [3, 8];
450
- }
451
- return [3, 10];
452
- case 2: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
453
- case 3: throw _d.sent();
454
- case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
455
- case 5: throw _d.sent();
456
- case 6: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
457
- case 7: throw _d.sent();
458
- case 8: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
459
- case 9: throw _d.sent();
460
- case 10:
461
- parsedBody = parsedOutput.body;
462
- throwDefaultError({
463
- output: output,
464
- parsedBody: parsedBody,
465
- exceptionCtor: __BaseException,
466
- errorCode: errorCode,
467
- });
468
- _d.label = 11;
469
- case 11: return [2];
470
- }
471
- });
472
- }); };
473
- export var deserializeAws_json1_0ListFHIRDatastoresCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
474
- var data, contents, response;
475
- return __generator(this, function (_a) {
476
- switch (_a.label) {
477
- case 0:
478
- if (output.statusCode >= 300) {
479
- return [2, deserializeAws_json1_0ListFHIRDatastoresCommandError(output, context)];
480
- }
481
- return [4, parseBody(output.body, context)];
482
- case 1:
483
- data = _a.sent();
484
- contents = {};
485
- contents = deserializeAws_json1_0ListFHIRDatastoresResponse(data, context);
486
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
487
- return [2, Promise.resolve(response)];
488
- }
489
- });
490
- }); };
491
- var deserializeAws_json1_0ListFHIRDatastoresCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
492
- var parsedOutput, _a, errorCode, _b, parsedBody;
493
- var _c;
494
- return __generator(this, function (_d) {
495
- switch (_d.label) {
496
- case 0:
497
- _a = [__assign({}, output)];
498
- _c = {};
499
- return [4, parseErrorBody(output.body, context)];
500
- case 1:
501
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
502
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
- _b = errorCode;
504
- switch (_b) {
505
- case "InternalServerException": return [3, 2];
506
- case "com.amazonaws.healthlake#InternalServerException": return [3, 2];
507
- case "ThrottlingException": return [3, 4];
508
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 4];
509
- case "ValidationException": return [3, 6];
510
- case "com.amazonaws.healthlake#ValidationException": return [3, 6];
511
- }
512
- return [3, 8];
513
- case 2: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
514
- case 3: throw _d.sent();
515
- case 4: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
516
- case 5: throw _d.sent();
517
- case 6: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
518
- case 7: throw _d.sent();
519
- case 8:
520
- parsedBody = parsedOutput.body;
521
- throwDefaultError({
522
- output: output,
523
- parsedBody: parsedBody,
524
- exceptionCtor: __BaseException,
525
- errorCode: errorCode,
526
- });
527
- _d.label = 9;
528
- case 9: return [2];
529
- }
530
- });
531
- }); };
532
- export var deserializeAws_json1_0ListFHIRExportJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
533
- var data, contents, response;
534
- return __generator(this, function (_a) {
535
- switch (_a.label) {
536
- case 0:
537
- if (output.statusCode >= 300) {
538
- return [2, deserializeAws_json1_0ListFHIRExportJobsCommandError(output, context)];
539
- }
540
- return [4, parseBody(output.body, context)];
541
- case 1:
542
- data = _a.sent();
543
- contents = {};
544
- contents = deserializeAws_json1_0ListFHIRExportJobsResponse(data, context);
545
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
546
- return [2, Promise.resolve(response)];
547
- }
548
- });
549
- }); };
550
- var deserializeAws_json1_0ListFHIRExportJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
551
- var parsedOutput, _a, errorCode, _b, parsedBody;
552
- var _c;
553
- return __generator(this, function (_d) {
554
- switch (_d.label) {
555
- case 0:
556
- _a = [__assign({}, output)];
557
- _c = {};
558
- return [4, parseErrorBody(output.body, context)];
559
- case 1:
560
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
561
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
562
- _b = errorCode;
563
- switch (_b) {
564
- case "AccessDeniedException": return [3, 2];
565
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
566
- case "InternalServerException": return [3, 4];
567
- case "com.amazonaws.healthlake#InternalServerException": return [3, 4];
568
- case "ResourceNotFoundException": return [3, 6];
569
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 6];
570
- case "ThrottlingException": return [3, 8];
571
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 8];
572
- case "ValidationException": return [3, 10];
573
- case "com.amazonaws.healthlake#ValidationException": return [3, 10];
574
- }
575
- return [3, 12];
576
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
577
- case 3: throw _d.sent();
578
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
579
- case 5: throw _d.sent();
580
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
581
- case 7: throw _d.sent();
582
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
583
- case 9: throw _d.sent();
584
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
585
- case 11: throw _d.sent();
586
- case 12:
587
- parsedBody = parsedOutput.body;
588
- throwDefaultError({
589
- output: output,
590
- parsedBody: parsedBody,
591
- exceptionCtor: __BaseException,
592
- errorCode: errorCode,
593
- });
594
- _d.label = 13;
595
- case 13: return [2];
596
- }
597
- });
598
- }); };
599
- export var deserializeAws_json1_0ListFHIRImportJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
600
- var data, contents, response;
601
- return __generator(this, function (_a) {
602
- switch (_a.label) {
603
- case 0:
604
- if (output.statusCode >= 300) {
605
- return [2, deserializeAws_json1_0ListFHIRImportJobsCommandError(output, context)];
606
- }
607
- return [4, parseBody(output.body, context)];
608
- case 1:
609
- data = _a.sent();
610
- contents = {};
611
- contents = deserializeAws_json1_0ListFHIRImportJobsResponse(data, context);
612
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
613
- return [2, Promise.resolve(response)];
614
- }
615
- });
616
- }); };
617
- var deserializeAws_json1_0ListFHIRImportJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
618
- var parsedOutput, _a, errorCode, _b, parsedBody;
619
- var _c;
620
- return __generator(this, function (_d) {
621
- switch (_d.label) {
622
- case 0:
623
- _a = [__assign({}, output)];
624
- _c = {};
625
- return [4, parseErrorBody(output.body, context)];
626
- case 1:
627
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
628
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
629
- _b = errorCode;
630
- switch (_b) {
631
- case "AccessDeniedException": return [3, 2];
632
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
633
- case "InternalServerException": return [3, 4];
634
- case "com.amazonaws.healthlake#InternalServerException": return [3, 4];
635
- case "ResourceNotFoundException": return [3, 6];
636
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 6];
637
- case "ThrottlingException": return [3, 8];
638
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 8];
639
- case "ValidationException": return [3, 10];
640
- case "com.amazonaws.healthlake#ValidationException": return [3, 10];
641
- }
642
- return [3, 12];
643
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
644
- case 3: throw _d.sent();
645
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
646
- case 5: throw _d.sent();
647
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
648
- case 7: throw _d.sent();
649
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
650
- case 9: throw _d.sent();
651
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
652
- case 11: throw _d.sent();
653
- case 12:
654
- parsedBody = parsedOutput.body;
655
- throwDefaultError({
656
- output: output,
657
- parsedBody: parsedBody,
658
- exceptionCtor: __BaseException,
659
- errorCode: errorCode,
660
- });
661
- _d.label = 13;
662
- case 13: return [2];
663
- }
664
- });
665
- }); };
666
- export var deserializeAws_json1_0ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
667
- var data, contents, response;
668
- return __generator(this, function (_a) {
669
- switch (_a.label) {
670
- case 0:
671
- if (output.statusCode >= 300) {
672
- return [2, deserializeAws_json1_0ListTagsForResourceCommandError(output, context)];
673
- }
674
- return [4, parseBody(output.body, context)];
675
- case 1:
676
- data = _a.sent();
677
- contents = {};
678
- contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
679
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
680
- return [2, Promise.resolve(response)];
681
- }
682
- });
683
- }); };
684
- var deserializeAws_json1_0ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
685
- var parsedOutput, _a, errorCode, _b, parsedBody;
686
- var _c;
687
- return __generator(this, function (_d) {
688
- switch (_d.label) {
689
- case 0:
690
- _a = [__assign({}, output)];
691
- _c = {};
692
- return [4, parseErrorBody(output.body, context)];
693
- case 1:
694
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
695
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
696
- _b = errorCode;
697
- switch (_b) {
698
- case "ResourceNotFoundException": return [3, 2];
699
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 2];
700
- case "ValidationException": return [3, 4];
701
- case "com.amazonaws.healthlake#ValidationException": return [3, 4];
702
- }
703
- return [3, 6];
704
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
705
- case 3: throw _d.sent();
706
- case 4: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
707
- case 5: throw _d.sent();
708
- case 6:
709
- parsedBody = parsedOutput.body;
710
- throwDefaultError({
711
- output: output,
712
- parsedBody: parsedBody,
713
- exceptionCtor: __BaseException,
714
- errorCode: errorCode,
715
- });
716
- _d.label = 7;
717
- case 7: return [2];
718
- }
719
- });
720
- }); };
721
- export var deserializeAws_json1_0StartFHIRExportJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
722
- var data, contents, response;
723
- return __generator(this, function (_a) {
724
- switch (_a.label) {
725
- case 0:
726
- if (output.statusCode >= 300) {
727
- return [2, deserializeAws_json1_0StartFHIRExportJobCommandError(output, context)];
728
- }
729
- return [4, parseBody(output.body, context)];
730
- case 1:
731
- data = _a.sent();
732
- contents = {};
733
- contents = deserializeAws_json1_0StartFHIRExportJobResponse(data, context);
734
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
735
- return [2, Promise.resolve(response)];
736
- }
737
- });
738
- }); };
739
- var deserializeAws_json1_0StartFHIRExportJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
740
- var parsedOutput, _a, errorCode, _b, parsedBody;
741
- var _c;
742
- return __generator(this, function (_d) {
743
- switch (_d.label) {
744
- case 0:
745
- _a = [__assign({}, output)];
746
- _c = {};
747
- return [4, parseErrorBody(output.body, context)];
748
- case 1:
749
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
750
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
- _b = errorCode;
752
- switch (_b) {
753
- case "AccessDeniedException": return [3, 2];
754
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
755
- case "InternalServerException": return [3, 4];
756
- case "com.amazonaws.healthlake#InternalServerException": return [3, 4];
757
- case "ResourceNotFoundException": return [3, 6];
758
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 6];
759
- case "ThrottlingException": return [3, 8];
760
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 8];
761
- case "ValidationException": return [3, 10];
762
- case "com.amazonaws.healthlake#ValidationException": return [3, 10];
763
- }
764
- return [3, 12];
765
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
766
- case 3: throw _d.sent();
767
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
768
- case 5: throw _d.sent();
769
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
770
- case 7: throw _d.sent();
771
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
772
- case 9: throw _d.sent();
773
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
774
- case 11: throw _d.sent();
775
- case 12:
776
- parsedBody = parsedOutput.body;
777
- throwDefaultError({
778
- output: output,
779
- parsedBody: parsedBody,
780
- exceptionCtor: __BaseException,
781
- errorCode: errorCode,
782
- });
783
- _d.label = 13;
784
- case 13: return [2];
785
- }
786
- });
787
- }); };
788
- export var deserializeAws_json1_0StartFHIRImportJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
789
- var data, contents, response;
790
- return __generator(this, function (_a) {
791
- switch (_a.label) {
792
- case 0:
793
- if (output.statusCode >= 300) {
794
- return [2, deserializeAws_json1_0StartFHIRImportJobCommandError(output, context)];
795
- }
796
- return [4, parseBody(output.body, context)];
797
- case 1:
798
- data = _a.sent();
799
- contents = {};
800
- contents = deserializeAws_json1_0StartFHIRImportJobResponse(data, context);
801
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
802
- return [2, Promise.resolve(response)];
803
- }
804
- });
805
- }); };
806
- var deserializeAws_json1_0StartFHIRImportJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
807
- var parsedOutput, _a, errorCode, _b, parsedBody;
808
- var _c;
809
- return __generator(this, function (_d) {
810
- switch (_d.label) {
811
- case 0:
812
- _a = [__assign({}, output)];
813
- _c = {};
814
- return [4, parseErrorBody(output.body, context)];
815
- case 1:
816
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
817
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
818
- _b = errorCode;
819
- switch (_b) {
820
- case "AccessDeniedException": return [3, 2];
821
- case "com.amazonaws.healthlake#AccessDeniedException": return [3, 2];
822
- case "InternalServerException": return [3, 4];
823
- case "com.amazonaws.healthlake#InternalServerException": return [3, 4];
824
- case "ResourceNotFoundException": return [3, 6];
825
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 6];
826
- case "ThrottlingException": return [3, 8];
827
- case "com.amazonaws.healthlake#ThrottlingException": return [3, 8];
828
- case "ValidationException": return [3, 10];
829
- case "com.amazonaws.healthlake#ValidationException": return [3, 10];
830
- }
831
- return [3, 12];
832
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
833
- case 3: throw _d.sent();
834
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
835
- case 5: throw _d.sent();
836
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
837
- case 7: throw _d.sent();
838
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
839
- case 9: throw _d.sent();
840
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
841
- case 11: throw _d.sent();
842
- case 12:
843
- parsedBody = parsedOutput.body;
844
- throwDefaultError({
845
- output: output,
846
- parsedBody: parsedBody,
847
- exceptionCtor: __BaseException,
848
- errorCode: errorCode,
849
- });
850
- _d.label = 13;
851
- case 13: return [2];
852
- }
853
- });
854
- }); };
855
- export var deserializeAws_json1_0TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
856
- var data, contents, response;
857
- return __generator(this, function (_a) {
858
- switch (_a.label) {
859
- case 0:
860
- if (output.statusCode >= 300) {
861
- return [2, deserializeAws_json1_0TagResourceCommandError(output, context)];
862
- }
863
- return [4, parseBody(output.body, context)];
864
- case 1:
865
- data = _a.sent();
866
- contents = {};
867
- contents = deserializeAws_json1_0TagResourceResponse(data, context);
868
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
869
- return [2, Promise.resolve(response)];
870
- }
871
- });
872
- }); };
873
- var deserializeAws_json1_0TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
874
- var parsedOutput, _a, errorCode, _b, parsedBody;
875
- var _c;
876
- return __generator(this, function (_d) {
877
- switch (_d.label) {
878
- case 0:
879
- _a = [__assign({}, output)];
880
- _c = {};
881
- return [4, parseErrorBody(output.body, context)];
882
- case 1:
883
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
884
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
885
- _b = errorCode;
886
- switch (_b) {
887
- case "ResourceNotFoundException": return [3, 2];
888
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 2];
889
- case "ValidationException": return [3, 4];
890
- case "com.amazonaws.healthlake#ValidationException": return [3, 4];
891
- }
892
- return [3, 6];
893
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
894
- case 3: throw _d.sent();
895
- case 4: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
896
- case 5: throw _d.sent();
897
- case 6:
898
- parsedBody = parsedOutput.body;
899
- throwDefaultError({
900
- output: output,
901
- parsedBody: parsedBody,
902
- exceptionCtor: __BaseException,
903
- errorCode: errorCode,
904
- });
905
- _d.label = 7;
906
- case 7: return [2];
907
- }
908
- });
909
- }); };
910
- export var deserializeAws_json1_0UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
911
- var data, contents, response;
912
- return __generator(this, function (_a) {
913
- switch (_a.label) {
914
- case 0:
915
- if (output.statusCode >= 300) {
916
- return [2, deserializeAws_json1_0UntagResourceCommandError(output, context)];
917
- }
918
- return [4, parseBody(output.body, context)];
919
- case 1:
920
- data = _a.sent();
921
- contents = {};
922
- contents = deserializeAws_json1_0UntagResourceResponse(data, context);
923
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
924
- return [2, Promise.resolve(response)];
925
- }
926
- });
927
- }); };
928
- var deserializeAws_json1_0UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
929
- var parsedOutput, _a, errorCode, _b, parsedBody;
930
- var _c;
931
- return __generator(this, function (_d) {
932
- switch (_d.label) {
933
- case 0:
934
- _a = [__assign({}, output)];
935
- _c = {};
936
- return [4, parseErrorBody(output.body, context)];
937
- case 1:
938
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
939
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
940
- _b = errorCode;
941
- switch (_b) {
942
- case "ResourceNotFoundException": return [3, 2];
943
- case "com.amazonaws.healthlake#ResourceNotFoundException": return [3, 2];
944
- case "ValidationException": return [3, 4];
945
- case "com.amazonaws.healthlake#ValidationException": return [3, 4];
946
- }
947
- return [3, 6];
948
- case 2: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
949
- case 3: throw _d.sent();
950
- case 4: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
951
- case 5: throw _d.sent();
952
- case 6:
953
- parsedBody = parsedOutput.body;
954
- throwDefaultError({
955
- output: output,
956
- parsedBody: parsedBody,
957
- exceptionCtor: __BaseException,
958
- errorCode: errorCode,
959
- });
960
- _d.label = 7;
961
- case 7: return [2];
962
- }
963
- });
964
- }); };
965
- var deserializeAws_json1_0AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
966
- var body, deserialized, exception;
967
- return __generator(this, function (_a) {
968
- body = parsedOutput.body;
969
- deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
970
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
971
- return [2, __decorateServiceException(exception, body)];
6
+ export const serializeAws_json1_0CreateFHIRDatastoreCommand = async (input, context) => {
7
+ const headers = {
8
+ "content-type": "application/x-amz-json-1.0",
9
+ "x-amz-target": "HealthLake.CreateFHIRDatastore",
10
+ };
11
+ let body;
12
+ body = JSON.stringify(serializeAws_json1_0CreateFHIRDatastoreRequest(input, context));
13
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
+ };
15
+ export const serializeAws_json1_0DeleteFHIRDatastoreCommand = async (input, context) => {
16
+ const headers = {
17
+ "content-type": "application/x-amz-json-1.0",
18
+ "x-amz-target": "HealthLake.DeleteFHIRDatastore",
19
+ };
20
+ let body;
21
+ body = JSON.stringify(serializeAws_json1_0DeleteFHIRDatastoreRequest(input, context));
22
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
+ };
24
+ export const serializeAws_json1_0DescribeFHIRDatastoreCommand = async (input, context) => {
25
+ const headers = {
26
+ "content-type": "application/x-amz-json-1.0",
27
+ "x-amz-target": "HealthLake.DescribeFHIRDatastore",
28
+ };
29
+ let body;
30
+ body = JSON.stringify(serializeAws_json1_0DescribeFHIRDatastoreRequest(input, context));
31
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
+ };
33
+ export const serializeAws_json1_0DescribeFHIRExportJobCommand = async (input, context) => {
34
+ const headers = {
35
+ "content-type": "application/x-amz-json-1.0",
36
+ "x-amz-target": "HealthLake.DescribeFHIRExportJob",
37
+ };
38
+ let body;
39
+ body = JSON.stringify(serializeAws_json1_0DescribeFHIRExportJobRequest(input, context));
40
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
+ };
42
+ export const serializeAws_json1_0DescribeFHIRImportJobCommand = async (input, context) => {
43
+ const headers = {
44
+ "content-type": "application/x-amz-json-1.0",
45
+ "x-amz-target": "HealthLake.DescribeFHIRImportJob",
46
+ };
47
+ let body;
48
+ body = JSON.stringify(serializeAws_json1_0DescribeFHIRImportJobRequest(input, context));
49
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
+ };
51
+ export const serializeAws_json1_0ListFHIRDatastoresCommand = async (input, context) => {
52
+ const headers = {
53
+ "content-type": "application/x-amz-json-1.0",
54
+ "x-amz-target": "HealthLake.ListFHIRDatastores",
55
+ };
56
+ let body;
57
+ body = JSON.stringify(serializeAws_json1_0ListFHIRDatastoresRequest(input, context));
58
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
+ };
60
+ export const serializeAws_json1_0ListFHIRExportJobsCommand = async (input, context) => {
61
+ const headers = {
62
+ "content-type": "application/x-amz-json-1.0",
63
+ "x-amz-target": "HealthLake.ListFHIRExportJobs",
64
+ };
65
+ let body;
66
+ body = JSON.stringify(serializeAws_json1_0ListFHIRExportJobsRequest(input, context));
67
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
+ };
69
+ export const serializeAws_json1_0ListFHIRImportJobsCommand = async (input, context) => {
70
+ const headers = {
71
+ "content-type": "application/x-amz-json-1.0",
72
+ "x-amz-target": "HealthLake.ListFHIRImportJobs",
73
+ };
74
+ let body;
75
+ body = JSON.stringify(serializeAws_json1_0ListFHIRImportJobsRequest(input, context));
76
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
+ };
78
+ export const serializeAws_json1_0ListTagsForResourceCommand = async (input, context) => {
79
+ const headers = {
80
+ "content-type": "application/x-amz-json-1.0",
81
+ "x-amz-target": "HealthLake.ListTagsForResource",
82
+ };
83
+ let body;
84
+ body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
85
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
+ };
87
+ export const serializeAws_json1_0StartFHIRExportJobCommand = async (input, context) => {
88
+ const headers = {
89
+ "content-type": "application/x-amz-json-1.0",
90
+ "x-amz-target": "HealthLake.StartFHIRExportJob",
91
+ };
92
+ let body;
93
+ body = JSON.stringify(serializeAws_json1_0StartFHIRExportJobRequest(input, context));
94
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
+ };
96
+ export const serializeAws_json1_0StartFHIRImportJobCommand = async (input, context) => {
97
+ const headers = {
98
+ "content-type": "application/x-amz-json-1.0",
99
+ "x-amz-target": "HealthLake.StartFHIRImportJob",
100
+ };
101
+ let body;
102
+ body = JSON.stringify(serializeAws_json1_0StartFHIRImportJobRequest(input, context));
103
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
104
+ };
105
+ export const serializeAws_json1_0TagResourceCommand = async (input, context) => {
106
+ const headers = {
107
+ "content-type": "application/x-amz-json-1.0",
108
+ "x-amz-target": "HealthLake.TagResource",
109
+ };
110
+ let body;
111
+ body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
112
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
+ };
114
+ export const serializeAws_json1_0UntagResourceCommand = async (input, context) => {
115
+ const headers = {
116
+ "content-type": "application/x-amz-json-1.0",
117
+ "x-amz-target": "HealthLake.UntagResource",
118
+ };
119
+ let body;
120
+ body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
121
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
122
+ };
123
+ export const deserializeAws_json1_0CreateFHIRDatastoreCommand = async (output, context) => {
124
+ if (output.statusCode >= 300) {
125
+ return deserializeAws_json1_0CreateFHIRDatastoreCommandError(output, context);
126
+ }
127
+ const data = await parseBody(output.body, context);
128
+ let contents = {};
129
+ contents = deserializeAws_json1_0CreateFHIRDatastoreResponse(data, context);
130
+ const response = {
131
+ $metadata: deserializeMetadata(output),
132
+ ...contents,
133
+ };
134
+ return Promise.resolve(response);
135
+ };
136
+ const deserializeAws_json1_0CreateFHIRDatastoreCommandError = async (output, context) => {
137
+ const parsedOutput = {
138
+ ...output,
139
+ body: await parseErrorBody(output.body, context),
140
+ };
141
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
142
+ switch (errorCode) {
143
+ case "AccessDeniedException":
144
+ case "com.amazonaws.healthlake#AccessDeniedException":
145
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
146
+ case "InternalServerException":
147
+ case "com.amazonaws.healthlake#InternalServerException":
148
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
149
+ case "ThrottlingException":
150
+ case "com.amazonaws.healthlake#ThrottlingException":
151
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
152
+ case "ValidationException":
153
+ case "com.amazonaws.healthlake#ValidationException":
154
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
155
+ default:
156
+ const parsedBody = parsedOutput.body;
157
+ throwDefaultError({
158
+ output,
159
+ parsedBody,
160
+ exceptionCtor: __BaseException,
161
+ errorCode,
162
+ });
163
+ }
164
+ };
165
+ export const deserializeAws_json1_0DeleteFHIRDatastoreCommand = async (output, context) => {
166
+ if (output.statusCode >= 300) {
167
+ return deserializeAws_json1_0DeleteFHIRDatastoreCommandError(output, context);
168
+ }
169
+ const data = await parseBody(output.body, context);
170
+ let contents = {};
171
+ contents = deserializeAws_json1_0DeleteFHIRDatastoreResponse(data, context);
172
+ const response = {
173
+ $metadata: deserializeMetadata(output),
174
+ ...contents,
175
+ };
176
+ return Promise.resolve(response);
177
+ };
178
+ const deserializeAws_json1_0DeleteFHIRDatastoreCommandError = async (output, context) => {
179
+ const parsedOutput = {
180
+ ...output,
181
+ body: await parseErrorBody(output.body, context),
182
+ };
183
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
184
+ switch (errorCode) {
185
+ case "AccessDeniedException":
186
+ case "com.amazonaws.healthlake#AccessDeniedException":
187
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
188
+ case "ConflictException":
189
+ case "com.amazonaws.healthlake#ConflictException":
190
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
191
+ case "InternalServerException":
192
+ case "com.amazonaws.healthlake#InternalServerException":
193
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
194
+ case "ResourceNotFoundException":
195
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
196
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
197
+ case "ThrottlingException":
198
+ case "com.amazonaws.healthlake#ThrottlingException":
199
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
200
+ case "ValidationException":
201
+ case "com.amazonaws.healthlake#ValidationException":
202
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
203
+ default:
204
+ const parsedBody = parsedOutput.body;
205
+ throwDefaultError({
206
+ output,
207
+ parsedBody,
208
+ exceptionCtor: __BaseException,
209
+ errorCode,
210
+ });
211
+ }
212
+ };
213
+ export const deserializeAws_json1_0DescribeFHIRDatastoreCommand = async (output, context) => {
214
+ if (output.statusCode >= 300) {
215
+ return deserializeAws_json1_0DescribeFHIRDatastoreCommandError(output, context);
216
+ }
217
+ const data = await parseBody(output.body, context);
218
+ let contents = {};
219
+ contents = deserializeAws_json1_0DescribeFHIRDatastoreResponse(data, context);
220
+ const response = {
221
+ $metadata: deserializeMetadata(output),
222
+ ...contents,
223
+ };
224
+ return Promise.resolve(response);
225
+ };
226
+ const deserializeAws_json1_0DescribeFHIRDatastoreCommandError = async (output, context) => {
227
+ const parsedOutput = {
228
+ ...output,
229
+ body: await parseErrorBody(output.body, context),
230
+ };
231
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
232
+ switch (errorCode) {
233
+ case "InternalServerException":
234
+ case "com.amazonaws.healthlake#InternalServerException":
235
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
236
+ case "ResourceNotFoundException":
237
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
238
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
239
+ case "ThrottlingException":
240
+ case "com.amazonaws.healthlake#ThrottlingException":
241
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
242
+ case "ValidationException":
243
+ case "com.amazonaws.healthlake#ValidationException":
244
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
245
+ default:
246
+ const parsedBody = parsedOutput.body;
247
+ throwDefaultError({
248
+ output,
249
+ parsedBody,
250
+ exceptionCtor: __BaseException,
251
+ errorCode,
252
+ });
253
+ }
254
+ };
255
+ export const deserializeAws_json1_0DescribeFHIRExportJobCommand = async (output, context) => {
256
+ if (output.statusCode >= 300) {
257
+ return deserializeAws_json1_0DescribeFHIRExportJobCommandError(output, context);
258
+ }
259
+ const data = await parseBody(output.body, context);
260
+ let contents = {};
261
+ contents = deserializeAws_json1_0DescribeFHIRExportJobResponse(data, context);
262
+ const response = {
263
+ $metadata: deserializeMetadata(output),
264
+ ...contents,
265
+ };
266
+ return Promise.resolve(response);
267
+ };
268
+ const deserializeAws_json1_0DescribeFHIRExportJobCommandError = async (output, context) => {
269
+ const parsedOutput = {
270
+ ...output,
271
+ body: await parseErrorBody(output.body, context),
272
+ };
273
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
274
+ switch (errorCode) {
275
+ case "InternalServerException":
276
+ case "com.amazonaws.healthlake#InternalServerException":
277
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
278
+ case "ResourceNotFoundException":
279
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
280
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
281
+ case "ThrottlingException":
282
+ case "com.amazonaws.healthlake#ThrottlingException":
283
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
284
+ case "ValidationException":
285
+ case "com.amazonaws.healthlake#ValidationException":
286
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
287
+ default:
288
+ const parsedBody = parsedOutput.body;
289
+ throwDefaultError({
290
+ output,
291
+ parsedBody,
292
+ exceptionCtor: __BaseException,
293
+ errorCode,
294
+ });
295
+ }
296
+ };
297
+ export const deserializeAws_json1_0DescribeFHIRImportJobCommand = async (output, context) => {
298
+ if (output.statusCode >= 300) {
299
+ return deserializeAws_json1_0DescribeFHIRImportJobCommandError(output, context);
300
+ }
301
+ const data = await parseBody(output.body, context);
302
+ let contents = {};
303
+ contents = deserializeAws_json1_0DescribeFHIRImportJobResponse(data, context);
304
+ const response = {
305
+ $metadata: deserializeMetadata(output),
306
+ ...contents,
307
+ };
308
+ return Promise.resolve(response);
309
+ };
310
+ const deserializeAws_json1_0DescribeFHIRImportJobCommandError = async (output, context) => {
311
+ const parsedOutput = {
312
+ ...output,
313
+ body: await parseErrorBody(output.body, context),
314
+ };
315
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
316
+ switch (errorCode) {
317
+ case "InternalServerException":
318
+ case "com.amazonaws.healthlake#InternalServerException":
319
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
320
+ case "ResourceNotFoundException":
321
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
322
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
323
+ case "ThrottlingException":
324
+ case "com.amazonaws.healthlake#ThrottlingException":
325
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
326
+ case "ValidationException":
327
+ case "com.amazonaws.healthlake#ValidationException":
328
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
329
+ default:
330
+ const parsedBody = parsedOutput.body;
331
+ throwDefaultError({
332
+ output,
333
+ parsedBody,
334
+ exceptionCtor: __BaseException,
335
+ errorCode,
336
+ });
337
+ }
338
+ };
339
+ export const deserializeAws_json1_0ListFHIRDatastoresCommand = async (output, context) => {
340
+ if (output.statusCode >= 300) {
341
+ return deserializeAws_json1_0ListFHIRDatastoresCommandError(output, context);
342
+ }
343
+ const data = await parseBody(output.body, context);
344
+ let contents = {};
345
+ contents = deserializeAws_json1_0ListFHIRDatastoresResponse(data, context);
346
+ const response = {
347
+ $metadata: deserializeMetadata(output),
348
+ ...contents,
349
+ };
350
+ return Promise.resolve(response);
351
+ };
352
+ const deserializeAws_json1_0ListFHIRDatastoresCommandError = async (output, context) => {
353
+ const parsedOutput = {
354
+ ...output,
355
+ body: await parseErrorBody(output.body, context),
356
+ };
357
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
358
+ switch (errorCode) {
359
+ case "InternalServerException":
360
+ case "com.amazonaws.healthlake#InternalServerException":
361
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
362
+ case "ThrottlingException":
363
+ case "com.amazonaws.healthlake#ThrottlingException":
364
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
365
+ case "ValidationException":
366
+ case "com.amazonaws.healthlake#ValidationException":
367
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
368
+ default:
369
+ const parsedBody = parsedOutput.body;
370
+ throwDefaultError({
371
+ output,
372
+ parsedBody,
373
+ exceptionCtor: __BaseException,
374
+ errorCode,
375
+ });
376
+ }
377
+ };
378
+ export const deserializeAws_json1_0ListFHIRExportJobsCommand = async (output, context) => {
379
+ if (output.statusCode >= 300) {
380
+ return deserializeAws_json1_0ListFHIRExportJobsCommandError(output, context);
381
+ }
382
+ const data = await parseBody(output.body, context);
383
+ let contents = {};
384
+ contents = deserializeAws_json1_0ListFHIRExportJobsResponse(data, context);
385
+ const response = {
386
+ $metadata: deserializeMetadata(output),
387
+ ...contents,
388
+ };
389
+ return Promise.resolve(response);
390
+ };
391
+ const deserializeAws_json1_0ListFHIRExportJobsCommandError = async (output, context) => {
392
+ const parsedOutput = {
393
+ ...output,
394
+ body: await parseErrorBody(output.body, context),
395
+ };
396
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
397
+ switch (errorCode) {
398
+ case "AccessDeniedException":
399
+ case "com.amazonaws.healthlake#AccessDeniedException":
400
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
401
+ case "InternalServerException":
402
+ case "com.amazonaws.healthlake#InternalServerException":
403
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
404
+ case "ResourceNotFoundException":
405
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
406
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
407
+ case "ThrottlingException":
408
+ case "com.amazonaws.healthlake#ThrottlingException":
409
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
410
+ case "ValidationException":
411
+ case "com.amazonaws.healthlake#ValidationException":
412
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
413
+ default:
414
+ const parsedBody = parsedOutput.body;
415
+ throwDefaultError({
416
+ output,
417
+ parsedBody,
418
+ exceptionCtor: __BaseException,
419
+ errorCode,
420
+ });
421
+ }
422
+ };
423
+ export const deserializeAws_json1_0ListFHIRImportJobsCommand = async (output, context) => {
424
+ if (output.statusCode >= 300) {
425
+ return deserializeAws_json1_0ListFHIRImportJobsCommandError(output, context);
426
+ }
427
+ const data = await parseBody(output.body, context);
428
+ let contents = {};
429
+ contents = deserializeAws_json1_0ListFHIRImportJobsResponse(data, context);
430
+ const response = {
431
+ $metadata: deserializeMetadata(output),
432
+ ...contents,
433
+ };
434
+ return Promise.resolve(response);
435
+ };
436
+ const deserializeAws_json1_0ListFHIRImportJobsCommandError = async (output, context) => {
437
+ const parsedOutput = {
438
+ ...output,
439
+ body: await parseErrorBody(output.body, context),
440
+ };
441
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
+ switch (errorCode) {
443
+ case "AccessDeniedException":
444
+ case "com.amazonaws.healthlake#AccessDeniedException":
445
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
446
+ case "InternalServerException":
447
+ case "com.amazonaws.healthlake#InternalServerException":
448
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
449
+ case "ResourceNotFoundException":
450
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
451
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
452
+ case "ThrottlingException":
453
+ case "com.amazonaws.healthlake#ThrottlingException":
454
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
455
+ case "ValidationException":
456
+ case "com.amazonaws.healthlake#ValidationException":
457
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
458
+ default:
459
+ const parsedBody = parsedOutput.body;
460
+ throwDefaultError({
461
+ output,
462
+ parsedBody,
463
+ exceptionCtor: __BaseException,
464
+ errorCode,
465
+ });
466
+ }
467
+ };
468
+ export const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
469
+ if (output.statusCode >= 300) {
470
+ return deserializeAws_json1_0ListTagsForResourceCommandError(output, context);
471
+ }
472
+ const data = await parseBody(output.body, context);
473
+ let contents = {};
474
+ contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
475
+ const response = {
476
+ $metadata: deserializeMetadata(output),
477
+ ...contents,
478
+ };
479
+ return Promise.resolve(response);
480
+ };
481
+ const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, context) => {
482
+ const parsedOutput = {
483
+ ...output,
484
+ body: await parseErrorBody(output.body, context),
485
+ };
486
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
487
+ switch (errorCode) {
488
+ case "ResourceNotFoundException":
489
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
490
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
491
+ case "ValidationException":
492
+ case "com.amazonaws.healthlake#ValidationException":
493
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
494
+ default:
495
+ const parsedBody = parsedOutput.body;
496
+ throwDefaultError({
497
+ output,
498
+ parsedBody,
499
+ exceptionCtor: __BaseException,
500
+ errorCode,
501
+ });
502
+ }
503
+ };
504
+ export const deserializeAws_json1_0StartFHIRExportJobCommand = async (output, context) => {
505
+ if (output.statusCode >= 300) {
506
+ return deserializeAws_json1_0StartFHIRExportJobCommandError(output, context);
507
+ }
508
+ const data = await parseBody(output.body, context);
509
+ let contents = {};
510
+ contents = deserializeAws_json1_0StartFHIRExportJobResponse(data, context);
511
+ const response = {
512
+ $metadata: deserializeMetadata(output),
513
+ ...contents,
514
+ };
515
+ return Promise.resolve(response);
516
+ };
517
+ const deserializeAws_json1_0StartFHIRExportJobCommandError = async (output, context) => {
518
+ const parsedOutput = {
519
+ ...output,
520
+ body: await parseErrorBody(output.body, context),
521
+ };
522
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
523
+ switch (errorCode) {
524
+ case "AccessDeniedException":
525
+ case "com.amazonaws.healthlake#AccessDeniedException":
526
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
527
+ case "InternalServerException":
528
+ case "com.amazonaws.healthlake#InternalServerException":
529
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
530
+ case "ResourceNotFoundException":
531
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
532
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
533
+ case "ThrottlingException":
534
+ case "com.amazonaws.healthlake#ThrottlingException":
535
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
536
+ case "ValidationException":
537
+ case "com.amazonaws.healthlake#ValidationException":
538
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
539
+ default:
540
+ const parsedBody = parsedOutput.body;
541
+ throwDefaultError({
542
+ output,
543
+ parsedBody,
544
+ exceptionCtor: __BaseException,
545
+ errorCode,
546
+ });
547
+ }
548
+ };
549
+ export const deserializeAws_json1_0StartFHIRImportJobCommand = async (output, context) => {
550
+ if (output.statusCode >= 300) {
551
+ return deserializeAws_json1_0StartFHIRImportJobCommandError(output, context);
552
+ }
553
+ const data = await parseBody(output.body, context);
554
+ let contents = {};
555
+ contents = deserializeAws_json1_0StartFHIRImportJobResponse(data, context);
556
+ const response = {
557
+ $metadata: deserializeMetadata(output),
558
+ ...contents,
559
+ };
560
+ return Promise.resolve(response);
561
+ };
562
+ const deserializeAws_json1_0StartFHIRImportJobCommandError = async (output, context) => {
563
+ const parsedOutput = {
564
+ ...output,
565
+ body: await parseErrorBody(output.body, context),
566
+ };
567
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
568
+ switch (errorCode) {
569
+ case "AccessDeniedException":
570
+ case "com.amazonaws.healthlake#AccessDeniedException":
571
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
572
+ case "InternalServerException":
573
+ case "com.amazonaws.healthlake#InternalServerException":
574
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
575
+ case "ResourceNotFoundException":
576
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
577
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
578
+ case "ThrottlingException":
579
+ case "com.amazonaws.healthlake#ThrottlingException":
580
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
581
+ case "ValidationException":
582
+ case "com.amazonaws.healthlake#ValidationException":
583
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
584
+ default:
585
+ const parsedBody = parsedOutput.body;
586
+ throwDefaultError({
587
+ output,
588
+ parsedBody,
589
+ exceptionCtor: __BaseException,
590
+ errorCode,
591
+ });
592
+ }
593
+ };
594
+ export const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
595
+ if (output.statusCode >= 300) {
596
+ return deserializeAws_json1_0TagResourceCommandError(output, context);
597
+ }
598
+ const data = await parseBody(output.body, context);
599
+ let contents = {};
600
+ contents = deserializeAws_json1_0TagResourceResponse(data, context);
601
+ const response = {
602
+ $metadata: deserializeMetadata(output),
603
+ ...contents,
604
+ };
605
+ return Promise.resolve(response);
606
+ };
607
+ const deserializeAws_json1_0TagResourceCommandError = async (output, context) => {
608
+ const parsedOutput = {
609
+ ...output,
610
+ body: await parseErrorBody(output.body, context),
611
+ };
612
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
613
+ switch (errorCode) {
614
+ case "ResourceNotFoundException":
615
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
616
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
617
+ case "ValidationException":
618
+ case "com.amazonaws.healthlake#ValidationException":
619
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
620
+ default:
621
+ const parsedBody = parsedOutput.body;
622
+ throwDefaultError({
623
+ output,
624
+ parsedBody,
625
+ exceptionCtor: __BaseException,
626
+ errorCode,
627
+ });
628
+ }
629
+ };
630
+ export const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
631
+ if (output.statusCode >= 300) {
632
+ return deserializeAws_json1_0UntagResourceCommandError(output, context);
633
+ }
634
+ const data = await parseBody(output.body, context);
635
+ let contents = {};
636
+ contents = deserializeAws_json1_0UntagResourceResponse(data, context);
637
+ const response = {
638
+ $metadata: deserializeMetadata(output),
639
+ ...contents,
640
+ };
641
+ return Promise.resolve(response);
642
+ };
643
+ const deserializeAws_json1_0UntagResourceCommandError = async (output, context) => {
644
+ const parsedOutput = {
645
+ ...output,
646
+ body: await parseErrorBody(output.body, context),
647
+ };
648
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
649
+ switch (errorCode) {
650
+ case "ResourceNotFoundException":
651
+ case "com.amazonaws.healthlake#ResourceNotFoundException":
652
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
653
+ case "ValidationException":
654
+ case "com.amazonaws.healthlake#ValidationException":
655
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
656
+ default:
657
+ const parsedBody = parsedOutput.body;
658
+ throwDefaultError({
659
+ output,
660
+ parsedBody,
661
+ exceptionCtor: __BaseException,
662
+ errorCode,
663
+ });
664
+ }
665
+ };
666
+ const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
667
+ const body = parsedOutput.body;
668
+ const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
669
+ const exception = new AccessDeniedException({
670
+ $metadata: deserializeMetadata(parsedOutput),
671
+ ...deserialized,
972
672
  });
973
- }); };
974
- var deserializeAws_json1_0ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
975
- var body, deserialized, exception;
976
- return __generator(this, function (_a) {
977
- body = parsedOutput.body;
978
- deserialized = deserializeAws_json1_0ConflictException(body, context);
979
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
980
- return [2, __decorateServiceException(exception, body)];
673
+ return __decorateServiceException(exception, body);
674
+ };
675
+ const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
676
+ const body = parsedOutput.body;
677
+ const deserialized = deserializeAws_json1_0ConflictException(body, context);
678
+ const exception = new ConflictException({
679
+ $metadata: deserializeMetadata(parsedOutput),
680
+ ...deserialized,
981
681
  });
982
- }); };
983
- var deserializeAws_json1_0InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
984
- var body, deserialized, exception;
985
- return __generator(this, function (_a) {
986
- body = parsedOutput.body;
987
- deserialized = deserializeAws_json1_0InternalServerException(body, context);
988
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
989
- return [2, __decorateServiceException(exception, body)];
682
+ return __decorateServiceException(exception, body);
683
+ };
684
+ const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
685
+ const body = parsedOutput.body;
686
+ const deserialized = deserializeAws_json1_0InternalServerException(body, context);
687
+ const exception = new InternalServerException({
688
+ $metadata: deserializeMetadata(parsedOutput),
689
+ ...deserialized,
990
690
  });
991
- }); };
992
- var deserializeAws_json1_0ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
993
- var body, deserialized, exception;
994
- return __generator(this, function (_a) {
995
- body = parsedOutput.body;
996
- deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
997
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
998
- return [2, __decorateServiceException(exception, body)];
691
+ return __decorateServiceException(exception, body);
692
+ };
693
+ const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
694
+ const body = parsedOutput.body;
695
+ const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
696
+ const exception = new ResourceNotFoundException({
697
+ $metadata: deserializeMetadata(parsedOutput),
698
+ ...deserialized,
999
699
  });
1000
- }); };
1001
- var deserializeAws_json1_0ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1002
- var body, deserialized, exception;
1003
- return __generator(this, function (_a) {
1004
- body = parsedOutput.body;
1005
- deserialized = deserializeAws_json1_0ThrottlingException(body, context);
1006
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1007
- return [2, __decorateServiceException(exception, body)];
700
+ return __decorateServiceException(exception, body);
701
+ };
702
+ const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
703
+ const body = parsedOutput.body;
704
+ const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
705
+ const exception = new ThrottlingException({
706
+ $metadata: deserializeMetadata(parsedOutput),
707
+ ...deserialized,
1008
708
  });
1009
- }); };
1010
- var deserializeAws_json1_0ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1011
- var body, deserialized, exception;
1012
- return __generator(this, function (_a) {
1013
- body = parsedOutput.body;
1014
- deserialized = deserializeAws_json1_0ValidationException(body, context);
1015
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1016
- return [2, __decorateServiceException(exception, body)];
709
+ return __decorateServiceException(exception, body);
710
+ };
711
+ const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
712
+ const body = parsedOutput.body;
713
+ const deserialized = deserializeAws_json1_0ValidationException(body, context);
714
+ const exception = new ValidationException({
715
+ $metadata: deserializeMetadata(parsedOutput),
716
+ ...deserialized,
1017
717
  });
1018
- }); };
1019
- var serializeAws_json1_0CreateFHIRDatastoreRequest = function (input, context) {
1020
- var _a;
1021
- return __assign(__assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.DatastoreName != null && { DatastoreName: input.DatastoreName })), (input.DatastoreTypeVersion != null && { DatastoreTypeVersion: input.DatastoreTypeVersion })), (input.PreloadDataConfig != null && {
1022
- PreloadDataConfig: serializeAws_json1_0PreloadDataConfig(input.PreloadDataConfig, context),
1023
- })), (input.SseConfiguration != null && {
1024
- SseConfiguration: serializeAws_json1_0SseConfiguration(input.SseConfiguration, context),
1025
- })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
718
+ return __decorateServiceException(exception, body);
1026
719
  };
1027
- var serializeAws_json1_0DatastoreFilter = function (input, context) {
1028
- return __assign(__assign(__assign(__assign({}, (input.CreatedAfter != null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) })), (input.CreatedBefore != null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) })), (input.DatastoreName != null && { DatastoreName: input.DatastoreName })), (input.DatastoreStatus != null && { DatastoreStatus: input.DatastoreStatus }));
720
+ const serializeAws_json1_0CreateFHIRDatastoreRequest = (input, context) => {
721
+ return {
722
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
723
+ ...(input.DatastoreName != null && { DatastoreName: input.DatastoreName }),
724
+ ...(input.DatastoreTypeVersion != null && { DatastoreTypeVersion: input.DatastoreTypeVersion }),
725
+ ...(input.PreloadDataConfig != null && {
726
+ PreloadDataConfig: serializeAws_json1_0PreloadDataConfig(input.PreloadDataConfig, context),
727
+ }),
728
+ ...(input.SseConfiguration != null && {
729
+ SseConfiguration: serializeAws_json1_0SseConfiguration(input.SseConfiguration, context),
730
+ }),
731
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
732
+ };
1029
733
  };
1030
- var serializeAws_json1_0DeleteFHIRDatastoreRequest = function (input, context) {
1031
- return __assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId }));
734
+ const serializeAws_json1_0DatastoreFilter = (input, context) => {
735
+ return {
736
+ ...(input.CreatedAfter != null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }),
737
+ ...(input.CreatedBefore != null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }),
738
+ ...(input.DatastoreName != null && { DatastoreName: input.DatastoreName }),
739
+ ...(input.DatastoreStatus != null && { DatastoreStatus: input.DatastoreStatus }),
740
+ };
1032
741
  };
1033
- var serializeAws_json1_0DescribeFHIRDatastoreRequest = function (input, context) {
1034
- return __assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId }));
742
+ const serializeAws_json1_0DeleteFHIRDatastoreRequest = (input, context) => {
743
+ return {
744
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
745
+ };
746
+ };
747
+ const serializeAws_json1_0DescribeFHIRDatastoreRequest = (input, context) => {
748
+ return {
749
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
750
+ };
1035
751
  };
1036
- var serializeAws_json1_0DescribeFHIRExportJobRequest = function (input, context) {
1037
- return __assign(__assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.JobId != null && { JobId: input.JobId }));
752
+ const serializeAws_json1_0DescribeFHIRExportJobRequest = (input, context) => {
753
+ return {
754
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
755
+ ...(input.JobId != null && { JobId: input.JobId }),
756
+ };
1038
757
  };
1039
- var serializeAws_json1_0DescribeFHIRImportJobRequest = function (input, context) {
1040
- return __assign(__assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.JobId != null && { JobId: input.JobId }));
758
+ const serializeAws_json1_0DescribeFHIRImportJobRequest = (input, context) => {
759
+ return {
760
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
761
+ ...(input.JobId != null && { JobId: input.JobId }),
762
+ };
1041
763
  };
1042
- var serializeAws_json1_0InputDataConfig = function (input, context) {
764
+ const serializeAws_json1_0InputDataConfig = (input, context) => {
1043
765
  return InputDataConfig.visit(input, {
1044
- S3Uri: function (value) { return ({ S3Uri: value }); },
1045
- _: function (name, value) { return ({ name: value }); },
766
+ S3Uri: (value) => ({ S3Uri: value }),
767
+ _: (name, value) => ({ name: value }),
1046
768
  });
1047
769
  };
1048
- var serializeAws_json1_0KmsEncryptionConfig = function (input, context) {
1049
- return __assign(__assign({}, (input.CmkType != null && { CmkType: input.CmkType })), (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }));
770
+ const serializeAws_json1_0KmsEncryptionConfig = (input, context) => {
771
+ return {
772
+ ...(input.CmkType != null && { CmkType: input.CmkType }),
773
+ ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
774
+ };
1050
775
  };
1051
- var serializeAws_json1_0ListFHIRDatastoresRequest = function (input, context) {
1052
- return __assign(__assign(__assign({}, (input.Filter != null && { Filter: serializeAws_json1_0DatastoreFilter(input.Filter, context) })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
776
+ const serializeAws_json1_0ListFHIRDatastoresRequest = (input, context) => {
777
+ return {
778
+ ...(input.Filter != null && { Filter: serializeAws_json1_0DatastoreFilter(input.Filter, context) }),
779
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
780
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
781
+ };
1053
782
  };
1054
- var serializeAws_json1_0ListFHIRExportJobsRequest = function (input, context) {
1055
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.JobName != null && { JobName: input.JobName })), (input.JobStatus != null && { JobStatus: input.JobStatus })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SubmittedAfter != null && { SubmittedAfter: Math.round(input.SubmittedAfter.getTime() / 1000) })), (input.SubmittedBefore != null && { SubmittedBefore: Math.round(input.SubmittedBefore.getTime() / 1000) }));
783
+ const serializeAws_json1_0ListFHIRExportJobsRequest = (input, context) => {
784
+ return {
785
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
786
+ ...(input.JobName != null && { JobName: input.JobName }),
787
+ ...(input.JobStatus != null && { JobStatus: input.JobStatus }),
788
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
789
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
790
+ ...(input.SubmittedAfter != null && { SubmittedAfter: Math.round(input.SubmittedAfter.getTime() / 1000) }),
791
+ ...(input.SubmittedBefore != null && { SubmittedBefore: Math.round(input.SubmittedBefore.getTime() / 1000) }),
792
+ };
1056
793
  };
1057
- var serializeAws_json1_0ListFHIRImportJobsRequest = function (input, context) {
1058
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.JobName != null && { JobName: input.JobName })), (input.JobStatus != null && { JobStatus: input.JobStatus })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SubmittedAfter != null && { SubmittedAfter: Math.round(input.SubmittedAfter.getTime() / 1000) })), (input.SubmittedBefore != null && { SubmittedBefore: Math.round(input.SubmittedBefore.getTime() / 1000) }));
794
+ const serializeAws_json1_0ListFHIRImportJobsRequest = (input, context) => {
795
+ return {
796
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
797
+ ...(input.JobName != null && { JobName: input.JobName }),
798
+ ...(input.JobStatus != null && { JobStatus: input.JobStatus }),
799
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
800
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
801
+ ...(input.SubmittedAfter != null && { SubmittedAfter: Math.round(input.SubmittedAfter.getTime() / 1000) }),
802
+ ...(input.SubmittedBefore != null && { SubmittedBefore: Math.round(input.SubmittedBefore.getTime() / 1000) }),
803
+ };
1059
804
  };
1060
- var serializeAws_json1_0ListTagsForResourceRequest = function (input, context) {
1061
- return __assign({}, (input.ResourceARN != null && { ResourceARN: input.ResourceARN }));
805
+ const serializeAws_json1_0ListTagsForResourceRequest = (input, context) => {
806
+ return {
807
+ ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
808
+ };
1062
809
  };
1063
- var serializeAws_json1_0OutputDataConfig = function (input, context) {
810
+ const serializeAws_json1_0OutputDataConfig = (input, context) => {
1064
811
  return OutputDataConfig.visit(input, {
1065
- S3Configuration: function (value) { return ({ S3Configuration: serializeAws_json1_0S3Configuration(value, context) }); },
1066
- _: function (name, value) { return ({ name: value }); },
812
+ S3Configuration: (value) => ({ S3Configuration: serializeAws_json1_0S3Configuration(value, context) }),
813
+ _: (name, value) => ({ name: value }),
1067
814
  });
1068
815
  };
1069
- var serializeAws_json1_0PreloadDataConfig = function (input, context) {
1070
- return __assign({}, (input.PreloadDataType != null && { PreloadDataType: input.PreloadDataType }));
816
+ const serializeAws_json1_0PreloadDataConfig = (input, context) => {
817
+ return {
818
+ ...(input.PreloadDataType != null && { PreloadDataType: input.PreloadDataType }),
819
+ };
1071
820
  };
1072
- var serializeAws_json1_0S3Configuration = function (input, context) {
1073
- return __assign(__assign({}, (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId })), (input.S3Uri != null && { S3Uri: input.S3Uri }));
821
+ const serializeAws_json1_0S3Configuration = (input, context) => {
822
+ return {
823
+ ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
824
+ ...(input.S3Uri != null && { S3Uri: input.S3Uri }),
825
+ };
1074
826
  };
1075
- var serializeAws_json1_0SseConfiguration = function (input, context) {
1076
- return __assign({}, (input.KmsEncryptionConfig != null && {
1077
- KmsEncryptionConfig: serializeAws_json1_0KmsEncryptionConfig(input.KmsEncryptionConfig, context),
1078
- }));
827
+ const serializeAws_json1_0SseConfiguration = (input, context) => {
828
+ return {
829
+ ...(input.KmsEncryptionConfig != null && {
830
+ KmsEncryptionConfig: serializeAws_json1_0KmsEncryptionConfig(input.KmsEncryptionConfig, context),
831
+ }),
832
+ };
1079
833
  };
1080
- var serializeAws_json1_0StartFHIRExportJobRequest = function (input, context) {
1081
- var _a;
1082
- return __assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn })), (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.JobName != null && { JobName: input.JobName })), (input.OutputDataConfig != null && {
1083
- OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
1084
- }));
834
+ const serializeAws_json1_0StartFHIRExportJobRequest = (input, context) => {
835
+ return {
836
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
837
+ ...(input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn }),
838
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
839
+ ...(input.JobName != null && { JobName: input.JobName }),
840
+ ...(input.OutputDataConfig != null && {
841
+ OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
842
+ }),
843
+ };
1085
844
  };
1086
- var serializeAws_json1_0StartFHIRImportJobRequest = function (input, context) {
1087
- var _a;
1088
- return __assign(__assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn })), (input.DatastoreId != null && { DatastoreId: input.DatastoreId })), (input.InputDataConfig != null && {
1089
- InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
1090
- })), (input.JobName != null && { JobName: input.JobName })), (input.JobOutputDataConfig != null && {
1091
- JobOutputDataConfig: serializeAws_json1_0OutputDataConfig(input.JobOutputDataConfig, context),
1092
- }));
845
+ const serializeAws_json1_0StartFHIRImportJobRequest = (input, context) => {
846
+ return {
847
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
848
+ ...(input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn }),
849
+ ...(input.DatastoreId != null && { DatastoreId: input.DatastoreId }),
850
+ ...(input.InputDataConfig != null && {
851
+ InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
852
+ }),
853
+ ...(input.JobName != null && { JobName: input.JobName }),
854
+ ...(input.JobOutputDataConfig != null && {
855
+ JobOutputDataConfig: serializeAws_json1_0OutputDataConfig(input.JobOutputDataConfig, context),
856
+ }),
857
+ };
1093
858
  };
1094
- var serializeAws_json1_0Tag = function (input, context) {
1095
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
859
+ const serializeAws_json1_0Tag = (input, context) => {
860
+ return {
861
+ ...(input.Key != null && { Key: input.Key }),
862
+ ...(input.Value != null && { Value: input.Value }),
863
+ };
1096
864
  };
1097
- var serializeAws_json1_0TagKeyList = function (input, context) {
865
+ const serializeAws_json1_0TagKeyList = (input, context) => {
1098
866
  return input
1099
- .filter(function (e) { return e != null; })
1100
- .map(function (entry) {
867
+ .filter((e) => e != null)
868
+ .map((entry) => {
1101
869
  return entry;
1102
870
  });
1103
871
  };
1104
- var serializeAws_json1_0TagList = function (input, context) {
872
+ const serializeAws_json1_0TagList = (input, context) => {
1105
873
  return input
1106
- .filter(function (e) { return e != null; })
1107
- .map(function (entry) {
874
+ .filter((e) => e != null)
875
+ .map((entry) => {
1108
876
  return serializeAws_json1_0Tag(entry, context);
1109
877
  });
1110
878
  };
1111
- var serializeAws_json1_0TagResourceRequest = function (input, context) {
1112
- return __assign(__assign({}, (input.ResourceARN != null && { ResourceARN: input.ResourceARN })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
879
+ const serializeAws_json1_0TagResourceRequest = (input, context) => {
880
+ return {
881
+ ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
882
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
883
+ };
1113
884
  };
1114
- var serializeAws_json1_0UntagResourceRequest = function (input, context) {
1115
- return __assign(__assign({}, (input.ResourceARN != null && { ResourceARN: input.ResourceARN })), (input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }));
885
+ const serializeAws_json1_0UntagResourceRequest = (input, context) => {
886
+ return {
887
+ ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
888
+ ...(input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }),
889
+ };
1116
890
  };
1117
- var deserializeAws_json1_0AccessDeniedException = function (output, context) {
891
+ const deserializeAws_json1_0AccessDeniedException = (output, context) => {
1118
892
  return {
1119
893
  Message: __expectString(output.Message),
1120
894
  };
1121
895
  };
1122
- var deserializeAws_json1_0ConflictException = function (output, context) {
896
+ const deserializeAws_json1_0ConflictException = (output, context) => {
1123
897
  return {
1124
898
  Message: __expectString(output.Message),
1125
899
  };
1126
900
  };
1127
- var deserializeAws_json1_0CreateFHIRDatastoreResponse = function (output, context) {
901
+ const deserializeAws_json1_0CreateFHIRDatastoreResponse = (output, context) => {
1128
902
  return {
1129
903
  DatastoreArn: __expectString(output.DatastoreArn),
1130
904
  DatastoreEndpoint: __expectString(output.DatastoreEndpoint),
@@ -1132,7 +906,7 @@ var deserializeAws_json1_0CreateFHIRDatastoreResponse = function (output, contex
1132
906
  DatastoreStatus: __expectString(output.DatastoreStatus),
1133
907
  };
1134
908
  };
1135
- var deserializeAws_json1_0DatastoreProperties = function (output, context) {
909
+ const deserializeAws_json1_0DatastoreProperties = (output, context) => {
1136
910
  return {
1137
911
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
1138
912
  DatastoreArn: __expectString(output.DatastoreArn),
@@ -1149,10 +923,10 @@ var deserializeAws_json1_0DatastoreProperties = function (output, context) {
1149
923
  : undefined,
1150
924
  };
1151
925
  };
1152
- var deserializeAws_json1_0DatastorePropertiesList = function (output, context) {
1153
- var retVal = (output || [])
1154
- .filter(function (e) { return e != null; })
1155
- .map(function (entry) {
926
+ const deserializeAws_json1_0DatastorePropertiesList = (output, context) => {
927
+ const retVal = (output || [])
928
+ .filter((e) => e != null)
929
+ .map((entry) => {
1156
930
  if (entry === null) {
1157
931
  return null;
1158
932
  }
@@ -1160,7 +934,7 @@ var deserializeAws_json1_0DatastorePropertiesList = function (output, context) {
1160
934
  });
1161
935
  return retVal;
1162
936
  };
1163
- var deserializeAws_json1_0DeleteFHIRDatastoreResponse = function (output, context) {
937
+ const deserializeAws_json1_0DeleteFHIRDatastoreResponse = (output, context) => {
1164
938
  return {
1165
939
  DatastoreArn: __expectString(output.DatastoreArn),
1166
940
  DatastoreEndpoint: __expectString(output.DatastoreEndpoint),
@@ -1168,28 +942,28 @@ var deserializeAws_json1_0DeleteFHIRDatastoreResponse = function (output, contex
1168
942
  DatastoreStatus: __expectString(output.DatastoreStatus),
1169
943
  };
1170
944
  };
1171
- var deserializeAws_json1_0DescribeFHIRDatastoreResponse = function (output, context) {
945
+ const deserializeAws_json1_0DescribeFHIRDatastoreResponse = (output, context) => {
1172
946
  return {
1173
947
  DatastoreProperties: output.DatastoreProperties != null
1174
948
  ? deserializeAws_json1_0DatastoreProperties(output.DatastoreProperties, context)
1175
949
  : undefined,
1176
950
  };
1177
951
  };
1178
- var deserializeAws_json1_0DescribeFHIRExportJobResponse = function (output, context) {
952
+ const deserializeAws_json1_0DescribeFHIRExportJobResponse = (output, context) => {
1179
953
  return {
1180
954
  ExportJobProperties: output.ExportJobProperties != null
1181
955
  ? deserializeAws_json1_0ExportJobProperties(output.ExportJobProperties, context)
1182
956
  : undefined,
1183
957
  };
1184
958
  };
1185
- var deserializeAws_json1_0DescribeFHIRImportJobResponse = function (output, context) {
959
+ const deserializeAws_json1_0DescribeFHIRImportJobResponse = (output, context) => {
1186
960
  return {
1187
961
  ImportJobProperties: output.ImportJobProperties != null
1188
962
  ? deserializeAws_json1_0ImportJobProperties(output.ImportJobProperties, context)
1189
963
  : undefined,
1190
964
  };
1191
965
  };
1192
- var deserializeAws_json1_0ExportJobProperties = function (output, context) {
966
+ const deserializeAws_json1_0ExportJobProperties = (output, context) => {
1193
967
  return {
1194
968
  DataAccessRoleArn: __expectString(output.DataAccessRoleArn),
1195
969
  DatastoreId: __expectString(output.DatastoreId),
@@ -1204,10 +978,10 @@ var deserializeAws_json1_0ExportJobProperties = function (output, context) {
1204
978
  SubmitTime: output.SubmitTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.SubmitTime))) : undefined,
1205
979
  };
1206
980
  };
1207
- var deserializeAws_json1_0ExportJobPropertiesList = function (output, context) {
1208
- var retVal = (output || [])
1209
- .filter(function (e) { return e != null; })
1210
- .map(function (entry) {
981
+ const deserializeAws_json1_0ExportJobPropertiesList = (output, context) => {
982
+ const retVal = (output || [])
983
+ .filter((e) => e != null)
984
+ .map((entry) => {
1211
985
  if (entry === null) {
1212
986
  return null;
1213
987
  }
@@ -1215,7 +989,7 @@ var deserializeAws_json1_0ExportJobPropertiesList = function (output, context) {
1215
989
  });
1216
990
  return retVal;
1217
991
  };
1218
- var deserializeAws_json1_0ImportJobProperties = function (output, context) {
992
+ const deserializeAws_json1_0ImportJobProperties = (output, context) => {
1219
993
  return {
1220
994
  DataAccessRoleArn: __expectString(output.DataAccessRoleArn),
1221
995
  DatastoreId: __expectString(output.DatastoreId),
@@ -1233,10 +1007,10 @@ var deserializeAws_json1_0ImportJobProperties = function (output, context) {
1233
1007
  SubmitTime: output.SubmitTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.SubmitTime))) : undefined,
1234
1008
  };
1235
1009
  };
1236
- var deserializeAws_json1_0ImportJobPropertiesList = function (output, context) {
1237
- var retVal = (output || [])
1238
- .filter(function (e) { return e != null; })
1239
- .map(function (entry) {
1010
+ const deserializeAws_json1_0ImportJobPropertiesList = (output, context) => {
1011
+ const retVal = (output || [])
1012
+ .filter((e) => e != null)
1013
+ .map((entry) => {
1240
1014
  if (entry === null) {
1241
1015
  return null;
1242
1016
  }
@@ -1244,24 +1018,24 @@ var deserializeAws_json1_0ImportJobPropertiesList = function (output, context) {
1244
1018
  });
1245
1019
  return retVal;
1246
1020
  };
1247
- var deserializeAws_json1_0InputDataConfig = function (output, context) {
1021
+ const deserializeAws_json1_0InputDataConfig = (output, context) => {
1248
1022
  if (__expectString(output.S3Uri) !== undefined) {
1249
1023
  return { S3Uri: __expectString(output.S3Uri) };
1250
1024
  }
1251
1025
  return { $unknown: Object.entries(output)[0] };
1252
1026
  };
1253
- var deserializeAws_json1_0InternalServerException = function (output, context) {
1027
+ const deserializeAws_json1_0InternalServerException = (output, context) => {
1254
1028
  return {
1255
1029
  Message: __expectString(output.Message),
1256
1030
  };
1257
1031
  };
1258
- var deserializeAws_json1_0KmsEncryptionConfig = function (output, context) {
1032
+ const deserializeAws_json1_0KmsEncryptionConfig = (output, context) => {
1259
1033
  return {
1260
1034
  CmkType: __expectString(output.CmkType),
1261
1035
  KmsKeyId: __expectString(output.KmsKeyId),
1262
1036
  };
1263
1037
  };
1264
- var deserializeAws_json1_0ListFHIRDatastoresResponse = function (output, context) {
1038
+ const deserializeAws_json1_0ListFHIRDatastoresResponse = (output, context) => {
1265
1039
  return {
1266
1040
  DatastorePropertiesList: output.DatastorePropertiesList != null
1267
1041
  ? deserializeAws_json1_0DatastorePropertiesList(output.DatastorePropertiesList, context)
@@ -1269,7 +1043,7 @@ var deserializeAws_json1_0ListFHIRDatastoresResponse = function (output, context
1269
1043
  NextToken: __expectString(output.NextToken),
1270
1044
  };
1271
1045
  };
1272
- var deserializeAws_json1_0ListFHIRExportJobsResponse = function (output, context) {
1046
+ const deserializeAws_json1_0ListFHIRExportJobsResponse = (output, context) => {
1273
1047
  return {
1274
1048
  ExportJobPropertiesList: output.ExportJobPropertiesList != null
1275
1049
  ? deserializeAws_json1_0ExportJobPropertiesList(output.ExportJobPropertiesList, context)
@@ -1277,7 +1051,7 @@ var deserializeAws_json1_0ListFHIRExportJobsResponse = function (output, context
1277
1051
  NextToken: __expectString(output.NextToken),
1278
1052
  };
1279
1053
  };
1280
- var deserializeAws_json1_0ListFHIRImportJobsResponse = function (output, context) {
1054
+ const deserializeAws_json1_0ListFHIRImportJobsResponse = (output, context) => {
1281
1055
  return {
1282
1056
  ImportJobPropertiesList: output.ImportJobPropertiesList != null
1283
1057
  ? deserializeAws_json1_0ImportJobPropertiesList(output.ImportJobPropertiesList, context)
@@ -1285,12 +1059,12 @@ var deserializeAws_json1_0ListFHIRImportJobsResponse = function (output, context
1285
1059
  NextToken: __expectString(output.NextToken),
1286
1060
  };
1287
1061
  };
1288
- var deserializeAws_json1_0ListTagsForResourceResponse = function (output, context) {
1062
+ const deserializeAws_json1_0ListTagsForResourceResponse = (output, context) => {
1289
1063
  return {
1290
1064
  Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
1291
1065
  };
1292
1066
  };
1293
- var deserializeAws_json1_0OutputDataConfig = function (output, context) {
1067
+ const deserializeAws_json1_0OutputDataConfig = (output, context) => {
1294
1068
  if (output.S3Configuration != null) {
1295
1069
  return {
1296
1070
  S3Configuration: deserializeAws_json1_0S3Configuration(output.S3Configuration, context),
@@ -1298,53 +1072,53 @@ var deserializeAws_json1_0OutputDataConfig = function (output, context) {
1298
1072
  }
1299
1073
  return { $unknown: Object.entries(output)[0] };
1300
1074
  };
1301
- var deserializeAws_json1_0PreloadDataConfig = function (output, context) {
1075
+ const deserializeAws_json1_0PreloadDataConfig = (output, context) => {
1302
1076
  return {
1303
1077
  PreloadDataType: __expectString(output.PreloadDataType),
1304
1078
  };
1305
1079
  };
1306
- var deserializeAws_json1_0ResourceNotFoundException = function (output, context) {
1080
+ const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
1307
1081
  return {
1308
1082
  Message: __expectString(output.Message),
1309
1083
  };
1310
1084
  };
1311
- var deserializeAws_json1_0S3Configuration = function (output, context) {
1085
+ const deserializeAws_json1_0S3Configuration = (output, context) => {
1312
1086
  return {
1313
1087
  KmsKeyId: __expectString(output.KmsKeyId),
1314
1088
  S3Uri: __expectString(output.S3Uri),
1315
1089
  };
1316
1090
  };
1317
- var deserializeAws_json1_0SseConfiguration = function (output, context) {
1091
+ const deserializeAws_json1_0SseConfiguration = (output, context) => {
1318
1092
  return {
1319
1093
  KmsEncryptionConfig: output.KmsEncryptionConfig != null
1320
1094
  ? deserializeAws_json1_0KmsEncryptionConfig(output.KmsEncryptionConfig, context)
1321
1095
  : undefined,
1322
1096
  };
1323
1097
  };
1324
- var deserializeAws_json1_0StartFHIRExportJobResponse = function (output, context) {
1098
+ const deserializeAws_json1_0StartFHIRExportJobResponse = (output, context) => {
1325
1099
  return {
1326
1100
  DatastoreId: __expectString(output.DatastoreId),
1327
1101
  JobId: __expectString(output.JobId),
1328
1102
  JobStatus: __expectString(output.JobStatus),
1329
1103
  };
1330
1104
  };
1331
- var deserializeAws_json1_0StartFHIRImportJobResponse = function (output, context) {
1105
+ const deserializeAws_json1_0StartFHIRImportJobResponse = (output, context) => {
1332
1106
  return {
1333
1107
  DatastoreId: __expectString(output.DatastoreId),
1334
1108
  JobId: __expectString(output.JobId),
1335
1109
  JobStatus: __expectString(output.JobStatus),
1336
1110
  };
1337
1111
  };
1338
- var deserializeAws_json1_0Tag = function (output, context) {
1112
+ const deserializeAws_json1_0Tag = (output, context) => {
1339
1113
  return {
1340
1114
  Key: __expectString(output.Key),
1341
1115
  Value: __expectString(output.Value),
1342
1116
  };
1343
1117
  };
1344
- var deserializeAws_json1_0TagList = function (output, context) {
1345
- var retVal = (output || [])
1346
- .filter(function (e) { return e != null; })
1347
- .map(function (entry) {
1118
+ const deserializeAws_json1_0TagList = (output, context) => {
1119
+ const retVal = (output || [])
1120
+ .filter((e) => e != null)
1121
+ .map((entry) => {
1348
1122
  if (entry === null) {
1349
1123
  return null;
1350
1124
  }
@@ -1352,91 +1126,68 @@ var deserializeAws_json1_0TagList = function (output, context) {
1352
1126
  });
1353
1127
  return retVal;
1354
1128
  };
1355
- var deserializeAws_json1_0TagResourceResponse = function (output, context) {
1129
+ const deserializeAws_json1_0TagResourceResponse = (output, context) => {
1356
1130
  return {};
1357
1131
  };
1358
- var deserializeAws_json1_0ThrottlingException = function (output, context) {
1132
+ const deserializeAws_json1_0ThrottlingException = (output, context) => {
1359
1133
  return {
1360
1134
  Message: __expectString(output.Message),
1361
1135
  };
1362
1136
  };
1363
- var deserializeAws_json1_0UntagResourceResponse = function (output, context) {
1137
+ const deserializeAws_json1_0UntagResourceResponse = (output, context) => {
1364
1138
  return {};
1365
1139
  };
1366
- var deserializeAws_json1_0ValidationException = function (output, context) {
1140
+ const deserializeAws_json1_0ValidationException = (output, context) => {
1367
1141
  return {
1368
1142
  Message: __expectString(output.Message),
1369
1143
  };
1370
1144
  };
1371
- var deserializeMetadata = function (output) {
1372
- var _a, _b;
1373
- return ({
1374
- httpStatusCode: output.statusCode,
1375
- 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"],
1376
- extendedRequestId: output.headers["x-amz-id-2"],
1377
- cfId: output.headers["x-amz-cf-id"],
1378
- });
1379
- };
1380
- var collectBody = function (streamBody, context) {
1381
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1145
+ const deserializeMetadata = (output) => ({
1146
+ httpStatusCode: output.statusCode,
1147
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1148
+ extendedRequestId: output.headers["x-amz-id-2"],
1149
+ cfId: output.headers["x-amz-cf-id"],
1150
+ });
1151
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1382
1152
  if (streamBody instanceof Uint8Array) {
1383
1153
  return Promise.resolve(streamBody);
1384
1154
  }
1385
1155
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1386
1156
  };
1387
- var collectBodyString = function (streamBody, context) {
1388
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1389
- };
1390
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1391
- var _a, hostname, _b, protocol, port, basePath, contents;
1392
- return __generator(this, function (_c) {
1393
- switch (_c.label) {
1394
- case 0: return [4, context.endpoint()];
1395
- case 1:
1396
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1397
- contents = {
1398
- protocol: protocol,
1399
- hostname: hostname,
1400
- port: port,
1401
- method: "POST",
1402
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1403
- headers: headers,
1404
- };
1405
- if (resolvedHostname !== undefined) {
1406
- contents.hostname = resolvedHostname;
1407
- }
1408
- if (body !== undefined) {
1409
- contents.body = body;
1410
- }
1411
- return [2, new __HttpRequest(contents)];
1412
- }
1413
- });
1414
- }); };
1415
- var parseBody = function (streamBody, context) {
1416
- return collectBodyString(streamBody, context).then(function (encoded) {
1417
- if (encoded.length) {
1418
- return JSON.parse(encoded);
1419
- }
1420
- return {};
1421
- });
1157
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1158
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1159
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1160
+ const contents = {
1161
+ protocol,
1162
+ hostname,
1163
+ port,
1164
+ method: "POST",
1165
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1166
+ headers,
1167
+ };
1168
+ if (resolvedHostname !== undefined) {
1169
+ contents.hostname = resolvedHostname;
1170
+ }
1171
+ if (body !== undefined) {
1172
+ contents.body = body;
1173
+ }
1174
+ return new __HttpRequest(contents);
1422
1175
  };
1423
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1424
- var value;
1425
- var _a;
1426
- return __generator(this, function (_b) {
1427
- switch (_b.label) {
1428
- case 0: return [4, parseBody(errorBody, context)];
1429
- case 1:
1430
- value = _b.sent();
1431
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1432
- return [2, value];
1433
- }
1434
- });
1435
- }); };
1436
- var loadRestJsonErrorCode = function (output, data) {
1437
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1438
- var sanitizeErrorCode = function (rawValue) {
1439
- var cleanValue = rawValue;
1176
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1177
+ if (encoded.length) {
1178
+ return JSON.parse(encoded);
1179
+ }
1180
+ return {};
1181
+ });
1182
+ const parseErrorBody = async (errorBody, context) => {
1183
+ const value = await parseBody(errorBody, context);
1184
+ value.message = value.message ?? value.Message;
1185
+ return value;
1186
+ };
1187
+ const loadRestJsonErrorCode = (output, data) => {
1188
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1189
+ const sanitizeErrorCode = (rawValue) => {
1190
+ let cleanValue = rawValue;
1440
1191
  if (typeof cleanValue === "number") {
1441
1192
  cleanValue = cleanValue.toString();
1442
1193
  }
@@ -1451,7 +1202,7 @@ var loadRestJsonErrorCode = function (output, data) {
1451
1202
  }
1452
1203
  return cleanValue;
1453
1204
  };
1454
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1205
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1455
1206
  if (headerKey !== undefined) {
1456
1207
  return sanitizeErrorCode(output.headers[headerKey]);
1457
1208
  }