@aws-sdk/client-medical-imaging 3.928.0 → 3.930.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 (46) hide show
  1. package/dist-cjs/index.js +1109 -1233
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/MedicalImagingClient.js +2 -0
  4. package/dist-es/commands/CopyImageSetCommand.js +3 -10
  5. package/dist-es/commands/CreateDatastoreCommand.js +3 -9
  6. package/dist-es/commands/DeleteDatastoreCommand.js +3 -9
  7. package/dist-es/commands/DeleteImageSetCommand.js +3 -9
  8. package/dist-es/commands/GetDICOMImportJobCommand.js +3 -9
  9. package/dist-es/commands/GetDatastoreCommand.js +3 -9
  10. package/dist-es/commands/GetImageFrameCommand.js +3 -10
  11. package/dist-es/commands/GetImageSetCommand.js +3 -9
  12. package/dist-es/commands/GetImageSetMetadataCommand.js +3 -10
  13. package/dist-es/commands/ListDICOMImportJobsCommand.js +3 -9
  14. package/dist-es/commands/ListDatastoresCommand.js +3 -9
  15. package/dist-es/commands/ListImageSetVersionsCommand.js +3 -9
  16. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  17. package/dist-es/commands/SearchImageSetsCommand.js +3 -10
  18. package/dist-es/commands/StartDICOMImportJobCommand.js +3 -9
  19. package/dist-es/commands/TagResourceCommand.js +3 -9
  20. package/dist-es/commands/UntagResourceCommand.js +3 -9
  21. package/dist-es/commands/UpdateImageSetMetadataCommand.js +3 -10
  22. package/dist-es/models/models_0.js +8 -144
  23. package/dist-es/runtimeConfig.shared.js +2 -0
  24. package/dist-es/schemas/schemas_0.js +1055 -0
  25. package/dist-types/MedicalImagingClient.d.ts +10 -1
  26. package/dist-types/commands/CreateDatastoreCommand.d.ts +1 -0
  27. package/dist-types/commands/GetDatastoreCommand.d.ts +1 -0
  28. package/dist-types/commands/GetImageSetCommand.d.ts +2 -0
  29. package/dist-types/commands/SearchImageSetsCommand.d.ts +2 -0
  30. package/dist-types/models/models_0.d.ts +68 -70
  31. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  32. package/dist-types/runtimeConfig.d.ts +1 -0
  33. package/dist-types/runtimeConfig.native.d.ts +1 -0
  34. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  35. package/dist-types/schemas/schemas_0.d.ts +112 -0
  36. package/dist-types/ts3.4/MedicalImagingClient.d.ts +4 -0
  37. package/dist-types/ts3.4/models/models_0.d.ts +17 -47
  38. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  39. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  40. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  41. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  42. package/dist-types/ts3.4/schemas/schemas_0.d.ts +118 -0
  43. package/package.json +34 -35
  44. package/dist-es/protocols/Aws_restJson1.js +0 -940
  45. package/dist-types/protocols/Aws_restJson1.d.ts +0 -164
  46. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -224
