@aws-sdk/client-comprehendmedical 3.926.0 → 3.928.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 (47) hide show
  1. package/dist-cjs/index.js +897 -1360
  2. package/dist-cjs/runtimeConfig.shared.js +7 -0
  3. package/dist-es/ComprehendMedicalClient.js +2 -0
  4. package/dist-es/commands/DescribeEntitiesDetectionV2JobCommand.js +3 -9
  5. package/dist-es/commands/DescribeICD10CMInferenceJobCommand.js +3 -9
  6. package/dist-es/commands/DescribePHIDetectionJobCommand.js +3 -9
  7. package/dist-es/commands/DescribeRxNormInferenceJobCommand.js +3 -9
  8. package/dist-es/commands/DescribeSNOMEDCTInferenceJobCommand.js +3 -9
  9. package/dist-es/commands/DetectEntitiesCommand.js +3 -9
  10. package/dist-es/commands/DetectEntitiesV2Command.js +3 -9
  11. package/dist-es/commands/DetectPHICommand.js +3 -9
  12. package/dist-es/commands/InferICD10CMCommand.js +3 -9
  13. package/dist-es/commands/InferRxNormCommand.js +3 -9
  14. package/dist-es/commands/InferSNOMEDCTCommand.js +3 -9
  15. package/dist-es/commands/ListEntitiesDetectionV2JobsCommand.js +3 -9
  16. package/dist-es/commands/ListICD10CMInferenceJobsCommand.js +3 -9
  17. package/dist-es/commands/ListPHIDetectionJobsCommand.js +3 -9
  18. package/dist-es/commands/ListRxNormInferenceJobsCommand.js +3 -9
  19. package/dist-es/commands/ListSNOMEDCTInferenceJobsCommand.js +3 -9
  20. package/dist-es/commands/StartEntitiesDetectionV2JobCommand.js +3 -9
  21. package/dist-es/commands/StartICD10CMInferenceJobCommand.js +3 -9
  22. package/dist-es/commands/StartPHIDetectionJobCommand.js +3 -9
  23. package/dist-es/commands/StartRxNormInferenceJobCommand.js +3 -9
  24. package/dist-es/commands/StartSNOMEDCTInferenceJobCommand.js +3 -9
  25. package/dist-es/commands/StopEntitiesDetectionV2JobCommand.js +3 -9
  26. package/dist-es/commands/StopICD10CMInferenceJobCommand.js +3 -9
  27. package/dist-es/commands/StopPHIDetectionJobCommand.js +3 -9
  28. package/dist-es/commands/StopRxNormInferenceJobCommand.js +3 -9
  29. package/dist-es/commands/StopSNOMEDCTInferenceJobCommand.js +3 -9
  30. package/dist-es/runtimeConfig.shared.js +7 -0
  31. package/dist-es/schemas/schemas_0.js +820 -0
  32. package/dist-types/ComprehendMedicalClient.d.ts +10 -1
  33. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  34. package/dist-types/runtimeConfig.d.ts +1 -0
  35. package/dist-types/runtimeConfig.native.d.ts +1 -0
  36. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  37. package/dist-types/schemas/schemas_0.d.ts +128 -0
  38. package/dist-types/ts3.4/ComprehendMedicalClient.d.ts +4 -0
  39. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  40. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  41. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  42. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  43. package/dist-types/ts3.4/schemas/schemas_0.d.ts +133 -0
  44. package/package.json +5 -6
  45. package/dist-es/protocols/Aws_json1_1.js +0 -1158
  46. package/dist-types/protocols/Aws_json1_1.d.ts +0 -236
  47. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +0 -317