@@ -1,940 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { isValidHostname as __isValidHostname, } from "@smithy/protocol-http";
4
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
5
- import { v4 as generateIdempotencyToken } from "@smithy/uuid";
6
- import { MedicalImagingServiceException as __BaseException } from "../models/MedicalImagingServiceException";
7
- import { AccessDeniedException, ConflictException, InternalServerException, MetadataUpdates, ResourceNotFoundException, SearchByAttributeValue, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
8
- export const se_CopyImageSetCommand = async (input, context) => {
9
- const b = rb(input, context);
10
- const headers = {
11
- "content-type": "application/json",
12
- };
13
- b.bp("/datastore/{datastoreId}/imageSet/{sourceImageSetId}/copyImageSet");
14
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
15
- b.p("sourceImageSetId", () => input.sourceImageSetId, "{sourceImageSetId}", false);
16
- const query = map({
17
- [_f]: [() => input.force !== void 0, () => input[_f].toString()],
18
- [_pTP]: [() => input.promoteToPrimary !== void 0, () => input[_pTP].toString()],
19
- });
20
- let body;
21
- if (input.copyImageSetInformation !== undefined) {
22
- body = _json(input.copyImageSetInformation);
23
- }
24
- if (body === undefined) {
25
- body = {};
26
- }
27
- body = JSON.stringify(body);
28
- let { hostname: resolvedHostname } = await context.endpoint();
29
- if (context.disableHostPrefix !== true) {
30
- resolvedHostname = "runtime-" + resolvedHostname;
31
- if (!__isValidHostname(resolvedHostname)) {
32
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
33
- }
34
- }
35
- b.hn(resolvedHostname);
36
- b.m("POST").h(headers).q(query).b(body);
37
- return b.build();
38
- };
39
- export const se_CreateDatastoreCommand = async (input, context) => {
40
- const b = rb(input, context);
41
- const headers = {
42
- "content-type": "application/json",
43
- };
44
- b.bp("/datastore");
45
- let body;
46
- body = JSON.stringify(take(input, {
47
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
48
- datastoreName: [],
49
- kmsKeyArn: [],
50
- lambdaAuthorizerArn: [],
51
- tags: (_) => _json(_),
52
- }));
53
- b.m("POST").h(headers).b(body);
54
- return b.build();
55
- };
56
- export const se_DeleteDatastoreCommand = async (input, context) => {
57
- const b = rb(input, context);
58
- const headers = {};
59
- b.bp("/datastore/{datastoreId}");
60
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
61
- let body;
62
- b.m("DELETE").h(headers).b(body);
63
- return b.build();
64
- };
65
- export const se_DeleteImageSetCommand = async (input, context) => {
66
- const b = rb(input, context);
67
- const headers = {};
68
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/deleteImageSet");
69
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
70
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
71
- let body;
72
- let { hostname: resolvedHostname } = await context.endpoint();
73
- if (context.disableHostPrefix !== true) {
74
- resolvedHostname = "runtime-" + resolvedHostname;
75
- if (!__isValidHostname(resolvedHostname)) {
76
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
77
- }
78
- }
79
- b.hn(resolvedHostname);
80
- b.m("POST").h(headers).b(body);
81
- return b.build();
82
- };
83
- export const se_GetDatastoreCommand = async (input, context) => {
84
- const b = rb(input, context);
85
- const headers = {};
86
- b.bp("/datastore/{datastoreId}");
87
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
88
- let body;
89
- b.m("GET").h(headers).b(body);
90
- return b.build();
91
- };
92
- export const se_GetDICOMImportJobCommand = async (input, context) => {
93
- const b = rb(input, context);
94
- const headers = {};
95
- b.bp("/getDICOMImportJob/datastore/{datastoreId}/job/{jobId}");
96
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
97
- b.p("jobId", () => input.jobId, "{jobId}", false);
98
- let body;
99
- b.m("GET").h(headers).b(body);
100
- return b.build();
101
- };
102
- export const se_GetImageFrameCommand = async (input, context) => {
103
- const b = rb(input, context);
104
- const headers = {
105
- "content-type": "application/json",
106
- };
107
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/getImageFrame");
108
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
109
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
110
- let body;
111
- if (input.imageFrameInformation !== undefined) {
112
- body = _json(input.imageFrameInformation);
113
- }
114
- if (body === undefined) {
115
- body = {};
116
- }
117
- body = JSON.stringify(body);
118
- let { hostname: resolvedHostname } = await context.endpoint();
119
- if (context.disableHostPrefix !== true) {
120
- resolvedHostname = "runtime-" + resolvedHostname;
121
- if (!__isValidHostname(resolvedHostname)) {
122
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
123
- }
124
- }
125
- b.hn(resolvedHostname);
126
- b.m("POST").h(headers).b(body);
127
- return b.build();
128
- };
129
- export const se_GetImageSetCommand = async (input, context) => {
130
- const b = rb(input, context);
131
- const headers = {};
132
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSet");
133
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
134
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
135
- const query = map({
136
- [_v]: [, input[_vI]],
137
- });
138
- let body;
139
- let { hostname: resolvedHostname } = await context.endpoint();
140
- if (context.disableHostPrefix !== true) {
141
- resolvedHostname = "runtime-" + resolvedHostname;
142
- if (!__isValidHostname(resolvedHostname)) {
143
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
144
- }
145
- }
146
- b.hn(resolvedHostname);
147
- b.m("POST").h(headers).q(query).b(body);
148
- return b.build();
149
- };
150
- export const se_GetImageSetMetadataCommand = async (input, context) => {
151
- const b = rb(input, context);
152
- const headers = {};
153
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSetMetadata");
154
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
155
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
156
- const query = map({
157
- [_v]: [, input[_vI]],
158
- });
159
- let body;
160
- let { hostname: resolvedHostname } = await context.endpoint();
161
- if (context.disableHostPrefix !== true) {
162
- resolvedHostname = "runtime-" + resolvedHostname;
163
- if (!__isValidHostname(resolvedHostname)) {
164
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
165
- }
166
- }
167
- b.hn(resolvedHostname);
168
- b.m("POST").h(headers).q(query).b(body);
169
- return b.build();
170
- };
171
- export const se_ListDatastoresCommand = async (input, context) => {
172
- const b = rb(input, context);
173
- const headers = {};
174
- b.bp("/datastore");
175
- const query = map({
176
- [_dS]: [, input[_dS]],
177
- [_nT]: [, input[_nT]],
178
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
179
- });
180
- let body;
181
- b.m("GET").h(headers).q(query).b(body);
182
- return b.build();
183
- };
184
- export const se_ListDICOMImportJobsCommand = async (input, context) => {
185
- const b = rb(input, context);
186
- const headers = {};
187
- b.bp("/listDICOMImportJobs/datastore/{datastoreId}");
188
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
189
- const query = map({
190
- [_jS]: [, input[_jS]],
191
- [_nT]: [, input[_nT]],
192
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
193
- });
194
- let body;
195
- b.m("GET").h(headers).q(query).b(body);
196
- return b.build();
197
- };
198
- export const se_ListImageSetVersionsCommand = async (input, context) => {
199
- const b = rb(input, context);
200
- const headers = {};
201
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/listImageSetVersions");
202
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
203
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
204
- const query = map({
205
- [_nT]: [, input[_nT]],
206
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
207
- });
208
- let body;
209
- let { hostname: resolvedHostname } = await context.endpoint();
210
- if (context.disableHostPrefix !== true) {
211
- resolvedHostname = "runtime-" + resolvedHostname;
212
- if (!__isValidHostname(resolvedHostname)) {
213
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
214
- }
215
- }
216
- b.hn(resolvedHostname);
217
- b.m("POST").h(headers).q(query).b(body);
218
- return b.build();
219
- };
220
- export const se_ListTagsForResourceCommand = async (input, context) => {
221
- const b = rb(input, context);
222
- const headers = {};
223
- b.bp("/tags/{resourceArn}");
224
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
225
- let body;
226
- b.m("GET").h(headers).b(body);
227
- return b.build();
228
- };
229
- export const se_SearchImageSetsCommand = async (input, context) => {
230
- const b = rb(input, context);
231
- const headers = {
232
- "content-type": "application/json",
233
- };
234
- b.bp("/datastore/{datastoreId}/searchImageSets");
235
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
236
- const query = map({
237
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
238
- [_nT]: [, input[_nT]],
239
- });
240
- let body;
241
- if (input.searchCriteria !== undefined) {
242
- body = se_SearchCriteria(input.searchCriteria, context);
243
- }
244
- if (body === undefined) {
245
- body = {};
246
- }
247
- body = JSON.stringify(body);
248
- let { hostname: resolvedHostname } = await context.endpoint();
249
- if (context.disableHostPrefix !== true) {
250
- resolvedHostname = "runtime-" + resolvedHostname;
251
- if (!__isValidHostname(resolvedHostname)) {
252
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
253
- }
254
- }
255
- b.hn(resolvedHostname);
256
- b.m("POST").h(headers).q(query).b(body);
257
- return b.build();
258
- };
259
- export const se_StartDICOMImportJobCommand = async (input, context) => {
260
- const b = rb(input, context);
261
- const headers = {
262
- "content-type": "application/json",
263
- };
264
- b.bp("/startDICOMImportJob/datastore/{datastoreId}");
265
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
266
- let body;
267
- body = JSON.stringify(take(input, {
268
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
269
- dataAccessRoleArn: [],
270
- inputOwnerAccountId: [],
271
- inputS3Uri: [],
272
- jobName: [],
273
- outputS3Uri: [],
274
- }));
275
- b.m("POST").h(headers).b(body);
276
- return b.build();
277
- };
278
- export const se_TagResourceCommand = async (input, context) => {
279
- const b = rb(input, context);
280
- const headers = {
281
- "content-type": "application/json",
282
- };
283
- b.bp("/tags/{resourceArn}");
284
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
285
- let body;
286
- body = JSON.stringify(take(input, {
287
- tags: (_) => _json(_),
288
- }));
289
- b.m("POST").h(headers).b(body);
290
- return b.build();
291
- };
292
- export const se_UntagResourceCommand = async (input, context) => {
293
- const b = rb(input, context);
294
- const headers = {};
295
- b.bp("/tags/{resourceArn}");
296
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
297
- const query = map({
298
- [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK] || []],
299
- });
300
- let body;
301
- b.m("DELETE").h(headers).q(query).b(body);
302
- return b.build();
303
- };
304
- export const se_UpdateImageSetMetadataCommand = async (input, context) => {
305
- const b = rb(input, context);
306
- const headers = {
307
- "content-type": "application/json",
308
- };
309
- b.bp("/datastore/{datastoreId}/imageSet/{imageSetId}/updateImageSetMetadata");
310
- b.p("datastoreId", () => input.datastoreId, "{datastoreId}", false);
311
- b.p("imageSetId", () => input.imageSetId, "{imageSetId}", false);
312
- const query = map({
313
- [_lV]: [, __expectNonNull(input[_lVI], `latestVersionId`)],
314
- [_f]: [() => input.force !== void 0, () => input[_f].toString()],
315
- });
316
- let body;
317
- if (input.updateImageSetMetadataUpdates !== undefined) {
318
- body = se_MetadataUpdates(input.updateImageSetMetadataUpdates, context);
319
- }
320
- if (body === undefined) {
321
- body = {};
322
- }
323
- body = JSON.stringify(body);
324
- let { hostname: resolvedHostname } = await context.endpoint();
325
- if (context.disableHostPrefix !== true) {
326
- resolvedHostname = "runtime-" + resolvedHostname;
327
- if (!__isValidHostname(resolvedHostname)) {
328
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
329
- }
330
- }
331
- b.hn(resolvedHostname);
332
- b.m("POST").h(headers).q(query).b(body);
333
- return b.build();
334
- };
335
- export const de_CopyImageSetCommand = async (output, context) => {
336
- if (output.statusCode !== 200 && output.statusCode >= 300) {
337
- return de_CommandError(output, context);
338
- }
339
- const contents = map({
340
- $metadata: deserializeMetadata(output),
341
- });
342
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
343
- const doc = take(data, {
344
- datastoreId: __expectString,
345
- destinationImageSetProperties: (_) => de_CopyDestinationImageSetProperties(_, context),
346
- sourceImageSetProperties: (_) => de_CopySourceImageSetProperties(_, context),
347
- });
348
- Object.assign(contents, doc);
349
- return contents;
350
- };
351
- export const de_CreateDatastoreCommand = async (output, context) => {
352
- if (output.statusCode !== 200 && output.statusCode >= 300) {
353
- return de_CommandError(output, context);
354
- }
355
- const contents = map({
356
- $metadata: deserializeMetadata(output),
357
- });
358
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
359
- const doc = take(data, {
360
- datastoreId: __expectString,
361
- datastoreStatus: __expectString,
362
- });
363
- Object.assign(contents, doc);
364
- return contents;
365
- };
366
- export const de_DeleteDatastoreCommand = async (output, context) => {
367
- if (output.statusCode !== 200 && output.statusCode >= 300) {
368
- return de_CommandError(output, context);
369
- }
370
- const contents = map({
371
- $metadata: deserializeMetadata(output),
372
- });
373
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
374
- const doc = take(data, {
375
- datastoreId: __expectString,
376
- datastoreStatus: __expectString,
377
- });
378
- Object.assign(contents, doc);
379
- return contents;
380
- };
381
- export const de_DeleteImageSetCommand = async (output, context) => {
382
- if (output.statusCode !== 200 && output.statusCode >= 300) {
383
- return de_CommandError(output, context);
384
- }
385
- const contents = map({
386
- $metadata: deserializeMetadata(output),
387
- });
388
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
389
- const doc = take(data, {
390
- datastoreId: __expectString,
391
- imageSetId: __expectString,
392
- imageSetState: __expectString,
393
- imageSetWorkflowStatus: __expectString,
394
- });
395
- Object.assign(contents, doc);
396
- return contents;
397
- };
398
- export const de_GetDatastoreCommand = async (output, context) => {
399
- if (output.statusCode !== 200 && output.statusCode >= 300) {
400
- return de_CommandError(output, context);
401
- }
402
- const contents = map({
403
- $metadata: deserializeMetadata(output),
404
- });
405
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
406
- const doc = take(data, {
407
- datastoreProperties: (_) => de_DatastoreProperties(_, context),
408
- });
409
- Object.assign(contents, doc);
410
- return contents;
411
- };
412
- export const de_GetDICOMImportJobCommand = async (output, context) => {
413
- if (output.statusCode !== 200 && output.statusCode >= 300) {
414
- return de_CommandError(output, context);
415
- }
416
- const contents = map({
417
- $metadata: deserializeMetadata(output),
418
- });
419
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
420
- const doc = take(data, {
421
- jobProperties: (_) => de_DICOMImportJobProperties(_, context),
422
- });
423
- Object.assign(contents, doc);
424
- return contents;
425
- };
426
- export const de_GetImageFrameCommand = async (output, context) => {
427
- if (output.statusCode !== 200 && output.statusCode >= 300) {
428
- return de_CommandError(output, context);
429
- }
430
- const contents = map({
431
- $metadata: deserializeMetadata(output),
432
- [_cT]: [, output.headers[_ct]],
433
- });
434
- const data = output.body;
435
- context.sdkStreamMixin(data);
436
- contents.imageFrameBlob = data;
437
- return contents;
438
- };
439
- export const de_GetImageSetCommand = async (output, context) => {
440
- if (output.statusCode !== 200 && output.statusCode >= 300) {
441
- return de_CommandError(output, context);
442
- }
443
- const contents = map({
444
- $metadata: deserializeMetadata(output),
445
- });
446
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
447
- const doc = take(data, {
448
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
449
- datastoreId: __expectString,
450
- deletedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
451
- imageSetArn: __expectString,
452
- imageSetId: __expectString,
453
- imageSetState: __expectString,
454
- imageSetWorkflowStatus: __expectString,
455
- isPrimary: __expectBoolean,
456
- message: __expectString,
457
- overrides: _json,
458
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
459
- versionId: __expectString,
460
- });
461
- Object.assign(contents, doc);
462
- return contents;
463
- };
464
- export const de_GetImageSetMetadataCommand = async (output, context) => {
465
- if (output.statusCode !== 200 && output.statusCode >= 300) {
466
- return de_CommandError(output, context);
467
- }
468
- const contents = map({
469
- $metadata: deserializeMetadata(output),
470
- [_cT]: [, output.headers[_ct]],
471
- [_cE]: [, output.headers[_ce]],
472
- });
473
- const data = output.body;
474
- context.sdkStreamMixin(data);
475
- contents.imageSetMetadataBlob = data;
476
- return contents;
477
- };
478
- export const de_ListDatastoresCommand = async (output, context) => {
479
- if (output.statusCode !== 200 && output.statusCode >= 300) {
480
- return de_CommandError(output, context);
481
- }
482
- const contents = map({
483
- $metadata: deserializeMetadata(output),
484
- });
485
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
486
- const doc = take(data, {
487
- datastoreSummaries: (_) => de_DatastoreSummaries(_, context),
488
- nextToken: __expectString,
489
- });
490
- Object.assign(contents, doc);
491
- return contents;
492
- };
493
- export const de_ListDICOMImportJobsCommand = async (output, context) => {
494
- if (output.statusCode !== 200 && output.statusCode >= 300) {
495
- return de_CommandError(output, context);
496
- }
497
- const contents = map({
498
- $metadata: deserializeMetadata(output),
499
- });
500
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
501
- const doc = take(data, {
502
- jobSummaries: (_) => de_DICOMImportJobSummaries(_, context),
503
- nextToken: __expectString,
504
- });
505
- Object.assign(contents, doc);
506
- return contents;
507
- };
508
- export const de_ListImageSetVersionsCommand = async (output, context) => {
509
- if (output.statusCode !== 200 && output.statusCode >= 300) {
510
- return de_CommandError(output, context);
511
- }
512
- const contents = map({
513
- $metadata: deserializeMetadata(output),
514
- });
515
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
516
- const doc = take(data, {
517
- imageSetPropertiesList: (_) => de_ImageSetPropertiesList(_, context),
518
- nextToken: __expectString,
519
- });
520
- Object.assign(contents, doc);
521
- return contents;
522
- };
523
- export const de_ListTagsForResourceCommand = async (output, context) => {
524
- if (output.statusCode !== 200 && output.statusCode >= 300) {
525
- return de_CommandError(output, context);
526
- }
527
- const contents = map({
528
- $metadata: deserializeMetadata(output),
529
- });
530
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
531
- const doc = take(data, {
532
- tags: _json,
533
- });
534
- Object.assign(contents, doc);
535
- return contents;
536
- };
537
- export const de_SearchImageSetsCommand = async (output, context) => {
538
- if (output.statusCode !== 200 && output.statusCode >= 300) {
539
- return de_CommandError(output, context);
540
- }
541
- const contents = map({
542
- $metadata: deserializeMetadata(output),
543
- });
544
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
545
- const doc = take(data, {
546
- imageSetsMetadataSummaries: (_) => de_ImageSetsMetadataSummaries(_, context),
547
- nextToken: __expectString,
548
- sort: _json,
549
- });
550
- Object.assign(contents, doc);
551
- return contents;
552
- };
553
- export const de_StartDICOMImportJobCommand = async (output, context) => {
554
- if (output.statusCode !== 200 && output.statusCode >= 300) {
555
- return de_CommandError(output, context);
556
- }
557
- const contents = map({
558
- $metadata: deserializeMetadata(output),
559
- });
560
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
561
- const doc = take(data, {
562
- datastoreId: __expectString,
563
- jobId: __expectString,
564
- jobStatus: __expectString,
565
- submittedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
566
- });
567
- Object.assign(contents, doc);
568
- return contents;
569
- };
570
- export const de_TagResourceCommand = async (output, context) => {
571
- if (output.statusCode !== 200 && output.statusCode >= 300) {
572
- return de_CommandError(output, context);
573
- }
574
- const contents = map({
575
- $metadata: deserializeMetadata(output),
576
- });
577
- await collectBody(output.body, context);
578
- return contents;
579
- };
580
- export const de_UntagResourceCommand = async (output, context) => {
581
- if (output.statusCode !== 200 && output.statusCode >= 300) {
582
- return de_CommandError(output, context);
583
- }
584
- const contents = map({
585
- $metadata: deserializeMetadata(output),
586
- });
587
- await collectBody(output.body, context);
588
- return contents;
589
- };
590
- export const de_UpdateImageSetMetadataCommand = async (output, context) => {
591
- if (output.statusCode !== 200 && output.statusCode >= 300) {
592
- return de_CommandError(output, context);
593
- }
594
- const contents = map({
595
- $metadata: deserializeMetadata(output),
596
- });
597
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
598
- const doc = take(data, {
599
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
600
- datastoreId: __expectString,
601
- imageSetId: __expectString,
602
- imageSetState: __expectString,
603
- imageSetWorkflowStatus: __expectString,
604
- latestVersionId: __expectString,
605
- message: __expectString,
606
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
607
- });
608
- Object.assign(contents, doc);
609
- return contents;
610
- };
611
- const de_CommandError = async (output, context) => {
612
- const parsedOutput = {
613
- ...output,
614
- body: await parseErrorBody(output.body, context),
615
- };
616
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
617
- switch (errorCode) {
618
- case "AccessDeniedException":
619
- case "com.amazonaws.medicalimaging#AccessDeniedException":
620
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
621
- case "ConflictException":
622
- case "com.amazonaws.medicalimaging#ConflictException":
623
- throw await de_ConflictExceptionRes(parsedOutput, context);
624
- case "InternalServerException":
625
- case "com.amazonaws.medicalimaging#InternalServerException":
626
- throw await de_InternalServerExceptionRes(parsedOutput, context);
627
- case "ResourceNotFoundException":
628
- case "com.amazonaws.medicalimaging#ResourceNotFoundException":
629
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
630
- case "ServiceQuotaExceededException":
631
- case "com.amazonaws.medicalimaging#ServiceQuotaExceededException":
632
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
633
- case "ThrottlingException":
634
- case "com.amazonaws.medicalimaging#ThrottlingException":
635
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
636
- case "ValidationException":
637
- case "com.amazonaws.medicalimaging#ValidationException":
638
- throw await de_ValidationExceptionRes(parsedOutput, context);
639
- default:
640
- const parsedBody = parsedOutput.body;
641
- return throwDefaultError({
642
- output,
643
- parsedBody,
644
- errorCode,
645
- });
646
- }
647
- };
648
- const throwDefaultError = withBaseException(__BaseException);
649
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
650
- const contents = map({});
651
- const data = parsedOutput.body;
652
- const doc = take(data, {
653
- message: __expectString,
654
- });
655
- Object.assign(contents, doc);
656
- const exception = new AccessDeniedException({
657
- $metadata: deserializeMetadata(parsedOutput),
658
- ...contents,
659
- });
660
- return __decorateServiceException(exception, parsedOutput.body);
661
- };
662
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
663
- const contents = map({});
664
- const data = parsedOutput.body;
665
- const doc = take(data, {
666
- message: __expectString,
667
- });
668
- Object.assign(contents, doc);
669
- const exception = new ConflictException({
670
- $metadata: deserializeMetadata(parsedOutput),
671
- ...contents,
672
- });
673
- return __decorateServiceException(exception, parsedOutput.body);
674
- };
675
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
676
- const contents = map({});
677
- const data = parsedOutput.body;
678
- const doc = take(data, {
679
- message: __expectString,
680
- });
681
- Object.assign(contents, doc);
682
- const exception = new InternalServerException({
683
- $metadata: deserializeMetadata(parsedOutput),
684
- ...contents,
685
- });
686
- return __decorateServiceException(exception, parsedOutput.body);
687
- };
688
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
689
- const contents = map({});
690
- const data = parsedOutput.body;
691
- const doc = take(data, {
692
- message: __expectString,
693
- });
694
- Object.assign(contents, doc);
695
- const exception = new ResourceNotFoundException({
696
- $metadata: deserializeMetadata(parsedOutput),
697
- ...contents,
698
- });
699
- return __decorateServiceException(exception, parsedOutput.body);
700
- };
701
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
702
- const contents = map({});
703
- const data = parsedOutput.body;
704
- const doc = take(data, {
705
- message: __expectString,
706
- });
707
- Object.assign(contents, doc);
708
- const exception = new ServiceQuotaExceededException({
709
- $metadata: deserializeMetadata(parsedOutput),
710
- ...contents,
711
- });
712
- return __decorateServiceException(exception, parsedOutput.body);
713
- };
714
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
715
- const contents = map({});
716
- const data = parsedOutput.body;
717
- const doc = take(data, {
718
- message: __expectString,
719
- });
720
- Object.assign(contents, doc);
721
- const exception = new ThrottlingException({
722
- $metadata: deserializeMetadata(parsedOutput),
723
- ...contents,
724
- });
725
- return __decorateServiceException(exception, parsedOutput.body);
726
- };
727
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
728
- const contents = map({});
729
- const data = parsedOutput.body;
730
- const doc = take(data, {
731
- message: __expectString,
732
- });
733
- Object.assign(contents, doc);
734
- const exception = new ValidationException({
735
- $metadata: deserializeMetadata(parsedOutput),
736
- ...contents,
737
- });
738
- return __decorateServiceException(exception, parsedOutput.body);
739
- };
740
- const se_DICOMUpdates = (input, context) => {
741
- return take(input, {
742
- removableAttributes: context.base64Encoder,
743
- updatableAttributes: context.base64Encoder,
744
- });
745
- };
746
- const se_MetadataUpdates = (input, context) => {
747
- return MetadataUpdates.visit(input, {
748
- DICOMUpdates: (value) => ({ DICOMUpdates: se_DICOMUpdates(value, context) }),
749
- revertToVersionId: (value) => ({ revertToVersionId: value }),
750
- _: (name, value) => ({ [name]: value }),
751
- });
752
- };
753
- const se_SearchByAttributeValue = (input, context) => {
754
- return SearchByAttributeValue.visit(input, {
755
- DICOMAccessionNumber: (value) => ({ DICOMAccessionNumber: value }),
756
- DICOMPatientId: (value) => ({ DICOMPatientId: value }),
757
- DICOMSeriesInstanceUID: (value) => ({ DICOMSeriesInstanceUID: value }),
758
- DICOMStudyDateAndTime: (value) => ({ DICOMStudyDateAndTime: _json(value) }),
759
- DICOMStudyId: (value) => ({ DICOMStudyId: value }),
760
- DICOMStudyInstanceUID: (value) => ({ DICOMStudyInstanceUID: value }),
761
- createdAt: (value) => ({ createdAt: value.getTime() / 1_000 }),
762
- isPrimary: (value) => ({ isPrimary: value }),
763
- updatedAt: (value) => ({ updatedAt: value.getTime() / 1_000 }),
764
- _: (name, value) => ({ [name]: value }),
765
- });
766
- };
767
- const se_SearchByAttributeValues = (input, context) => {
768
- return input
769
- .filter((e) => e != null)
770
- .map((entry) => {
771
- return se_SearchByAttributeValue(entry, context);
772
- });
773
- };
774
- const se_SearchCriteria = (input, context) => {
775
- return take(input, {
776
- filters: (_) => se_SearchFilters(_, context),
777
- sort: _json,
778
- });
779
- };
780
- const se_SearchFilter = (input, context) => {
781
- return take(input, {
782
- operator: [],
783
- values: (_) => se_SearchByAttributeValues(_, context),
784
- });
785
- };
786
- const se_SearchFilters = (input, context) => {
787
- return input
788
- .filter((e) => e != null)
789
- .map((entry) => {
790
- return se_SearchFilter(entry, context);
791
- });
792
- };
793
- const de_CopyDestinationImageSetProperties = (output, context) => {
794
- return take(output, {
795
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
796
- imageSetArn: __expectString,
797
- imageSetId: __expectString,
798
- imageSetState: __expectString,
799
- imageSetWorkflowStatus: __expectString,
800
- latestVersionId: __expectString,
801
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
802
- });
803
- };
804
- const de_CopySourceImageSetProperties = (output, context) => {
805
- return take(output, {
806
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
807
- imageSetArn: __expectString,
808
- imageSetId: __expectString,
809
- imageSetState: __expectString,
810
- imageSetWorkflowStatus: __expectString,
811
- latestVersionId: __expectString,
812
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
813
- });
814
- };
815
- const de_DatastoreProperties = (output, context) => {
816
- return take(output, {
817
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
818
- datastoreArn: __expectString,
819
- datastoreId: __expectString,
820
- datastoreName: __expectString,
821
- datastoreStatus: __expectString,
822
- kmsKeyArn: __expectString,
823
- lambdaAuthorizerArn: __expectString,
824
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
825
- });
826
- };
827
- const de_DatastoreSummaries = (output, context) => {
828
- const retVal = (output || [])
829
- .filter((e) => e != null)
830
- .map((entry) => {
831
- return de_DatastoreSummary(entry, context);
832
- });
833
- return retVal;
834
- };
835
- const de_DatastoreSummary = (output, context) => {
836
- return take(output, {
837
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
838
- datastoreArn: __expectString,
839
- datastoreId: __expectString,
840
- datastoreName: __expectString,
841
- datastoreStatus: __expectString,
842
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
843
- });
844
- };
845
- const de_DICOMImportJobProperties = (output, context) => {
846
- return take(output, {
847
- dataAccessRoleArn: __expectString,
848
- datastoreId: __expectString,
849
- endedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
850
- inputS3Uri: __expectString,
851
- jobId: __expectString,
852
- jobName: __expectString,
853
- jobStatus: __expectString,
854
- message: __expectString,
855
- outputS3Uri: __expectString,
856
- submittedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
857
- });
858
- };
859
- const de_DICOMImportJobSummaries = (output, context) => {
860
- const retVal = (output || [])
861
- .filter((e) => e != null)
862
- .map((entry) => {
863
- return de_DICOMImportJobSummary(entry, context);
864
- });
865
- return retVal;
866
- };
867
- const de_DICOMImportJobSummary = (output, context) => {
868
- return take(output, {
869
- dataAccessRoleArn: __expectString,
870
- datastoreId: __expectString,
871
- endedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
872
- jobId: __expectString,
873
- jobName: __expectString,
874
- jobStatus: __expectString,
875
- message: __expectString,
876
- submittedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
877
- });
878
- };
879
- const de_ImageSetProperties = (output, context) => {
880
- return take(output, {
881
- ImageSetWorkflowStatus: __expectString,
882
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
883
- deletedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
884
- imageSetId: __expectString,
885
- imageSetState: __expectString,
886
- isPrimary: __expectBoolean,
887
- message: __expectString,
888
- overrides: _json,
889
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
890
- versionId: __expectString,
891
- });
892
- };
893
- const de_ImageSetPropertiesList = (output, context) => {
894
- const retVal = (output || [])
895
- .filter((e) => e != null)
896
- .map((entry) => {
897
- return de_ImageSetProperties(entry, context);
898
- });
899
- return retVal;
900
- };
901
- const de_ImageSetsMetadataSummaries = (output, context) => {
902
- const retVal = (output || [])
903
- .filter((e) => e != null)
904
- .map((entry) => {
905
- return de_ImageSetsMetadataSummary(entry, context);
906
- });
907
- return retVal;
908
- };
909
- const de_ImageSetsMetadataSummary = (output, context) => {
910
- return take(output, {
911
- DICOMTags: _json,
912
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
913
- imageSetId: __expectString,
914
- isPrimary: __expectBoolean,
915
- updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
916
- version: __expectInt32,
917
- });
918
- };
919
- const deserializeMetadata = (output) => ({
920
- httpStatusCode: output.statusCode,
921
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
922
- extendedRequestId: output.headers["x-amz-id-2"],
923
- cfId: output.headers["x-amz-cf-id"],
924
- });
925
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
926
- const _cE = "contentEncoding";
927
- const _cT = "contentType";
928
- const _ce = "content-encoding";
929
- const _ct = "content-type";
930
- const _dS = "datastoreStatus";
931
- const _f = "force";
932
- const _jS = "jobStatus";
933
- const _lV = "latestVersion";
934
- const _lVI = "latestVersionId";
935
- const _mR = "maxResults";
936
- const _nT = "nextToken";
937
- const _pTP = "promoteToPrimary";
938
- const _tK = "tagKeys";
939
- const _v = "version";
940
- const _vI = "versionId";