@@ -1,1158 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { v4 as generateIdempotencyToken } from "@smithy/uuid";
5
- import { ComprehendMedicalServiceException as __BaseException } from "../models/ComprehendMedicalServiceException";
6
- import { InternalServerException, InvalidEncodingException, InvalidRequestException, ResourceNotFoundException, ServiceUnavailableException, TextSizeLimitExceededException, TooManyRequestsException, ValidationException, } from "../models/models_0";
7
- export const se_DescribeEntitiesDetectionV2JobCommand = async (input, context) => {
8
- const headers = sharedHeaders("DescribeEntitiesDetectionV2Job");
9
- let body;
10
- body = JSON.stringify(_json(input));
11
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
12
- };
13
- export const se_DescribeICD10CMInferenceJobCommand = async (input, context) => {
14
- const headers = sharedHeaders("DescribeICD10CMInferenceJob");
15
- let body;
16
- body = JSON.stringify(_json(input));
17
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
18
- };
19
- export const se_DescribePHIDetectionJobCommand = async (input, context) => {
20
- const headers = sharedHeaders("DescribePHIDetectionJob");
21
- let body;
22
- body = JSON.stringify(_json(input));
23
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
24
- };
25
- export const se_DescribeRxNormInferenceJobCommand = async (input, context) => {
26
- const headers = sharedHeaders("DescribeRxNormInferenceJob");
27
- let body;
28
- body = JSON.stringify(_json(input));
29
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
30
- };
31
- export const se_DescribeSNOMEDCTInferenceJobCommand = async (input, context) => {
32
- const headers = sharedHeaders("DescribeSNOMEDCTInferenceJob");
33
- let body;
34
- body = JSON.stringify(_json(input));
35
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
- };
37
- export const se_DetectEntitiesCommand = async (input, context) => {
38
- const headers = sharedHeaders("DetectEntities");
39
- let body;
40
- body = JSON.stringify(_json(input));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- export const se_DetectEntitiesV2Command = async (input, context) => {
44
- const headers = sharedHeaders("DetectEntitiesV2");
45
- let body;
46
- body = JSON.stringify(_json(input));
47
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
- };
49
- export const se_DetectPHICommand = async (input, context) => {
50
- const headers = sharedHeaders("DetectPHI");
51
- let body;
52
- body = JSON.stringify(_json(input));
53
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
54
- };
55
- export const se_InferICD10CMCommand = async (input, context) => {
56
- const headers = sharedHeaders("InferICD10CM");
57
- let body;
58
- body = JSON.stringify(_json(input));
59
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
60
- };
61
- export const se_InferRxNormCommand = async (input, context) => {
62
- const headers = sharedHeaders("InferRxNorm");
63
- let body;
64
- body = JSON.stringify(_json(input));
65
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
66
- };
67
- export const se_InferSNOMEDCTCommand = async (input, context) => {
68
- const headers = sharedHeaders("InferSNOMEDCT");
69
- let body;
70
- body = JSON.stringify(_json(input));
71
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
72
- };
73
- export const se_ListEntitiesDetectionV2JobsCommand = async (input, context) => {
74
- const headers = sharedHeaders("ListEntitiesDetectionV2Jobs");
75
- let body;
76
- body = JSON.stringify(se_ListEntitiesDetectionV2JobsRequest(input, context));
77
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
78
- };
79
- export const se_ListICD10CMInferenceJobsCommand = async (input, context) => {
80
- const headers = sharedHeaders("ListICD10CMInferenceJobs");
81
- let body;
82
- body = JSON.stringify(se_ListICD10CMInferenceJobsRequest(input, context));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- export const se_ListPHIDetectionJobsCommand = async (input, context) => {
86
- const headers = sharedHeaders("ListPHIDetectionJobs");
87
- let body;
88
- body = JSON.stringify(se_ListPHIDetectionJobsRequest(input, context));
89
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
- };
91
- export const se_ListRxNormInferenceJobsCommand = async (input, context) => {
92
- const headers = sharedHeaders("ListRxNormInferenceJobs");
93
- let body;
94
- body = JSON.stringify(se_ListRxNormInferenceJobsRequest(input, context));
95
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
96
- };
97
- export const se_ListSNOMEDCTInferenceJobsCommand = async (input, context) => {
98
- const headers = sharedHeaders("ListSNOMEDCTInferenceJobs");
99
- let body;
100
- body = JSON.stringify(se_ListSNOMEDCTInferenceJobsRequest(input, context));
101
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
102
- };
103
- export const se_StartEntitiesDetectionV2JobCommand = async (input, context) => {
104
- const headers = sharedHeaders("StartEntitiesDetectionV2Job");
105
- let body;
106
- body = JSON.stringify(se_StartEntitiesDetectionV2JobRequest(input, context));
107
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
108
- };
109
- export const se_StartICD10CMInferenceJobCommand = async (input, context) => {
110
- const headers = sharedHeaders("StartICD10CMInferenceJob");
111
- let body;
112
- body = JSON.stringify(se_StartICD10CMInferenceJobRequest(input, context));
113
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
114
- };
115
- export const se_StartPHIDetectionJobCommand = async (input, context) => {
116
- const headers = sharedHeaders("StartPHIDetectionJob");
117
- let body;
118
- body = JSON.stringify(se_StartPHIDetectionJobRequest(input, context));
119
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
120
- };
121
- export const se_StartRxNormInferenceJobCommand = async (input, context) => {
122
- const headers = sharedHeaders("StartRxNormInferenceJob");
123
- let body;
124
- body = JSON.stringify(se_StartRxNormInferenceJobRequest(input, context));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- export const se_StartSNOMEDCTInferenceJobCommand = async (input, context) => {
128
- const headers = sharedHeaders("StartSNOMEDCTInferenceJob");
129
- let body;
130
- body = JSON.stringify(se_StartSNOMEDCTInferenceJobRequest(input, context));
131
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
132
- };
133
- export const se_StopEntitiesDetectionV2JobCommand = async (input, context) => {
134
- const headers = sharedHeaders("StopEntitiesDetectionV2Job");
135
- let body;
136
- body = JSON.stringify(_json(input));
137
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
138
- };
139
- export const se_StopICD10CMInferenceJobCommand = async (input, context) => {
140
- const headers = sharedHeaders("StopICD10CMInferenceJob");
141
- let body;
142
- body = JSON.stringify(_json(input));
143
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
144
- };
145
- export const se_StopPHIDetectionJobCommand = async (input, context) => {
146
- const headers = sharedHeaders("StopPHIDetectionJob");
147
- let body;
148
- body = JSON.stringify(_json(input));
149
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
150
- };
151
- export const se_StopRxNormInferenceJobCommand = async (input, context) => {
152
- const headers = sharedHeaders("StopRxNormInferenceJob");
153
- let body;
154
- body = JSON.stringify(_json(input));
155
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
156
- };
157
- export const se_StopSNOMEDCTInferenceJobCommand = async (input, context) => {
158
- const headers = sharedHeaders("StopSNOMEDCTInferenceJob");
159
- let body;
160
- body = JSON.stringify(_json(input));
161
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
162
- };
163
- export const de_DescribeEntitiesDetectionV2JobCommand = async (output, context) => {
164
- if (output.statusCode >= 300) {
165
- return de_CommandError(output, context);
166
- }
167
- const data = await parseBody(output.body, context);
168
- let contents = {};
169
- contents = de_DescribeEntitiesDetectionV2JobResponse(data, context);
170
- const response = {
171
- $metadata: deserializeMetadata(output),
172
- ...contents,
173
- };
174
- return response;
175
- };
176
- export const de_DescribeICD10CMInferenceJobCommand = async (output, context) => {
177
- if (output.statusCode >= 300) {
178
- return de_CommandError(output, context);
179
- }
180
- const data = await parseBody(output.body, context);
181
- let contents = {};
182
- contents = de_DescribeICD10CMInferenceJobResponse(data, context);
183
- const response = {
184
- $metadata: deserializeMetadata(output),
185
- ...contents,
186
- };
187
- return response;
188
- };
189
- export const de_DescribePHIDetectionJobCommand = async (output, context) => {
190
- if (output.statusCode >= 300) {
191
- return de_CommandError(output, context);
192
- }
193
- const data = await parseBody(output.body, context);
194
- let contents = {};
195
- contents = de_DescribePHIDetectionJobResponse(data, context);
196
- const response = {
197
- $metadata: deserializeMetadata(output),
198
- ...contents,
199
- };
200
- return response;
201
- };
202
- export const de_DescribeRxNormInferenceJobCommand = async (output, context) => {
203
- if (output.statusCode >= 300) {
204
- return de_CommandError(output, context);
205
- }
206
- const data = await parseBody(output.body, context);
207
- let contents = {};
208
- contents = de_DescribeRxNormInferenceJobResponse(data, context);
209
- const response = {
210
- $metadata: deserializeMetadata(output),
211
- ...contents,
212
- };
213
- return response;
214
- };
215
- export const de_DescribeSNOMEDCTInferenceJobCommand = async (output, context) => {
216
- if (output.statusCode >= 300) {
217
- return de_CommandError(output, context);
218
- }
219
- const data = await parseBody(output.body, context);
220
- let contents = {};
221
- contents = de_DescribeSNOMEDCTInferenceJobResponse(data, context);
222
- const response = {
223
- $metadata: deserializeMetadata(output),
224
- ...contents,
225
- };
226
- return response;
227
- };
228
- export const de_DetectEntitiesCommand = async (output, context) => {
229
- if (output.statusCode >= 300) {
230
- return de_CommandError(output, context);
231
- }
232
- const data = await parseBody(output.body, context);
233
- let contents = {};
234
- contents = de_DetectEntitiesResponse(data, context);
235
- const response = {
236
- $metadata: deserializeMetadata(output),
237
- ...contents,
238
- };
239
- return response;
240
- };
241
- export const de_DetectEntitiesV2Command = async (output, context) => {
242
- if (output.statusCode >= 300) {
243
- return de_CommandError(output, context);
244
- }
245
- const data = await parseBody(output.body, context);
246
- let contents = {};
247
- contents = de_DetectEntitiesV2Response(data, context);
248
- const response = {
249
- $metadata: deserializeMetadata(output),
250
- ...contents,
251
- };
252
- return response;
253
- };
254
- export const de_DetectPHICommand = async (output, context) => {
255
- if (output.statusCode >= 300) {
256
- return de_CommandError(output, context);
257
- }
258
- const data = await parseBody(output.body, context);
259
- let contents = {};
260
- contents = de_DetectPHIResponse(data, context);
261
- const response = {
262
- $metadata: deserializeMetadata(output),
263
- ...contents,
264
- };
265
- return response;
266
- };
267
- export const de_InferICD10CMCommand = async (output, context) => {
268
- if (output.statusCode >= 300) {
269
- return de_CommandError(output, context);
270
- }
271
- const data = await parseBody(output.body, context);
272
- let contents = {};
273
- contents = de_InferICD10CMResponse(data, context);
274
- const response = {
275
- $metadata: deserializeMetadata(output),
276
- ...contents,
277
- };
278
- return response;
279
- };
280
- export const de_InferRxNormCommand = async (output, context) => {
281
- if (output.statusCode >= 300) {
282
- return de_CommandError(output, context);
283
- }
284
- const data = await parseBody(output.body, context);
285
- let contents = {};
286
- contents = de_InferRxNormResponse(data, context);
287
- const response = {
288
- $metadata: deserializeMetadata(output),
289
- ...contents,
290
- };
291
- return response;
292
- };
293
- export const de_InferSNOMEDCTCommand = async (output, context) => {
294
- if (output.statusCode >= 300) {
295
- return de_CommandError(output, context);
296
- }
297
- const data = await parseBody(output.body, context);
298
- let contents = {};
299
- contents = de_InferSNOMEDCTResponse(data, context);
300
- const response = {
301
- $metadata: deserializeMetadata(output),
302
- ...contents,
303
- };
304
- return response;
305
- };
306
- export const de_ListEntitiesDetectionV2JobsCommand = async (output, context) => {
307
- if (output.statusCode >= 300) {
308
- return de_CommandError(output, context);
309
- }
310
- const data = await parseBody(output.body, context);
311
- let contents = {};
312
- contents = de_ListEntitiesDetectionV2JobsResponse(data, context);
313
- const response = {
314
- $metadata: deserializeMetadata(output),
315
- ...contents,
316
- };
317
- return response;
318
- };
319
- export const de_ListICD10CMInferenceJobsCommand = async (output, context) => {
320
- if (output.statusCode >= 300) {
321
- return de_CommandError(output, context);
322
- }
323
- const data = await parseBody(output.body, context);
324
- let contents = {};
325
- contents = de_ListICD10CMInferenceJobsResponse(data, context);
326
- const response = {
327
- $metadata: deserializeMetadata(output),
328
- ...contents,
329
- };
330
- return response;
331
- };
332
- export const de_ListPHIDetectionJobsCommand = async (output, context) => {
333
- if (output.statusCode >= 300) {
334
- return de_CommandError(output, context);
335
- }
336
- const data = await parseBody(output.body, context);
337
- let contents = {};
338
- contents = de_ListPHIDetectionJobsResponse(data, context);
339
- const response = {
340
- $metadata: deserializeMetadata(output),
341
- ...contents,
342
- };
343
- return response;
344
- };
345
- export const de_ListRxNormInferenceJobsCommand = async (output, context) => {
346
- if (output.statusCode >= 300) {
347
- return de_CommandError(output, context);
348
- }
349
- const data = await parseBody(output.body, context);
350
- let contents = {};
351
- contents = de_ListRxNormInferenceJobsResponse(data, context);
352
- const response = {
353
- $metadata: deserializeMetadata(output),
354
- ...contents,
355
- };
356
- return response;
357
- };
358
- export const de_ListSNOMEDCTInferenceJobsCommand = async (output, context) => {
359
- if (output.statusCode >= 300) {
360
- return de_CommandError(output, context);
361
- }
362
- const data = await parseBody(output.body, context);
363
- let contents = {};
364
- contents = de_ListSNOMEDCTInferenceJobsResponse(data, context);
365
- const response = {
366
- $metadata: deserializeMetadata(output),
367
- ...contents,
368
- };
369
- return response;
370
- };
371
- export const de_StartEntitiesDetectionV2JobCommand = async (output, context) => {
372
- if (output.statusCode >= 300) {
373
- return de_CommandError(output, context);
374
- }
375
- const data = await parseBody(output.body, context);
376
- let contents = {};
377
- contents = _json(data);
378
- const response = {
379
- $metadata: deserializeMetadata(output),
380
- ...contents,
381
- };
382
- return response;
383
- };
384
- export const de_StartICD10CMInferenceJobCommand = async (output, context) => {
385
- if (output.statusCode >= 300) {
386
- return de_CommandError(output, context);
387
- }
388
- const data = await parseBody(output.body, context);
389
- let contents = {};
390
- contents = _json(data);
391
- const response = {
392
- $metadata: deserializeMetadata(output),
393
- ...contents,
394
- };
395
- return response;
396
- };
397
- export const de_StartPHIDetectionJobCommand = async (output, context) => {
398
- if (output.statusCode >= 300) {
399
- return de_CommandError(output, context);
400
- }
401
- const data = await parseBody(output.body, context);
402
- let contents = {};
403
- contents = _json(data);
404
- const response = {
405
- $metadata: deserializeMetadata(output),
406
- ...contents,
407
- };
408
- return response;
409
- };
410
- export const de_StartRxNormInferenceJobCommand = async (output, context) => {
411
- if (output.statusCode >= 300) {
412
- return de_CommandError(output, context);
413
- }
414
- const data = await parseBody(output.body, context);
415
- let contents = {};
416
- contents = _json(data);
417
- const response = {
418
- $metadata: deserializeMetadata(output),
419
- ...contents,
420
- };
421
- return response;
422
- };
423
- export const de_StartSNOMEDCTInferenceJobCommand = async (output, context) => {
424
- if (output.statusCode >= 300) {
425
- return de_CommandError(output, context);
426
- }
427
- const data = await parseBody(output.body, context);
428
- let contents = {};
429
- contents = _json(data);
430
- const response = {
431
- $metadata: deserializeMetadata(output),
432
- ...contents,
433
- };
434
- return response;
435
- };
436
- export const de_StopEntitiesDetectionV2JobCommand = async (output, context) => {
437
- if (output.statusCode >= 300) {
438
- return de_CommandError(output, context);
439
- }
440
- const data = await parseBody(output.body, context);
441
- let contents = {};
442
- contents = _json(data);
443
- const response = {
444
- $metadata: deserializeMetadata(output),
445
- ...contents,
446
- };
447
- return response;
448
- };
449
- export const de_StopICD10CMInferenceJobCommand = async (output, context) => {
450
- if (output.statusCode >= 300) {
451
- return de_CommandError(output, context);
452
- }
453
- const data = await parseBody(output.body, context);
454
- let contents = {};
455
- contents = _json(data);
456
- const response = {
457
- $metadata: deserializeMetadata(output),
458
- ...contents,
459
- };
460
- return response;
461
- };
462
- export const de_StopPHIDetectionJobCommand = async (output, context) => {
463
- if (output.statusCode >= 300) {
464
- return de_CommandError(output, context);
465
- }
466
- const data = await parseBody(output.body, context);
467
- let contents = {};
468
- contents = _json(data);
469
- const response = {
470
- $metadata: deserializeMetadata(output),
471
- ...contents,
472
- };
473
- return response;
474
- };
475
- export const de_StopRxNormInferenceJobCommand = async (output, context) => {
476
- if (output.statusCode >= 300) {
477
- return de_CommandError(output, context);
478
- }
479
- const data = await parseBody(output.body, context);
480
- let contents = {};
481
- contents = _json(data);
482
- const response = {
483
- $metadata: deserializeMetadata(output),
484
- ...contents,
485
- };
486
- return response;
487
- };
488
- export const de_StopSNOMEDCTInferenceJobCommand = async (output, context) => {
489
- if (output.statusCode >= 300) {
490
- return de_CommandError(output, context);
491
- }
492
- const data = await parseBody(output.body, context);
493
- let contents = {};
494
- contents = _json(data);
495
- const response = {
496
- $metadata: deserializeMetadata(output),
497
- ...contents,
498
- };
499
- return response;
500
- };
501
- const de_CommandError = async (output, context) => {
502
- const parsedOutput = {
503
- ...output,
504
- body: await parseErrorBody(output.body, context),
505
- };
506
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
507
- switch (errorCode) {
508
- case "InternalServerException":
509
- case "com.amazonaws.comprehendmedical#InternalServerException":
510
- throw await de_InternalServerExceptionRes(parsedOutput, context);
511
- case "InvalidRequestException":
512
- case "com.amazonaws.comprehendmedical#InvalidRequestException":
513
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
514
- case "ResourceNotFoundException":
515
- case "com.amazonaws.comprehendmedical#ResourceNotFoundException":
516
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
517
- case "TooManyRequestsException":
518
- case "com.amazonaws.comprehendmedical#TooManyRequestsException":
519
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
520
- case "InvalidEncodingException":
521
- case "com.amazonaws.comprehendmedical#InvalidEncodingException":
522
- throw await de_InvalidEncodingExceptionRes(parsedOutput, context);
523
- case "ServiceUnavailableException":
524
- case "com.amazonaws.comprehendmedical#ServiceUnavailableException":
525
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
526
- case "TextSizeLimitExceededException":
527
- case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException":
528
- throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context);
529
- case "ValidationException":
530
- case "com.amazonaws.comprehendmedical#ValidationException":
531
- throw await de_ValidationExceptionRes(parsedOutput, context);
532
- default:
533
- const parsedBody = parsedOutput.body;
534
- return throwDefaultError({
535
- output,
536
- parsedBody,
537
- errorCode,
538
- });
539
- }
540
- };
541
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
542
- const body = parsedOutput.body;
543
- const deserialized = _json(body);
544
- const exception = new InternalServerException({
545
- $metadata: deserializeMetadata(parsedOutput),
546
- ...deserialized,
547
- });
548
- return __decorateServiceException(exception, body);
549
- };
550
- const de_InvalidEncodingExceptionRes = async (parsedOutput, context) => {
551
- const body = parsedOutput.body;
552
- const deserialized = _json(body);
553
- const exception = new InvalidEncodingException({
554
- $metadata: deserializeMetadata(parsedOutput),
555
- ...deserialized,
556
- });
557
- return __decorateServiceException(exception, body);
558
- };
559
- const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
560
- const body = parsedOutput.body;
561
- const deserialized = _json(body);
562
- const exception = new InvalidRequestException({
563
- $metadata: deserializeMetadata(parsedOutput),
564
- ...deserialized,
565
- });
566
- return __decorateServiceException(exception, body);
567
- };
568
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
569
- const body = parsedOutput.body;
570
- const deserialized = _json(body);
571
- const exception = new ResourceNotFoundException({
572
- $metadata: deserializeMetadata(parsedOutput),
573
- ...deserialized,
574
- });
575
- return __decorateServiceException(exception, body);
576
- };
577
- const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
578
- const body = parsedOutput.body;
579
- const deserialized = _json(body);
580
- const exception = new ServiceUnavailableException({
581
- $metadata: deserializeMetadata(parsedOutput),
582
- ...deserialized,
583
- });
584
- return __decorateServiceException(exception, body);
585
- };
586
- const de_TextSizeLimitExceededExceptionRes = async (parsedOutput, context) => {
587
- const body = parsedOutput.body;
588
- const deserialized = _json(body);
589
- const exception = new TextSizeLimitExceededException({
590
- $metadata: deserializeMetadata(parsedOutput),
591
- ...deserialized,
592
- });
593
- return __decorateServiceException(exception, body);
594
- };
595
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
596
- const body = parsedOutput.body;
597
- const deserialized = _json(body);
598
- const exception = new TooManyRequestsException({
599
- $metadata: deserializeMetadata(parsedOutput),
600
- ...deserialized,
601
- });
602
- return __decorateServiceException(exception, body);
603
- };
604
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
605
- const body = parsedOutput.body;
606
- const deserialized = _json(body);
607
- const exception = new ValidationException({
608
- $metadata: deserializeMetadata(parsedOutput),
609
- ...deserialized,
610
- });
611
- return __decorateServiceException(exception, body);
612
- };
613
- const se_ComprehendMedicalAsyncJobFilter = (input, context) => {
614
- return take(input, {
615
- JobName: [],
616
- JobStatus: [],
617
- SubmitTimeAfter: (_) => _.getTime() / 1_000,
618
- SubmitTimeBefore: (_) => _.getTime() / 1_000,
619
- });
620
- };
621
- const se_ListEntitiesDetectionV2JobsRequest = (input, context) => {
622
- return take(input, {
623
- Filter: (_) => se_ComprehendMedicalAsyncJobFilter(_, context),
624
- MaxResults: [],
625
- NextToken: [],
626
- });
627
- };
628
- const se_ListICD10CMInferenceJobsRequest = (input, context) => {
629
- return take(input, {
630
- Filter: (_) => se_ComprehendMedicalAsyncJobFilter(_, context),
631
- MaxResults: [],
632
- NextToken: [],
633
- });
634
- };
635
- const se_ListPHIDetectionJobsRequest = (input, context) => {
636
- return take(input, {
637
- Filter: (_) => se_ComprehendMedicalAsyncJobFilter(_, context),
638
- MaxResults: [],
639
- NextToken: [],
640
- });
641
- };
642
- const se_ListRxNormInferenceJobsRequest = (input, context) => {
643
- return take(input, {
644
- Filter: (_) => se_ComprehendMedicalAsyncJobFilter(_, context),
645
- MaxResults: [],
646
- NextToken: [],
647
- });
648
- };
649
- const se_ListSNOMEDCTInferenceJobsRequest = (input, context) => {
650
- return take(input, {
651
- Filter: (_) => se_ComprehendMedicalAsyncJobFilter(_, context),
652
- MaxResults: [],
653
- NextToken: [],
654
- });
655
- };
656
- const se_StartEntitiesDetectionV2JobRequest = (input, context) => {
657
- return take(input, {
658
- ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
659
- DataAccessRoleArn: [],
660
- InputDataConfig: _json,
661
- JobName: [],
662
- KMSKey: [],
663
- LanguageCode: [],
664
- OutputDataConfig: _json,
665
- });
666
- };
667
- const se_StartICD10CMInferenceJobRequest = (input, context) => {
668
- return take(input, {
669
- ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
670
- DataAccessRoleArn: [],
671
- InputDataConfig: _json,
672
- JobName: [],
673
- KMSKey: [],
674
- LanguageCode: [],
675
- OutputDataConfig: _json,
676
- });
677
- };
678
- const se_StartPHIDetectionJobRequest = (input, context) => {
679
- return take(input, {
680
- ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
681
- DataAccessRoleArn: [],
682
- InputDataConfig: _json,
683
- JobName: [],
684
- KMSKey: [],
685
- LanguageCode: [],
686
- OutputDataConfig: _json,
687
- });
688
- };
689
- const se_StartRxNormInferenceJobRequest = (input, context) => {
690
- return take(input, {
691
- ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
692
- DataAccessRoleArn: [],
693
- InputDataConfig: _json,
694
- JobName: [],
695
- KMSKey: [],
696
- LanguageCode: [],
697
- OutputDataConfig: _json,
698
- });
699
- };
700
- const se_StartSNOMEDCTInferenceJobRequest = (input, context) => {
701
- return take(input, {
702
- ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
703
- DataAccessRoleArn: [],
704
- InputDataConfig: _json,
705
- JobName: [],
706
- KMSKey: [],
707
- LanguageCode: [],
708
- OutputDataConfig: _json,
709
- });
710
- };
711
- const de_Attribute = (output, context) => {
712
- return take(output, {
713
- BeginOffset: __expectInt32,
714
- Category: __expectString,
715
- EndOffset: __expectInt32,
716
- Id: __expectInt32,
717
- RelationshipScore: __limitedParseFloat32,
718
- RelationshipType: __expectString,
719
- Score: __limitedParseFloat32,
720
- Text: __expectString,
721
- Traits: (_) => de_TraitList(_, context),
722
- Type: __expectString,
723
- });
724
- };
725
- const de_AttributeList = (output, context) => {
726
- const retVal = (output || [])
727
- .filter((e) => e != null)
728
- .map((entry) => {
729
- return de_Attribute(entry, context);
730
- });
731
- return retVal;
732
- };
733
- const de_ComprehendMedicalAsyncJobProperties = (output, context) => {
734
- return take(output, {
735
- DataAccessRoleArn: __expectString,
736
- EndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
737
- ExpirationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
738
- InputDataConfig: _json,
739
- JobId: __expectString,
740
- JobName: __expectString,
741
- JobStatus: __expectString,
742
- KMSKey: __expectString,
743
- LanguageCode: __expectString,
744
- ManifestFilePath: __expectString,
745
- Message: __expectString,
746
- ModelVersion: __expectString,
747
- OutputDataConfig: _json,
748
- SubmitTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
749
- });
750
- };
751
- const de_ComprehendMedicalAsyncJobPropertiesList = (output, context) => {
752
- const retVal = (output || [])
753
- .filter((e) => e != null)
754
- .map((entry) => {
755
- return de_ComprehendMedicalAsyncJobProperties(entry, context);
756
- });
757
- return retVal;
758
- };
759
- const de_DescribeEntitiesDetectionV2JobResponse = (output, context) => {
760
- return take(output, {
761
- ComprehendMedicalAsyncJobProperties: (_) => de_ComprehendMedicalAsyncJobProperties(_, context),
762
- });
763
- };
764
- const de_DescribeICD10CMInferenceJobResponse = (output, context) => {
765
- return take(output, {
766
- ComprehendMedicalAsyncJobProperties: (_) => de_ComprehendMedicalAsyncJobProperties(_, context),
767
- });
768
- };
769
- const de_DescribePHIDetectionJobResponse = (output, context) => {
770
- return take(output, {
771
- ComprehendMedicalAsyncJobProperties: (_) => de_ComprehendMedicalAsyncJobProperties(_, context),
772
- });
773
- };
774
- const de_DescribeRxNormInferenceJobResponse = (output, context) => {
775
- return take(output, {
776
- ComprehendMedicalAsyncJobProperties: (_) => de_ComprehendMedicalAsyncJobProperties(_, context),
777
- });
778
- };
779
- const de_DescribeSNOMEDCTInferenceJobResponse = (output, context) => {
780
- return take(output, {
781
- ComprehendMedicalAsyncJobProperties: (_) => de_ComprehendMedicalAsyncJobProperties(_, context),
782
- });
783
- };
784
- const de_DetectEntitiesResponse = (output, context) => {
785
- return take(output, {
786
- Entities: (_) => de_EntityList(_, context),
787
- ModelVersion: __expectString,
788
- PaginationToken: __expectString,
789
- UnmappedAttributes: (_) => de_UnmappedAttributeList(_, context),
790
- });
791
- };
792
- const de_DetectEntitiesV2Response = (output, context) => {
793
- return take(output, {
794
- Entities: (_) => de_EntityList(_, context),
795
- ModelVersion: __expectString,
796
- PaginationToken: __expectString,
797
- UnmappedAttributes: (_) => de_UnmappedAttributeList(_, context),
798
- });
799
- };
800
- const de_DetectPHIResponse = (output, context) => {
801
- return take(output, {
802
- Entities: (_) => de_EntityList(_, context),
803
- ModelVersion: __expectString,
804
- PaginationToken: __expectString,
805
- });
806
- };
807
- const de_Entity = (output, context) => {
808
- return take(output, {
809
- Attributes: (_) => de_AttributeList(_, context),
810
- BeginOffset: __expectInt32,
811
- Category: __expectString,
812
- EndOffset: __expectInt32,
813
- Id: __expectInt32,
814
- Score: __limitedParseFloat32,
815
- Text: __expectString,
816
- Traits: (_) => de_TraitList(_, context),
817
- Type: __expectString,
818
- });
819
- };
820
- const de_EntityList = (output, context) => {
821
- const retVal = (output || [])
822
- .filter((e) => e != null)
823
- .map((entry) => {
824
- return de_Entity(entry, context);
825
- });
826
- return retVal;
827
- };
828
- const de_ICD10CMAttribute = (output, context) => {
829
- return take(output, {
830
- BeginOffset: __expectInt32,
831
- Category: __expectString,
832
- EndOffset: __expectInt32,
833
- Id: __expectInt32,
834
- RelationshipScore: __limitedParseFloat32,
835
- RelationshipType: __expectString,
836
- Score: __limitedParseFloat32,
837
- Text: __expectString,
838
- Traits: (_) => de_ICD10CMTraitList(_, context),
839
- Type: __expectString,
840
- });
841
- };
842
- const de_ICD10CMAttributeList = (output, context) => {
843
- const retVal = (output || [])
844
- .filter((e) => e != null)
845
- .map((entry) => {
846
- return de_ICD10CMAttribute(entry, context);
847
- });
848
- return retVal;
849
- };
850
- const de_ICD10CMConcept = (output, context) => {
851
- return take(output, {
852
- Code: __expectString,
853
- Description: __expectString,
854
- Score: __limitedParseFloat32,
855
- });
856
- };
857
- const de_ICD10CMConceptList = (output, context) => {
858
- const retVal = (output || [])
859
- .filter((e) => e != null)
860
- .map((entry) => {
861
- return de_ICD10CMConcept(entry, context);
862
- });
863
- return retVal;
864
- };
865
- const de_ICD10CMEntity = (output, context) => {
866
- return take(output, {
867
- Attributes: (_) => de_ICD10CMAttributeList(_, context),
868
- BeginOffset: __expectInt32,
869
- Category: __expectString,
870
- EndOffset: __expectInt32,
871
- ICD10CMConcepts: (_) => de_ICD10CMConceptList(_, context),
872
- Id: __expectInt32,
873
- Score: __limitedParseFloat32,
874
- Text: __expectString,
875
- Traits: (_) => de_ICD10CMTraitList(_, context),
876
- Type: __expectString,
877
- });
878
- };
879
- const de_ICD10CMEntityList = (output, context) => {
880
- const retVal = (output || [])
881
- .filter((e) => e != null)
882
- .map((entry) => {
883
- return de_ICD10CMEntity(entry, context);
884
- });
885
- return retVal;
886
- };
887
- const de_ICD10CMTrait = (output, context) => {
888
- return take(output, {
889
- Name: __expectString,
890
- Score: __limitedParseFloat32,
891
- });
892
- };
893
- const de_ICD10CMTraitList = (output, context) => {
894
- const retVal = (output || [])
895
- .filter((e) => e != null)
896
- .map((entry) => {
897
- return de_ICD10CMTrait(entry, context);
898
- });
899
- return retVal;
900
- };
901
- const de_InferICD10CMResponse = (output, context) => {
902
- return take(output, {
903
- Entities: (_) => de_ICD10CMEntityList(_, context),
904
- ModelVersion: __expectString,
905
- PaginationToken: __expectString,
906
- });
907
- };
908
- const de_InferRxNormResponse = (output, context) => {
909
- return take(output, {
910
- Entities: (_) => de_RxNormEntityList(_, context),
911
- ModelVersion: __expectString,
912
- PaginationToken: __expectString,
913
- });
914
- };
915
- const de_InferSNOMEDCTResponse = (output, context) => {
916
- return take(output, {
917
- Characters: _json,
918
- Entities: (_) => de_SNOMEDCTEntityList(_, context),
919
- ModelVersion: __expectString,
920
- PaginationToken: __expectString,
921
- SNOMEDCTDetails: _json,
922
- });
923
- };
924
- const de_ListEntitiesDetectionV2JobsResponse = (output, context) => {
925
- return take(output, {
926
- ComprehendMedicalAsyncJobPropertiesList: (_) => de_ComprehendMedicalAsyncJobPropertiesList(_, context),
927
- NextToken: __expectString,
928
- });
929
- };
930
- const de_ListICD10CMInferenceJobsResponse = (output, context) => {
931
- return take(output, {
932
- ComprehendMedicalAsyncJobPropertiesList: (_) => de_ComprehendMedicalAsyncJobPropertiesList(_, context),
933
- NextToken: __expectString,
934
- });
935
- };
936
- const de_ListPHIDetectionJobsResponse = (output, context) => {
937
- return take(output, {
938
- ComprehendMedicalAsyncJobPropertiesList: (_) => de_ComprehendMedicalAsyncJobPropertiesList(_, context),
939
- NextToken: __expectString,
940
- });
941
- };
942
- const de_ListRxNormInferenceJobsResponse = (output, context) => {
943
- return take(output, {
944
- ComprehendMedicalAsyncJobPropertiesList: (_) => de_ComprehendMedicalAsyncJobPropertiesList(_, context),
945
- NextToken: __expectString,
946
- });
947
- };
948
- const de_ListSNOMEDCTInferenceJobsResponse = (output, context) => {
949
- return take(output, {
950
- ComprehendMedicalAsyncJobPropertiesList: (_) => de_ComprehendMedicalAsyncJobPropertiesList(_, context),
951
- NextToken: __expectString,
952
- });
953
- };
954
- const de_RxNormAttribute = (output, context) => {
955
- return take(output, {
956
- BeginOffset: __expectInt32,
957
- EndOffset: __expectInt32,
958
- Id: __expectInt32,
959
- RelationshipScore: __limitedParseFloat32,
960
- Score: __limitedParseFloat32,
961
- Text: __expectString,
962
- Traits: (_) => de_RxNormTraitList(_, context),
963
- Type: __expectString,
964
- });
965
- };
966
- const de_RxNormAttributeList = (output, context) => {
967
- const retVal = (output || [])
968
- .filter((e) => e != null)
969
- .map((entry) => {
970
- return de_RxNormAttribute(entry, context);
971
- });
972
- return retVal;
973
- };
974
- const de_RxNormConcept = (output, context) => {
975
- return take(output, {
976
- Code: __expectString,
977
- Description: __expectString,
978
- Score: __limitedParseFloat32,
979
- });
980
- };
981
- const de_RxNormConceptList = (output, context) => {
982
- const retVal = (output || [])
983
- .filter((e) => e != null)
984
- .map((entry) => {
985
- return de_RxNormConcept(entry, context);
986
- });
987
- return retVal;
988
- };
989
- const de_RxNormEntity = (output, context) => {
990
- return take(output, {
991
- Attributes: (_) => de_RxNormAttributeList(_, context),
992
- BeginOffset: __expectInt32,
993
- Category: __expectString,
994
- EndOffset: __expectInt32,
995
- Id: __expectInt32,
996
- RxNormConcepts: (_) => de_RxNormConceptList(_, context),
997
- Score: __limitedParseFloat32,
998
- Text: __expectString,
999
- Traits: (_) => de_RxNormTraitList(_, context),
1000
- Type: __expectString,
1001
- });
1002
- };
1003
- const de_RxNormEntityList = (output, context) => {
1004
- const retVal = (output || [])
1005
- .filter((e) => e != null)
1006
- .map((entry) => {
1007
- return de_RxNormEntity(entry, context);
1008
- });
1009
- return retVal;
1010
- };
1011
- const de_RxNormTrait = (output, context) => {
1012
- return take(output, {
1013
- Name: __expectString,
1014
- Score: __limitedParseFloat32,
1015
- });
1016
- };
1017
- const de_RxNormTraitList = (output, context) => {
1018
- const retVal = (output || [])
1019
- .filter((e) => e != null)
1020
- .map((entry) => {
1021
- return de_RxNormTrait(entry, context);
1022
- });
1023
- return retVal;
1024
- };
1025
- const de_SNOMEDCTAttribute = (output, context) => {
1026
- return take(output, {
1027
- BeginOffset: __expectInt32,
1028
- Category: __expectString,
1029
- EndOffset: __expectInt32,
1030
- Id: __expectInt32,
1031
- RelationshipScore: __limitedParseFloat32,
1032
- RelationshipType: __expectString,
1033
- SNOMEDCTConcepts: (_) => de_SNOMEDCTConceptList(_, context),
1034
- Score: __limitedParseFloat32,
1035
- Text: __expectString,
1036
- Traits: (_) => de_SNOMEDCTTraitList(_, context),
1037
- Type: __expectString,
1038
- });
1039
- };
1040
- const de_SNOMEDCTAttributeList = (output, context) => {
1041
- const retVal = (output || [])
1042
- .filter((e) => e != null)
1043
- .map((entry) => {
1044
- return de_SNOMEDCTAttribute(entry, context);
1045
- });
1046
- return retVal;
1047
- };
1048
- const de_SNOMEDCTConcept = (output, context) => {
1049
- return take(output, {
1050
- Code: __expectString,
1051
- Description: __expectString,
1052
- Score: __limitedParseFloat32,
1053
- });
1054
- };
1055
- const de_SNOMEDCTConceptList = (output, context) => {
1056
- const retVal = (output || [])
1057
- .filter((e) => e != null)
1058
- .map((entry) => {
1059
- return de_SNOMEDCTConcept(entry, context);
1060
- });
1061
- return retVal;
1062
- };
1063
- const de_SNOMEDCTEntity = (output, context) => {
1064
- return take(output, {
1065
- Attributes: (_) => de_SNOMEDCTAttributeList(_, context),
1066
- BeginOffset: __expectInt32,
1067
- Category: __expectString,
1068
- EndOffset: __expectInt32,
1069
- Id: __expectInt32,
1070
- SNOMEDCTConcepts: (_) => de_SNOMEDCTConceptList(_, context),
1071
- Score: __limitedParseFloat32,
1072
- Text: __expectString,
1073
- Traits: (_) => de_SNOMEDCTTraitList(_, context),
1074
- Type: __expectString,
1075
- });
1076
- };
1077
- const de_SNOMEDCTEntityList = (output, context) => {
1078
- const retVal = (output || [])
1079
- .filter((e) => e != null)
1080
- .map((entry) => {
1081
- return de_SNOMEDCTEntity(entry, context);
1082
- });
1083
- return retVal;
1084
- };
1085
- const de_SNOMEDCTTrait = (output, context) => {
1086
- return take(output, {
1087
- Name: __expectString,
1088
- Score: __limitedParseFloat32,
1089
- });
1090
- };
1091
- const de_SNOMEDCTTraitList = (output, context) => {
1092
- const retVal = (output || [])
1093
- .filter((e) => e != null)
1094
- .map((entry) => {
1095
- return de_SNOMEDCTTrait(entry, context);
1096
- });
1097
- return retVal;
1098
- };
1099
- const de_Trait = (output, context) => {
1100
- return take(output, {
1101
- Name: __expectString,
1102
- Score: __limitedParseFloat32,
1103
- });
1104
- };
1105
- const de_TraitList = (output, context) => {
1106
- const retVal = (output || [])
1107
- .filter((e) => e != null)
1108
- .map((entry) => {
1109
- return de_Trait(entry, context);
1110
- });
1111
- return retVal;
1112
- };
1113
- const de_UnmappedAttribute = (output, context) => {
1114
- return take(output, {
1115
- Attribute: (_) => de_Attribute(_, context),
1116
- Type: __expectString,
1117
- });
1118
- };
1119
- const de_UnmappedAttributeList = (output, context) => {
1120
- const retVal = (output || [])
1121
- .filter((e) => e != null)
1122
- .map((entry) => {
1123
- return de_UnmappedAttribute(entry, context);
1124
- });
1125
- return retVal;
1126
- };
1127
- const deserializeMetadata = (output) => ({
1128
- httpStatusCode: output.statusCode,
1129
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1130
- extendedRequestId: output.headers["x-amz-id-2"],
1131
- cfId: output.headers["x-amz-cf-id"],
1132
- });
1133
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1134
- const throwDefaultError = withBaseException(__BaseException);
1135
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1136
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1137
- const contents = {
1138
- protocol,
1139
- hostname,
1140
- port,
1141
- method: "POST",
1142
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1143
- headers,
1144
- };
1145
- if (resolvedHostname !== undefined) {
1146
- contents.hostname = resolvedHostname;
1147
- }
1148
- if (body !== undefined) {
1149
- contents.body = body;
1150
- }
1151
- return new __HttpRequest(contents);
1152
- };
1153
- function sharedHeaders(operation) {
1154
- return {
1155
- "content-type": "application/x-amz-json-1.1",
1156
- "x-amz-target": `ComprehendMedical_20181030.${operation}`,
1157
- };
1158
- }