@aws-sdk/client-medical-imaging 3.373.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 (159) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +498 -0
  3. package/dist-cjs/MedicalImaging.js +47 -0
  4. package/dist-cjs/MedicalImagingClient.js +41 -0
  5. package/dist-cjs/commands/CopyImageSetCommand.js +46 -0
  6. package/dist-cjs/commands/CreateDatastoreCommand.js +46 -0
  7. package/dist-cjs/commands/DeleteDatastoreCommand.js +46 -0
  8. package/dist-cjs/commands/DeleteImageSetCommand.js +46 -0
  9. package/dist-cjs/commands/GetDICOMImportJobCommand.js +46 -0
  10. package/dist-cjs/commands/GetDatastoreCommand.js +46 -0
  11. package/dist-cjs/commands/GetImageFrameCommand.js +47 -0
  12. package/dist-cjs/commands/GetImageSetCommand.js +46 -0
  13. package/dist-cjs/commands/GetImageSetMetadataCommand.js +47 -0
  14. package/dist-cjs/commands/ListDICOMImportJobsCommand.js +46 -0
  15. package/dist-cjs/commands/ListDatastoresCommand.js +46 -0
  16. package/dist-cjs/commands/ListImageSetVersionsCommand.js +46 -0
  17. package/dist-cjs/commands/ListTagsForResourceCommand.js +46 -0
  18. package/dist-cjs/commands/SearchImageSetsCommand.js +47 -0
  19. package/dist-cjs/commands/StartDICOMImportJobCommand.js +46 -0
  20. package/dist-cjs/commands/TagResourceCommand.js +46 -0
  21. package/dist-cjs/commands/UntagResourceCommand.js +46 -0
  22. package/dist-cjs/commands/UpdateImageSetMetadataCommand.js +47 -0
  23. package/dist-cjs/commands/index.js +21 -0
  24. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  25. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  26. package/dist-cjs/endpoint/ruleset.js +7 -0
  27. package/dist-cjs/index.js +11 -0
  28. package/dist-cjs/models/MedicalImagingServiceException.js +12 -0
  29. package/dist-cjs/models/index.js +4 -0
  30. package/dist-cjs/models/models_0.js +248 -0
  31. package/dist-cjs/pagination/Interfaces.js +2 -0
  32. package/dist-cjs/pagination/ListDICOMImportJobsPaginator.js +29 -0
  33. package/dist-cjs/pagination/ListDatastoresPaginator.js +29 -0
  34. package/dist-cjs/pagination/ListImageSetVersionsPaginator.js +29 -0
  35. package/dist-cjs/pagination/SearchImageSetsPaginator.js +29 -0
  36. package/dist-cjs/pagination/index.js +8 -0
  37. package/dist-cjs/protocols/Aws_restJson1.js +1693 -0
  38. package/dist-cjs/runtimeConfig.browser.js +39 -0
  39. package/dist-cjs/runtimeConfig.js +48 -0
  40. package/dist-cjs/runtimeConfig.native.js +15 -0
  41. package/dist-cjs/runtimeConfig.shared.js +23 -0
  42. package/dist-es/MedicalImaging.js +43 -0
  43. package/dist-es/MedicalImagingClient.js +37 -0
  44. package/dist-es/commands/CopyImageSetCommand.js +42 -0
  45. package/dist-es/commands/CreateDatastoreCommand.js +42 -0
  46. package/dist-es/commands/DeleteDatastoreCommand.js +42 -0
  47. package/dist-es/commands/DeleteImageSetCommand.js +42 -0
  48. package/dist-es/commands/GetDICOMImportJobCommand.js +42 -0
  49. package/dist-es/commands/GetDatastoreCommand.js +42 -0
  50. package/dist-es/commands/GetImageFrameCommand.js +43 -0
  51. package/dist-es/commands/GetImageSetCommand.js +42 -0
  52. package/dist-es/commands/GetImageSetMetadataCommand.js +43 -0
  53. package/dist-es/commands/ListDICOMImportJobsCommand.js +42 -0
  54. package/dist-es/commands/ListDatastoresCommand.js +42 -0
  55. package/dist-es/commands/ListImageSetVersionsCommand.js +42 -0
  56. package/dist-es/commands/ListTagsForResourceCommand.js +42 -0
  57. package/dist-es/commands/SearchImageSetsCommand.js +43 -0
  58. package/dist-es/commands/StartDICOMImportJobCommand.js +42 -0
  59. package/dist-es/commands/TagResourceCommand.js +42 -0
  60. package/dist-es/commands/UntagResourceCommand.js +42 -0
  61. package/dist-es/commands/UpdateImageSetMetadataCommand.js +43 -0
  62. package/dist-es/commands/index.js +18 -0
  63. package/dist-es/endpoint/EndpointParameters.js +8 -0
  64. package/dist-es/endpoint/endpointResolver.js +8 -0
  65. package/dist-es/endpoint/ruleset.js +4 -0
  66. package/dist-es/index.js +6 -0
  67. package/dist-es/models/MedicalImagingServiceException.js +8 -0
  68. package/dist-es/models/index.js +1 -0
  69. package/dist-es/models/models_0.js +225 -0
  70. package/dist-es/pagination/Interfaces.js +1 -0
  71. package/dist-es/pagination/ListDICOMImportJobsPaginator.js +25 -0
  72. package/dist-es/pagination/ListDatastoresPaginator.js +25 -0
  73. package/dist-es/pagination/ListImageSetVersionsPaginator.js +25 -0
  74. package/dist-es/pagination/SearchImageSetsPaginator.js +25 -0
  75. package/dist-es/pagination/index.js +5 -0
  76. package/dist-es/protocols/Aws_restJson1.js +1654 -0
  77. package/dist-es/runtimeConfig.browser.js +34 -0
  78. package/dist-es/runtimeConfig.js +43 -0
  79. package/dist-es/runtimeConfig.native.js +11 -0
  80. package/dist-es/runtimeConfig.shared.js +19 -0
  81. package/dist-types/MedicalImaging.d.ts +285 -0
  82. package/dist-types/MedicalImagingClient.d.ts +334 -0
  83. package/dist-types/commands/CopyImageSetCommand.d.ts +122 -0
  84. package/dist-types/commands/CreateDatastoreCommand.d.ts +97 -0
  85. package/dist-types/commands/DeleteDatastoreCommand.d.ts +95 -0
  86. package/dist-types/commands/DeleteImageSetCommand.d.ts +95 -0
  87. package/dist-types/commands/GetDICOMImportJobCommand.d.ts +103 -0
  88. package/dist-types/commands/GetDatastoreCommand.d.ts +96 -0
  89. package/dist-types/commands/GetImageFrameCommand.d.ts +96 -0
  90. package/dist-types/commands/GetImageSetCommand.d.ts +102 -0
  91. package/dist-types/commands/GetImageSetMetadataCommand.d.ts +95 -0
  92. package/dist-types/commands/ListDICOMImportJobsCommand.d.ts +106 -0
  93. package/dist-types/commands/ListDatastoresCommand.d.ts +97 -0
  94. package/dist-types/commands/ListImageSetVersionsCommand.d.ts +106 -0
  95. package/dist-types/commands/ListTagsForResourceCommand.d.ts +90 -0
  96. package/dist-types/commands/SearchImageSetsCommand.d.ts +135 -0
  97. package/dist-types/commands/StartDICOMImportJobCommand.d.ts +104 -0
  98. package/dist-types/commands/TagResourceCommand.d.ts +89 -0
  99. package/dist-types/commands/UntagResourceCommand.d.ts +89 -0
  100. package/dist-types/commands/UpdateImageSetMetadataCommand.d.ts +109 -0
  101. package/dist-types/commands/index.d.ts +18 -0
  102. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  103. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  104. package/dist-types/endpoint/ruleset.d.ts +2 -0
  105. package/dist-types/index.d.ts +160 -0
  106. package/dist-types/models/MedicalImagingServiceException.d.ts +13 -0
  107. package/dist-types/models/index.d.ts +1 -0
  108. package/dist-types/models/models_0.d.ts +1363 -0
  109. package/dist-types/pagination/Interfaces.d.ts +8 -0
  110. package/dist-types/pagination/ListDICOMImportJobsPaginator.d.ts +7 -0
  111. package/dist-types/pagination/ListDatastoresPaginator.d.ts +7 -0
  112. package/dist-types/pagination/ListImageSetVersionsPaginator.d.ts +7 -0
  113. package/dist-types/pagination/SearchImageSetsPaginator.d.ts +7 -0
  114. package/dist-types/pagination/index.d.ts +5 -0
  115. package/dist-types/protocols/Aws_restJson1.d.ts +164 -0
  116. package/dist-types/runtimeConfig.browser.d.ts +43 -0
  117. package/dist-types/runtimeConfig.d.ts +43 -0
  118. package/dist-types/runtimeConfig.native.d.ts +42 -0
  119. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  120. package/dist-types/ts3.4/MedicalImaging.d.ts +313 -0
  121. package/dist-types/ts3.4/MedicalImagingClient.d.ts +223 -0
  122. package/dist-types/ts3.4/commands/CopyImageSetCommand.d.ts +35 -0
  123. package/dist-types/ts3.4/commands/CreateDatastoreCommand.d.ts +38 -0
  124. package/dist-types/ts3.4/commands/DeleteDatastoreCommand.d.ts +38 -0
  125. package/dist-types/ts3.4/commands/DeleteImageSetCommand.d.ts +38 -0
  126. package/dist-types/ts3.4/commands/GetDICOMImportJobCommand.d.ts +39 -0
  127. package/dist-types/ts3.4/commands/GetDatastoreCommand.d.ts +35 -0
  128. package/dist-types/ts3.4/commands/GetImageFrameCommand.d.ts +39 -0
  129. package/dist-types/ts3.4/commands/GetImageSetCommand.d.ts +35 -0
  130. package/dist-types/ts3.4/commands/GetImageSetMetadataCommand.d.ts +43 -0
  131. package/dist-types/ts3.4/commands/ListDICOMImportJobsCommand.d.ts +39 -0
  132. package/dist-types/ts3.4/commands/ListDatastoresCommand.d.ts +38 -0
  133. package/dist-types/ts3.4/commands/ListImageSetVersionsCommand.d.ts +42 -0
  134. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
  135. package/dist-types/ts3.4/commands/SearchImageSetsCommand.d.ts +38 -0
  136. package/dist-types/ts3.4/commands/StartDICOMImportJobCommand.d.ts +39 -0
  137. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
  138. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
  139. package/dist-types/ts3.4/commands/UpdateImageSetMetadataCommand.d.ts +42 -0
  140. package/dist-types/ts3.4/commands/index.d.ts +18 -0
  141. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  142. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  143. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  144. package/dist-types/ts3.4/index.d.ts +6 -0
  145. package/dist-types/ts3.4/models/MedicalImagingServiceException.d.ts +8 -0
  146. package/dist-types/ts3.4/models/index.d.ts +1 -0
  147. package/dist-types/ts3.4/models/models_0.d.ts +513 -0
  148. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  149. package/dist-types/ts3.4/pagination/ListDICOMImportJobsPaginator.d.ts +11 -0
  150. package/dist-types/ts3.4/pagination/ListDatastoresPaginator.d.ts +11 -0
  151. package/dist-types/ts3.4/pagination/ListImageSetVersionsPaginator.d.ts +11 -0
  152. package/dist-types/ts3.4/pagination/SearchImageSetsPaginator.d.ts +11 -0
  153. package/dist-types/ts3.4/pagination/index.d.ts +5 -0
  154. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +224 -0
  155. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +90 -0
  156. package/dist-types/ts3.4/runtimeConfig.d.ts +90 -0
  157. package/dist-types/ts3.4/runtimeConfig.native.d.ts +81 -0
  158. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  159. package/package.json +102 -0
@@ -0,0 +1,1693 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_UpdateImageSetMetadataCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartDICOMImportJobCommand = exports.de_SearchImageSetsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListImageSetVersionsCommand = exports.de_ListDICOMImportJobsCommand = exports.de_ListDatastoresCommand = exports.de_GetImageSetMetadataCommand = exports.de_GetImageSetCommand = exports.de_GetImageFrameCommand = exports.de_GetDICOMImportJobCommand = exports.de_GetDatastoreCommand = exports.de_DeleteImageSetCommand = exports.de_DeleteDatastoreCommand = exports.de_CreateDatastoreCommand = exports.de_CopyImageSetCommand = exports.se_UpdateImageSetMetadataCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartDICOMImportJobCommand = exports.se_SearchImageSetsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListImageSetVersionsCommand = exports.se_ListDICOMImportJobsCommand = exports.se_ListDatastoresCommand = exports.se_GetImageSetMetadataCommand = exports.se_GetImageSetCommand = exports.se_GetImageFrameCommand = exports.se_GetDICOMImportJobCommand = exports.se_GetDatastoreCommand = exports.se_DeleteImageSetCommand = exports.se_DeleteDatastoreCommand = exports.se_CreateDatastoreCommand = exports.se_CopyImageSetCommand = void 0;
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const uuid_1 = require("uuid");
7
+ const MedicalImagingServiceException_1 = require("../models/MedicalImagingServiceException");
8
+ const models_0_1 = require("../models/models_0");
9
+ const se_CopyImageSetCommand = async (input, context) => {
10
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
11
+ const headers = {
12
+ "content-type": "application/json",
13
+ };
14
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
15
+ "/datastore/{datastoreId}/imageSet/{sourceImageSetId}/copyImageSet";
16
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
17
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sourceImageSetId", () => input.sourceImageSetId, "{sourceImageSetId}", false);
18
+ let body;
19
+ if (input.copyImageSetInformation !== undefined) {
20
+ body = (0, smithy_client_1._json)(input.copyImageSetInformation);
21
+ }
22
+ if (body === undefined) {
23
+ body = {};
24
+ }
25
+ body = JSON.stringify(body);
26
+ let { hostname: resolvedHostname } = await context.endpoint();
27
+ if (context.disableHostPrefix !== true) {
28
+ resolvedHostname = "runtime-" + resolvedHostname;
29
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
30
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
31
+ }
32
+ }
33
+ return new protocol_http_1.HttpRequest({
34
+ protocol,
35
+ hostname: resolvedHostname,
36
+ port,
37
+ method: "POST",
38
+ headers,
39
+ path: resolvedPath,
40
+ body,
41
+ });
42
+ };
43
+ exports.se_CopyImageSetCommand = se_CopyImageSetCommand;
44
+ const se_CreateDatastoreCommand = async (input, context) => {
45
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const headers = {
47
+ "content-type": "application/json",
48
+ };
49
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datastore";
50
+ let body;
51
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
52
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
53
+ datastoreName: [],
54
+ kmsKeyArn: [],
55
+ tags: (_) => (0, smithy_client_1._json)(_),
56
+ }));
57
+ return new protocol_http_1.HttpRequest({
58
+ protocol,
59
+ hostname,
60
+ port,
61
+ method: "POST",
62
+ headers,
63
+ path: resolvedPath,
64
+ body,
65
+ });
66
+ };
67
+ exports.se_CreateDatastoreCommand = se_CreateDatastoreCommand;
68
+ const se_DeleteDatastoreCommand = async (input, context) => {
69
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const headers = {};
71
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datastore/{datastoreId}";
72
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
73
+ let body;
74
+ return new protocol_http_1.HttpRequest({
75
+ protocol,
76
+ hostname,
77
+ port,
78
+ method: "DELETE",
79
+ headers,
80
+ path: resolvedPath,
81
+ body,
82
+ });
83
+ };
84
+ exports.se_DeleteDatastoreCommand = se_DeleteDatastoreCommand;
85
+ const se_DeleteImageSetCommand = async (input, context) => {
86
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
87
+ const headers = {};
88
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
89
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/deleteImageSet";
90
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
91
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
92
+ let body;
93
+ let { hostname: resolvedHostname } = await context.endpoint();
94
+ if (context.disableHostPrefix !== true) {
95
+ resolvedHostname = "runtime-" + resolvedHostname;
96
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
97
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
98
+ }
99
+ }
100
+ return new protocol_http_1.HttpRequest({
101
+ protocol,
102
+ hostname: resolvedHostname,
103
+ port,
104
+ method: "POST",
105
+ headers,
106
+ path: resolvedPath,
107
+ body,
108
+ });
109
+ };
110
+ exports.se_DeleteImageSetCommand = se_DeleteImageSetCommand;
111
+ const se_GetDatastoreCommand = async (input, context) => {
112
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
113
+ const headers = {};
114
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datastore/{datastoreId}";
115
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
116
+ let body;
117
+ return new protocol_http_1.HttpRequest({
118
+ protocol,
119
+ hostname,
120
+ port,
121
+ method: "GET",
122
+ headers,
123
+ path: resolvedPath,
124
+ body,
125
+ });
126
+ };
127
+ exports.se_GetDatastoreCommand = se_GetDatastoreCommand;
128
+ const se_GetDICOMImportJobCommand = async (input, context) => {
129
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
130
+ const headers = {};
131
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
132
+ "/getDICOMImportJob/datastore/{datastoreId}/job/{jobId}";
133
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
134
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
135
+ let body;
136
+ return new protocol_http_1.HttpRequest({
137
+ protocol,
138
+ hostname,
139
+ port,
140
+ method: "GET",
141
+ headers,
142
+ path: resolvedPath,
143
+ body,
144
+ });
145
+ };
146
+ exports.se_GetDICOMImportJobCommand = se_GetDICOMImportJobCommand;
147
+ const se_GetImageFrameCommand = async (input, context) => {
148
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
149
+ const headers = {
150
+ "content-type": "application/json",
151
+ };
152
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
153
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageFrame";
154
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
155
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
156
+ let body;
157
+ if (input.imageFrameInformation !== undefined) {
158
+ body = (0, smithy_client_1._json)(input.imageFrameInformation);
159
+ }
160
+ if (body === undefined) {
161
+ body = {};
162
+ }
163
+ body = JSON.stringify(body);
164
+ let { hostname: resolvedHostname } = await context.endpoint();
165
+ if (context.disableHostPrefix !== true) {
166
+ resolvedHostname = "runtime-" + resolvedHostname;
167
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
168
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
169
+ }
170
+ }
171
+ return new protocol_http_1.HttpRequest({
172
+ protocol,
173
+ hostname: resolvedHostname,
174
+ port,
175
+ method: "POST",
176
+ headers,
177
+ path: resolvedPath,
178
+ body,
179
+ });
180
+ };
181
+ exports.se_GetImageFrameCommand = se_GetImageFrameCommand;
182
+ const se_GetImageSetCommand = async (input, context) => {
183
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
184
+ const headers = {};
185
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
186
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSet";
187
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
188
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
189
+ const query = (0, smithy_client_1.map)({
190
+ version: [, input.versionId],
191
+ });
192
+ let body;
193
+ let { hostname: resolvedHostname } = await context.endpoint();
194
+ if (context.disableHostPrefix !== true) {
195
+ resolvedHostname = "runtime-" + resolvedHostname;
196
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
197
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
198
+ }
199
+ }
200
+ return new protocol_http_1.HttpRequest({
201
+ protocol,
202
+ hostname: resolvedHostname,
203
+ port,
204
+ method: "POST",
205
+ headers,
206
+ path: resolvedPath,
207
+ query,
208
+ body,
209
+ });
210
+ };
211
+ exports.se_GetImageSetCommand = se_GetImageSetCommand;
212
+ const se_GetImageSetMetadataCommand = async (input, context) => {
213
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
214
+ const headers = {};
215
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
216
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSetMetadata";
217
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
218
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
219
+ const query = (0, smithy_client_1.map)({
220
+ version: [, input.versionId],
221
+ });
222
+ let body;
223
+ let { hostname: resolvedHostname } = await context.endpoint();
224
+ if (context.disableHostPrefix !== true) {
225
+ resolvedHostname = "runtime-" + resolvedHostname;
226
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
227
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
228
+ }
229
+ }
230
+ return new protocol_http_1.HttpRequest({
231
+ protocol,
232
+ hostname: resolvedHostname,
233
+ port,
234
+ method: "POST",
235
+ headers,
236
+ path: resolvedPath,
237
+ query,
238
+ body,
239
+ });
240
+ };
241
+ exports.se_GetImageSetMetadataCommand = se_GetImageSetMetadataCommand;
242
+ const se_ListDatastoresCommand = async (input, context) => {
243
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
244
+ const headers = {};
245
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datastore";
246
+ const query = (0, smithy_client_1.map)({
247
+ datastoreStatus: [, input.datastoreStatus],
248
+ nextToken: [, input.nextToken],
249
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
250
+ });
251
+ let body;
252
+ return new protocol_http_1.HttpRequest({
253
+ protocol,
254
+ hostname,
255
+ port,
256
+ method: "GET",
257
+ headers,
258
+ path: resolvedPath,
259
+ query,
260
+ body,
261
+ });
262
+ };
263
+ exports.se_ListDatastoresCommand = se_ListDatastoresCommand;
264
+ const se_ListDICOMImportJobsCommand = async (input, context) => {
265
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
266
+ const headers = {};
267
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
268
+ "/listDICOMImportJobs/datastore/{datastoreId}";
269
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
270
+ const query = (0, smithy_client_1.map)({
271
+ jobStatus: [, input.jobStatus],
272
+ nextToken: [, input.nextToken],
273
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
274
+ });
275
+ let body;
276
+ return new protocol_http_1.HttpRequest({
277
+ protocol,
278
+ hostname,
279
+ port,
280
+ method: "GET",
281
+ headers,
282
+ path: resolvedPath,
283
+ query,
284
+ body,
285
+ });
286
+ };
287
+ exports.se_ListDICOMImportJobsCommand = se_ListDICOMImportJobsCommand;
288
+ const se_ListImageSetVersionsCommand = async (input, context) => {
289
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
290
+ const headers = {};
291
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
292
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/listImageSetVersions";
293
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
294
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
295
+ const query = (0, smithy_client_1.map)({
296
+ nextToken: [, input.nextToken],
297
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
298
+ });
299
+ let body;
300
+ let { hostname: resolvedHostname } = await context.endpoint();
301
+ if (context.disableHostPrefix !== true) {
302
+ resolvedHostname = "runtime-" + resolvedHostname;
303
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
304
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
305
+ }
306
+ }
307
+ return new protocol_http_1.HttpRequest({
308
+ protocol,
309
+ hostname: resolvedHostname,
310
+ port,
311
+ method: "POST",
312
+ headers,
313
+ path: resolvedPath,
314
+ query,
315
+ body,
316
+ });
317
+ };
318
+ exports.se_ListImageSetVersionsCommand = se_ListImageSetVersionsCommand;
319
+ const se_ListTagsForResourceCommand = async (input, context) => {
320
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
321
+ const headers = {};
322
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
323
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
324
+ let body;
325
+ return new protocol_http_1.HttpRequest({
326
+ protocol,
327
+ hostname,
328
+ port,
329
+ method: "GET",
330
+ headers,
331
+ path: resolvedPath,
332
+ body,
333
+ });
334
+ };
335
+ exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
336
+ const se_SearchImageSetsCommand = async (input, context) => {
337
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
338
+ const headers = {
339
+ "content-type": "application/json",
340
+ };
341
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datastore/{datastoreId}/searchImageSets";
342
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
343
+ const query = (0, smithy_client_1.map)({
344
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
345
+ nextToken: [, input.nextToken],
346
+ });
347
+ let body;
348
+ if (input.searchCriteria !== undefined) {
349
+ body = se_SearchCriteria(input.searchCriteria, context);
350
+ }
351
+ if (body === undefined) {
352
+ body = {};
353
+ }
354
+ body = JSON.stringify(body);
355
+ let { hostname: resolvedHostname } = await context.endpoint();
356
+ if (context.disableHostPrefix !== true) {
357
+ resolvedHostname = "runtime-" + resolvedHostname;
358
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
359
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
360
+ }
361
+ }
362
+ return new protocol_http_1.HttpRequest({
363
+ protocol,
364
+ hostname: resolvedHostname,
365
+ port,
366
+ method: "POST",
367
+ headers,
368
+ path: resolvedPath,
369
+ query,
370
+ body,
371
+ });
372
+ };
373
+ exports.se_SearchImageSetsCommand = se_SearchImageSetsCommand;
374
+ const se_StartDICOMImportJobCommand = async (input, context) => {
375
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
376
+ const headers = {
377
+ "content-type": "application/json",
378
+ };
379
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
380
+ "/startDICOMImportJob/datastore/{datastoreId}";
381
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
382
+ let body;
383
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
384
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
385
+ dataAccessRoleArn: [],
386
+ inputS3Uri: [],
387
+ jobName: [],
388
+ outputS3Uri: [],
389
+ }));
390
+ return new protocol_http_1.HttpRequest({
391
+ protocol,
392
+ hostname,
393
+ port,
394
+ method: "POST",
395
+ headers,
396
+ path: resolvedPath,
397
+ body,
398
+ });
399
+ };
400
+ exports.se_StartDICOMImportJobCommand = se_StartDICOMImportJobCommand;
401
+ const se_TagResourceCommand = async (input, context) => {
402
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
403
+ const headers = {
404
+ "content-type": "application/json",
405
+ };
406
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
407
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
408
+ let body;
409
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
410
+ tags: (_) => (0, smithy_client_1._json)(_),
411
+ }));
412
+ return new protocol_http_1.HttpRequest({
413
+ protocol,
414
+ hostname,
415
+ port,
416
+ method: "POST",
417
+ headers,
418
+ path: resolvedPath,
419
+ body,
420
+ });
421
+ };
422
+ exports.se_TagResourceCommand = se_TagResourceCommand;
423
+ const se_UntagResourceCommand = async (input, context) => {
424
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
425
+ const headers = {};
426
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
427
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
428
+ const query = (0, smithy_client_1.map)({
429
+ tagKeys: [
430
+ (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
431
+ () => (input.tagKeys || []).map((_entry) => _entry),
432
+ ],
433
+ });
434
+ let body;
435
+ return new protocol_http_1.HttpRequest({
436
+ protocol,
437
+ hostname,
438
+ port,
439
+ method: "DELETE",
440
+ headers,
441
+ path: resolvedPath,
442
+ query,
443
+ body,
444
+ });
445
+ };
446
+ exports.se_UntagResourceCommand = se_UntagResourceCommand;
447
+ const se_UpdateImageSetMetadataCommand = async (input, context) => {
448
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
449
+ const headers = {
450
+ "content-type": "application/json",
451
+ };
452
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
453
+ "/datastore/{datastoreId}/imageSet/{imageSetId}/updateImageSetMetadata";
454
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "datastoreId", () => input.datastoreId, "{datastoreId}", false);
455
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "imageSetId", () => input.imageSetId, "{imageSetId}", false);
456
+ const query = (0, smithy_client_1.map)({
457
+ latestVersion: [, (0, smithy_client_1.expectNonNull)(input.latestVersionId, `latestVersionId`)],
458
+ });
459
+ let body;
460
+ if (input.updateImageSetMetadataUpdates !== undefined) {
461
+ body = se_MetadataUpdates(input.updateImageSetMetadataUpdates, context);
462
+ }
463
+ if (body === undefined) {
464
+ body = {};
465
+ }
466
+ body = JSON.stringify(body);
467
+ let { hostname: resolvedHostname } = await context.endpoint();
468
+ if (context.disableHostPrefix !== true) {
469
+ resolvedHostname = "runtime-" + resolvedHostname;
470
+ if (!(0, protocol_http_1.isValidHostname)(resolvedHostname)) {
471
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
472
+ }
473
+ }
474
+ return new protocol_http_1.HttpRequest({
475
+ protocol,
476
+ hostname: resolvedHostname,
477
+ port,
478
+ method: "POST",
479
+ headers,
480
+ path: resolvedPath,
481
+ query,
482
+ body,
483
+ });
484
+ };
485
+ exports.se_UpdateImageSetMetadataCommand = se_UpdateImageSetMetadataCommand;
486
+ const de_CopyImageSetCommand = async (output, context) => {
487
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
488
+ return de_CopyImageSetCommandError(output, context);
489
+ }
490
+ const contents = (0, smithy_client_1.map)({
491
+ $metadata: deserializeMetadata(output),
492
+ });
493
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
494
+ const doc = (0, smithy_client_1.take)(data, {
495
+ datastoreId: smithy_client_1.expectString,
496
+ destinationImageSetProperties: (_) => de_CopyDestinationImageSetProperties(_, context),
497
+ sourceImageSetProperties: (_) => de_CopySourceImageSetProperties(_, context),
498
+ });
499
+ Object.assign(contents, doc);
500
+ return contents;
501
+ };
502
+ exports.de_CopyImageSetCommand = de_CopyImageSetCommand;
503
+ const de_CopyImageSetCommandError = async (output, context) => {
504
+ const parsedOutput = {
505
+ ...output,
506
+ body: await parseErrorBody(output.body, context),
507
+ };
508
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
509
+ switch (errorCode) {
510
+ case "AccessDeniedException":
511
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
512
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
513
+ case "ConflictException":
514
+ case "com.amazonaws.medicalimaging#ConflictException":
515
+ throw await de_ConflictExceptionRes(parsedOutput, context);
516
+ case "InternalServerException":
517
+ case "com.amazonaws.medicalimaging#InternalServerException":
518
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
519
+ case "ResourceNotFoundException":
520
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
521
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
522
+ case "ServiceQuotaExceededException":
523
+ case "com.amazonaws.medicalimaging#ServiceQuotaExceededException":
524
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
525
+ case "ThrottlingException":
526
+ case "com.amazonaws.medicalimaging#ThrottlingException":
527
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
528
+ case "ValidationException":
529
+ case "com.amazonaws.medicalimaging#ValidationException":
530
+ throw await de_ValidationExceptionRes(parsedOutput, context);
531
+ default:
532
+ const parsedBody = parsedOutput.body;
533
+ return throwDefaultError({
534
+ output,
535
+ parsedBody,
536
+ errorCode,
537
+ });
538
+ }
539
+ };
540
+ const de_CreateDatastoreCommand = async (output, context) => {
541
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
542
+ return de_CreateDatastoreCommandError(output, context);
543
+ }
544
+ const contents = (0, smithy_client_1.map)({
545
+ $metadata: deserializeMetadata(output),
546
+ });
547
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
548
+ const doc = (0, smithy_client_1.take)(data, {
549
+ datastoreId: smithy_client_1.expectString,
550
+ datastoreStatus: smithy_client_1.expectString,
551
+ });
552
+ Object.assign(contents, doc);
553
+ return contents;
554
+ };
555
+ exports.de_CreateDatastoreCommand = de_CreateDatastoreCommand;
556
+ const de_CreateDatastoreCommandError = async (output, context) => {
557
+ const parsedOutput = {
558
+ ...output,
559
+ body: await parseErrorBody(output.body, context),
560
+ };
561
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
562
+ switch (errorCode) {
563
+ case "AccessDeniedException":
564
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
565
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
566
+ case "ConflictException":
567
+ case "com.amazonaws.medicalimaging#ConflictException":
568
+ throw await de_ConflictExceptionRes(parsedOutput, context);
569
+ case "InternalServerException":
570
+ case "com.amazonaws.medicalimaging#InternalServerException":
571
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
572
+ case "ServiceQuotaExceededException":
573
+ case "com.amazonaws.medicalimaging#ServiceQuotaExceededException":
574
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
575
+ case "ThrottlingException":
576
+ case "com.amazonaws.medicalimaging#ThrottlingException":
577
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
578
+ case "ValidationException":
579
+ case "com.amazonaws.medicalimaging#ValidationException":
580
+ throw await de_ValidationExceptionRes(parsedOutput, context);
581
+ default:
582
+ const parsedBody = parsedOutput.body;
583
+ return throwDefaultError({
584
+ output,
585
+ parsedBody,
586
+ errorCode,
587
+ });
588
+ }
589
+ };
590
+ const de_DeleteDatastoreCommand = async (output, context) => {
591
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
592
+ return de_DeleteDatastoreCommandError(output, context);
593
+ }
594
+ const contents = (0, smithy_client_1.map)({
595
+ $metadata: deserializeMetadata(output),
596
+ });
597
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
598
+ const doc = (0, smithy_client_1.take)(data, {
599
+ datastoreId: smithy_client_1.expectString,
600
+ datastoreStatus: smithy_client_1.expectString,
601
+ });
602
+ Object.assign(contents, doc);
603
+ return contents;
604
+ };
605
+ exports.de_DeleteDatastoreCommand = de_DeleteDatastoreCommand;
606
+ const de_DeleteDatastoreCommandError = async (output, context) => {
607
+ const parsedOutput = {
608
+ ...output,
609
+ body: await parseErrorBody(output.body, context),
610
+ };
611
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
612
+ switch (errorCode) {
613
+ case "AccessDeniedException":
614
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
615
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
616
+ case "ConflictException":
617
+ case "com.amazonaws.medicalimaging#ConflictException":
618
+ throw await de_ConflictExceptionRes(parsedOutput, context);
619
+ case "InternalServerException":
620
+ case "com.amazonaws.medicalimaging#InternalServerException":
621
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
622
+ case "ResourceNotFoundException":
623
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
624
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
625
+ case "ThrottlingException":
626
+ case "com.amazonaws.medicalimaging#ThrottlingException":
627
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
628
+ case "ValidationException":
629
+ case "com.amazonaws.medicalimaging#ValidationException":
630
+ throw await de_ValidationExceptionRes(parsedOutput, context);
631
+ default:
632
+ const parsedBody = parsedOutput.body;
633
+ return throwDefaultError({
634
+ output,
635
+ parsedBody,
636
+ errorCode,
637
+ });
638
+ }
639
+ };
640
+ const de_DeleteImageSetCommand = async (output, context) => {
641
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
642
+ return de_DeleteImageSetCommandError(output, context);
643
+ }
644
+ const contents = (0, smithy_client_1.map)({
645
+ $metadata: deserializeMetadata(output),
646
+ });
647
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
648
+ const doc = (0, smithy_client_1.take)(data, {
649
+ datastoreId: smithy_client_1.expectString,
650
+ imageSetId: smithy_client_1.expectString,
651
+ imageSetState: smithy_client_1.expectString,
652
+ imageSetWorkflowStatus: smithy_client_1.expectString,
653
+ });
654
+ Object.assign(contents, doc);
655
+ return contents;
656
+ };
657
+ exports.de_DeleteImageSetCommand = de_DeleteImageSetCommand;
658
+ const de_DeleteImageSetCommandError = async (output, context) => {
659
+ const parsedOutput = {
660
+ ...output,
661
+ body: await parseErrorBody(output.body, context),
662
+ };
663
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
664
+ switch (errorCode) {
665
+ case "AccessDeniedException":
666
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
667
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
668
+ case "ConflictException":
669
+ case "com.amazonaws.medicalimaging#ConflictException":
670
+ throw await de_ConflictExceptionRes(parsedOutput, context);
671
+ case "InternalServerException":
672
+ case "com.amazonaws.medicalimaging#InternalServerException":
673
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
674
+ case "ResourceNotFoundException":
675
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
676
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
677
+ case "ThrottlingException":
678
+ case "com.amazonaws.medicalimaging#ThrottlingException":
679
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
680
+ case "ValidationException":
681
+ case "com.amazonaws.medicalimaging#ValidationException":
682
+ throw await de_ValidationExceptionRes(parsedOutput, context);
683
+ default:
684
+ const parsedBody = parsedOutput.body;
685
+ return throwDefaultError({
686
+ output,
687
+ parsedBody,
688
+ errorCode,
689
+ });
690
+ }
691
+ };
692
+ const de_GetDatastoreCommand = async (output, context) => {
693
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
694
+ return de_GetDatastoreCommandError(output, context);
695
+ }
696
+ const contents = (0, smithy_client_1.map)({
697
+ $metadata: deserializeMetadata(output),
698
+ });
699
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
700
+ const doc = (0, smithy_client_1.take)(data, {
701
+ datastoreProperties: (_) => de_DatastoreProperties(_, context),
702
+ });
703
+ Object.assign(contents, doc);
704
+ return contents;
705
+ };
706
+ exports.de_GetDatastoreCommand = de_GetDatastoreCommand;
707
+ const de_GetDatastoreCommandError = async (output, context) => {
708
+ const parsedOutput = {
709
+ ...output,
710
+ body: await parseErrorBody(output.body, context),
711
+ };
712
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
713
+ switch (errorCode) {
714
+ case "AccessDeniedException":
715
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
716
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
717
+ case "InternalServerException":
718
+ case "com.amazonaws.medicalimaging#InternalServerException":
719
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
720
+ case "ResourceNotFoundException":
721
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
722
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
723
+ case "ThrottlingException":
724
+ case "com.amazonaws.medicalimaging#ThrottlingException":
725
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
726
+ case "ValidationException":
727
+ case "com.amazonaws.medicalimaging#ValidationException":
728
+ throw await de_ValidationExceptionRes(parsedOutput, context);
729
+ default:
730
+ const parsedBody = parsedOutput.body;
731
+ return throwDefaultError({
732
+ output,
733
+ parsedBody,
734
+ errorCode,
735
+ });
736
+ }
737
+ };
738
+ const de_GetDICOMImportJobCommand = async (output, context) => {
739
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
740
+ return de_GetDICOMImportJobCommandError(output, context);
741
+ }
742
+ const contents = (0, smithy_client_1.map)({
743
+ $metadata: deserializeMetadata(output),
744
+ });
745
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
746
+ const doc = (0, smithy_client_1.take)(data, {
747
+ jobProperties: (_) => de_DICOMImportJobProperties(_, context),
748
+ });
749
+ Object.assign(contents, doc);
750
+ return contents;
751
+ };
752
+ exports.de_GetDICOMImportJobCommand = de_GetDICOMImportJobCommand;
753
+ const de_GetDICOMImportJobCommandError = async (output, context) => {
754
+ const parsedOutput = {
755
+ ...output,
756
+ body: await parseErrorBody(output.body, context),
757
+ };
758
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
759
+ switch (errorCode) {
760
+ case "AccessDeniedException":
761
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
762
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
763
+ case "ConflictException":
764
+ case "com.amazonaws.medicalimaging#ConflictException":
765
+ throw await de_ConflictExceptionRes(parsedOutput, context);
766
+ case "InternalServerException":
767
+ case "com.amazonaws.medicalimaging#InternalServerException":
768
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
769
+ case "ResourceNotFoundException":
770
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
771
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
772
+ case "ThrottlingException":
773
+ case "com.amazonaws.medicalimaging#ThrottlingException":
774
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
775
+ case "ValidationException":
776
+ case "com.amazonaws.medicalimaging#ValidationException":
777
+ throw await de_ValidationExceptionRes(parsedOutput, context);
778
+ default:
779
+ const parsedBody = parsedOutput.body;
780
+ return throwDefaultError({
781
+ output,
782
+ parsedBody,
783
+ errorCode,
784
+ });
785
+ }
786
+ };
787
+ const de_GetImageFrameCommand = async (output, context) => {
788
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
789
+ return de_GetImageFrameCommandError(output, context);
790
+ }
791
+ const contents = (0, smithy_client_1.map)({
792
+ $metadata: deserializeMetadata(output),
793
+ contentType: [, output.headers["content-type"]],
794
+ });
795
+ const data = output.body;
796
+ context.sdkStreamMixin(data);
797
+ contents.imageFrameBlob = data;
798
+ return contents;
799
+ };
800
+ exports.de_GetImageFrameCommand = de_GetImageFrameCommand;
801
+ const de_GetImageFrameCommandError = async (output, context) => {
802
+ const parsedOutput = {
803
+ ...output,
804
+ body: await parseErrorBody(output.body, context),
805
+ };
806
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
807
+ switch (errorCode) {
808
+ case "AccessDeniedException":
809
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
810
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
811
+ case "ConflictException":
812
+ case "com.amazonaws.medicalimaging#ConflictException":
813
+ throw await de_ConflictExceptionRes(parsedOutput, context);
814
+ case "InternalServerException":
815
+ case "com.amazonaws.medicalimaging#InternalServerException":
816
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
817
+ case "ResourceNotFoundException":
818
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
819
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
820
+ case "ThrottlingException":
821
+ case "com.amazonaws.medicalimaging#ThrottlingException":
822
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
823
+ case "ValidationException":
824
+ case "com.amazonaws.medicalimaging#ValidationException":
825
+ throw await de_ValidationExceptionRes(parsedOutput, context);
826
+ default:
827
+ const parsedBody = parsedOutput.body;
828
+ return throwDefaultError({
829
+ output,
830
+ parsedBody,
831
+ errorCode,
832
+ });
833
+ }
834
+ };
835
+ const de_GetImageSetCommand = async (output, context) => {
836
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
837
+ return de_GetImageSetCommandError(output, context);
838
+ }
839
+ const contents = (0, smithy_client_1.map)({
840
+ $metadata: deserializeMetadata(output),
841
+ });
842
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
843
+ const doc = (0, smithy_client_1.take)(data, {
844
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
845
+ datastoreId: smithy_client_1.expectString,
846
+ deletedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
847
+ imageSetArn: smithy_client_1.expectString,
848
+ imageSetId: smithy_client_1.expectString,
849
+ imageSetState: smithy_client_1.expectString,
850
+ imageSetWorkflowStatus: smithy_client_1.expectString,
851
+ message: smithy_client_1.expectString,
852
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
853
+ versionId: smithy_client_1.expectString,
854
+ });
855
+ Object.assign(contents, doc);
856
+ return contents;
857
+ };
858
+ exports.de_GetImageSetCommand = de_GetImageSetCommand;
859
+ const de_GetImageSetCommandError = async (output, context) => {
860
+ const parsedOutput = {
861
+ ...output,
862
+ body: await parseErrorBody(output.body, context),
863
+ };
864
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
865
+ switch (errorCode) {
866
+ case "AccessDeniedException":
867
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
868
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
869
+ case "ConflictException":
870
+ case "com.amazonaws.medicalimaging#ConflictException":
871
+ throw await de_ConflictExceptionRes(parsedOutput, context);
872
+ case "InternalServerException":
873
+ case "com.amazonaws.medicalimaging#InternalServerException":
874
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
875
+ case "ResourceNotFoundException":
876
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
877
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
878
+ case "ThrottlingException":
879
+ case "com.amazonaws.medicalimaging#ThrottlingException":
880
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
881
+ case "ValidationException":
882
+ case "com.amazonaws.medicalimaging#ValidationException":
883
+ throw await de_ValidationExceptionRes(parsedOutput, context);
884
+ default:
885
+ const parsedBody = parsedOutput.body;
886
+ return throwDefaultError({
887
+ output,
888
+ parsedBody,
889
+ errorCode,
890
+ });
891
+ }
892
+ };
893
+ const de_GetImageSetMetadataCommand = async (output, context) => {
894
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
895
+ return de_GetImageSetMetadataCommandError(output, context);
896
+ }
897
+ const contents = (0, smithy_client_1.map)({
898
+ $metadata: deserializeMetadata(output),
899
+ contentType: [, output.headers["content-type"]],
900
+ contentEncoding: [, output.headers["content-encoding"]],
901
+ });
902
+ const data = output.body;
903
+ context.sdkStreamMixin(data);
904
+ contents.imageSetMetadataBlob = data;
905
+ return contents;
906
+ };
907
+ exports.de_GetImageSetMetadataCommand = de_GetImageSetMetadataCommand;
908
+ const de_GetImageSetMetadataCommandError = async (output, context) => {
909
+ const parsedOutput = {
910
+ ...output,
911
+ body: await parseErrorBody(output.body, context),
912
+ };
913
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
914
+ switch (errorCode) {
915
+ case "AccessDeniedException":
916
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
917
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
918
+ case "ConflictException":
919
+ case "com.amazonaws.medicalimaging#ConflictException":
920
+ throw await de_ConflictExceptionRes(parsedOutput, context);
921
+ case "InternalServerException":
922
+ case "com.amazonaws.medicalimaging#InternalServerException":
923
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
924
+ case "ResourceNotFoundException":
925
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
926
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
927
+ case "ThrottlingException":
928
+ case "com.amazonaws.medicalimaging#ThrottlingException":
929
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
930
+ case "ValidationException":
931
+ case "com.amazonaws.medicalimaging#ValidationException":
932
+ throw await de_ValidationExceptionRes(parsedOutput, context);
933
+ default:
934
+ const parsedBody = parsedOutput.body;
935
+ return throwDefaultError({
936
+ output,
937
+ parsedBody,
938
+ errorCode,
939
+ });
940
+ }
941
+ };
942
+ const de_ListDatastoresCommand = async (output, context) => {
943
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
944
+ return de_ListDatastoresCommandError(output, context);
945
+ }
946
+ const contents = (0, smithy_client_1.map)({
947
+ $metadata: deserializeMetadata(output),
948
+ });
949
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
950
+ const doc = (0, smithy_client_1.take)(data, {
951
+ datastoreSummaries: (_) => de_DatastoreSummaries(_, context),
952
+ nextToken: smithy_client_1.expectString,
953
+ });
954
+ Object.assign(contents, doc);
955
+ return contents;
956
+ };
957
+ exports.de_ListDatastoresCommand = de_ListDatastoresCommand;
958
+ const de_ListDatastoresCommandError = async (output, context) => {
959
+ const parsedOutput = {
960
+ ...output,
961
+ body: await parseErrorBody(output.body, context),
962
+ };
963
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
964
+ switch (errorCode) {
965
+ case "AccessDeniedException":
966
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
967
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
968
+ case "InternalServerException":
969
+ case "com.amazonaws.medicalimaging#InternalServerException":
970
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
971
+ case "ThrottlingException":
972
+ case "com.amazonaws.medicalimaging#ThrottlingException":
973
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
974
+ case "ValidationException":
975
+ case "com.amazonaws.medicalimaging#ValidationException":
976
+ throw await de_ValidationExceptionRes(parsedOutput, context);
977
+ default:
978
+ const parsedBody = parsedOutput.body;
979
+ return throwDefaultError({
980
+ output,
981
+ parsedBody,
982
+ errorCode,
983
+ });
984
+ }
985
+ };
986
+ const de_ListDICOMImportJobsCommand = async (output, context) => {
987
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
988
+ return de_ListDICOMImportJobsCommandError(output, context);
989
+ }
990
+ const contents = (0, smithy_client_1.map)({
991
+ $metadata: deserializeMetadata(output),
992
+ });
993
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
994
+ const doc = (0, smithy_client_1.take)(data, {
995
+ jobSummaries: (_) => de_DICOMImportJobSummaries(_, context),
996
+ nextToken: smithy_client_1.expectString,
997
+ });
998
+ Object.assign(contents, doc);
999
+ return contents;
1000
+ };
1001
+ exports.de_ListDICOMImportJobsCommand = de_ListDICOMImportJobsCommand;
1002
+ const de_ListDICOMImportJobsCommandError = async (output, context) => {
1003
+ const parsedOutput = {
1004
+ ...output,
1005
+ body: await parseErrorBody(output.body, context),
1006
+ };
1007
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1008
+ switch (errorCode) {
1009
+ case "AccessDeniedException":
1010
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1011
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1012
+ case "ConflictException":
1013
+ case "com.amazonaws.medicalimaging#ConflictException":
1014
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1015
+ case "InternalServerException":
1016
+ case "com.amazonaws.medicalimaging#InternalServerException":
1017
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1018
+ case "ResourceNotFoundException":
1019
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1020
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1021
+ case "ThrottlingException":
1022
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1023
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1024
+ case "ValidationException":
1025
+ case "com.amazonaws.medicalimaging#ValidationException":
1026
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1027
+ default:
1028
+ const parsedBody = parsedOutput.body;
1029
+ return throwDefaultError({
1030
+ output,
1031
+ parsedBody,
1032
+ errorCode,
1033
+ });
1034
+ }
1035
+ };
1036
+ const de_ListImageSetVersionsCommand = async (output, context) => {
1037
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1038
+ return de_ListImageSetVersionsCommandError(output, context);
1039
+ }
1040
+ const contents = (0, smithy_client_1.map)({
1041
+ $metadata: deserializeMetadata(output),
1042
+ });
1043
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1044
+ const doc = (0, smithy_client_1.take)(data, {
1045
+ imageSetPropertiesList: (_) => de_ImageSetPropertiesList(_, context),
1046
+ nextToken: smithy_client_1.expectString,
1047
+ });
1048
+ Object.assign(contents, doc);
1049
+ return contents;
1050
+ };
1051
+ exports.de_ListImageSetVersionsCommand = de_ListImageSetVersionsCommand;
1052
+ const de_ListImageSetVersionsCommandError = async (output, context) => {
1053
+ const parsedOutput = {
1054
+ ...output,
1055
+ body: await parseErrorBody(output.body, context),
1056
+ };
1057
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
+ switch (errorCode) {
1059
+ case "AccessDeniedException":
1060
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1061
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1062
+ case "ConflictException":
1063
+ case "com.amazonaws.medicalimaging#ConflictException":
1064
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1065
+ case "InternalServerException":
1066
+ case "com.amazonaws.medicalimaging#InternalServerException":
1067
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1068
+ case "ResourceNotFoundException":
1069
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1070
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1071
+ case "ThrottlingException":
1072
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1073
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1074
+ case "ValidationException":
1075
+ case "com.amazonaws.medicalimaging#ValidationException":
1076
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1077
+ default:
1078
+ const parsedBody = parsedOutput.body;
1079
+ return throwDefaultError({
1080
+ output,
1081
+ parsedBody,
1082
+ errorCode,
1083
+ });
1084
+ }
1085
+ };
1086
+ const de_ListTagsForResourceCommand = async (output, context) => {
1087
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1088
+ return de_ListTagsForResourceCommandError(output, context);
1089
+ }
1090
+ const contents = (0, smithy_client_1.map)({
1091
+ $metadata: deserializeMetadata(output),
1092
+ });
1093
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1094
+ const doc = (0, smithy_client_1.take)(data, {
1095
+ tags: smithy_client_1._json,
1096
+ });
1097
+ Object.assign(contents, doc);
1098
+ return contents;
1099
+ };
1100
+ exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
1101
+ const de_ListTagsForResourceCommandError = async (output, context) => {
1102
+ const parsedOutput = {
1103
+ ...output,
1104
+ body: await parseErrorBody(output.body, context),
1105
+ };
1106
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1107
+ switch (errorCode) {
1108
+ case "AccessDeniedException":
1109
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1110
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1111
+ case "InternalServerException":
1112
+ case "com.amazonaws.medicalimaging#InternalServerException":
1113
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1114
+ case "ResourceNotFoundException":
1115
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1116
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1117
+ case "ThrottlingException":
1118
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1119
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1120
+ case "ValidationException":
1121
+ case "com.amazonaws.medicalimaging#ValidationException":
1122
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1123
+ default:
1124
+ const parsedBody = parsedOutput.body;
1125
+ return throwDefaultError({
1126
+ output,
1127
+ parsedBody,
1128
+ errorCode,
1129
+ });
1130
+ }
1131
+ };
1132
+ const de_SearchImageSetsCommand = async (output, context) => {
1133
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1134
+ return de_SearchImageSetsCommandError(output, context);
1135
+ }
1136
+ const contents = (0, smithy_client_1.map)({
1137
+ $metadata: deserializeMetadata(output),
1138
+ });
1139
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1140
+ const doc = (0, smithy_client_1.take)(data, {
1141
+ imageSetsMetadataSummaries: (_) => de_ImageSetsMetadataSummaries(_, context),
1142
+ nextToken: smithy_client_1.expectString,
1143
+ });
1144
+ Object.assign(contents, doc);
1145
+ return contents;
1146
+ };
1147
+ exports.de_SearchImageSetsCommand = de_SearchImageSetsCommand;
1148
+ const de_SearchImageSetsCommandError = async (output, context) => {
1149
+ const parsedOutput = {
1150
+ ...output,
1151
+ body: await parseErrorBody(output.body, context),
1152
+ };
1153
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1154
+ switch (errorCode) {
1155
+ case "AccessDeniedException":
1156
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1157
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1158
+ case "ConflictException":
1159
+ case "com.amazonaws.medicalimaging#ConflictException":
1160
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1161
+ case "InternalServerException":
1162
+ case "com.amazonaws.medicalimaging#InternalServerException":
1163
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1164
+ case "ResourceNotFoundException":
1165
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1166
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1167
+ case "ThrottlingException":
1168
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1169
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1170
+ case "ValidationException":
1171
+ case "com.amazonaws.medicalimaging#ValidationException":
1172
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1173
+ default:
1174
+ const parsedBody = parsedOutput.body;
1175
+ return throwDefaultError({
1176
+ output,
1177
+ parsedBody,
1178
+ errorCode,
1179
+ });
1180
+ }
1181
+ };
1182
+ const de_StartDICOMImportJobCommand = async (output, context) => {
1183
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1184
+ return de_StartDICOMImportJobCommandError(output, context);
1185
+ }
1186
+ const contents = (0, smithy_client_1.map)({
1187
+ $metadata: deserializeMetadata(output),
1188
+ });
1189
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1190
+ const doc = (0, smithy_client_1.take)(data, {
1191
+ datastoreId: smithy_client_1.expectString,
1192
+ jobId: smithy_client_1.expectString,
1193
+ jobStatus: smithy_client_1.expectString,
1194
+ submittedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1195
+ });
1196
+ Object.assign(contents, doc);
1197
+ return contents;
1198
+ };
1199
+ exports.de_StartDICOMImportJobCommand = de_StartDICOMImportJobCommand;
1200
+ const de_StartDICOMImportJobCommandError = async (output, context) => {
1201
+ const parsedOutput = {
1202
+ ...output,
1203
+ body: await parseErrorBody(output.body, context),
1204
+ };
1205
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1206
+ switch (errorCode) {
1207
+ case "AccessDeniedException":
1208
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1209
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1210
+ case "ConflictException":
1211
+ case "com.amazonaws.medicalimaging#ConflictException":
1212
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1213
+ case "InternalServerException":
1214
+ case "com.amazonaws.medicalimaging#InternalServerException":
1215
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1216
+ case "ResourceNotFoundException":
1217
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1218
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1219
+ case "ServiceQuotaExceededException":
1220
+ case "com.amazonaws.medicalimaging#ServiceQuotaExceededException":
1221
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1222
+ case "ThrottlingException":
1223
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1224
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1225
+ case "ValidationException":
1226
+ case "com.amazonaws.medicalimaging#ValidationException":
1227
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1228
+ default:
1229
+ const parsedBody = parsedOutput.body;
1230
+ return throwDefaultError({
1231
+ output,
1232
+ parsedBody,
1233
+ errorCode,
1234
+ });
1235
+ }
1236
+ };
1237
+ const de_TagResourceCommand = async (output, context) => {
1238
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1239
+ return de_TagResourceCommandError(output, context);
1240
+ }
1241
+ const contents = (0, smithy_client_1.map)({
1242
+ $metadata: deserializeMetadata(output),
1243
+ });
1244
+ await (0, smithy_client_1.collectBody)(output.body, context);
1245
+ return contents;
1246
+ };
1247
+ exports.de_TagResourceCommand = de_TagResourceCommand;
1248
+ const de_TagResourceCommandError = async (output, context) => {
1249
+ const parsedOutput = {
1250
+ ...output,
1251
+ body: await parseErrorBody(output.body, context),
1252
+ };
1253
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1254
+ switch (errorCode) {
1255
+ case "AccessDeniedException":
1256
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1257
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1258
+ case "InternalServerException":
1259
+ case "com.amazonaws.medicalimaging#InternalServerException":
1260
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1261
+ case "ResourceNotFoundException":
1262
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1263
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1264
+ case "ThrottlingException":
1265
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1266
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1267
+ case "ValidationException":
1268
+ case "com.amazonaws.medicalimaging#ValidationException":
1269
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1270
+ default:
1271
+ const parsedBody = parsedOutput.body;
1272
+ return throwDefaultError({
1273
+ output,
1274
+ parsedBody,
1275
+ errorCode,
1276
+ });
1277
+ }
1278
+ };
1279
+ const de_UntagResourceCommand = async (output, context) => {
1280
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1281
+ return de_UntagResourceCommandError(output, context);
1282
+ }
1283
+ const contents = (0, smithy_client_1.map)({
1284
+ $metadata: deserializeMetadata(output),
1285
+ });
1286
+ await (0, smithy_client_1.collectBody)(output.body, context);
1287
+ return contents;
1288
+ };
1289
+ exports.de_UntagResourceCommand = de_UntagResourceCommand;
1290
+ const de_UntagResourceCommandError = async (output, context) => {
1291
+ const parsedOutput = {
1292
+ ...output,
1293
+ body: await parseErrorBody(output.body, context),
1294
+ };
1295
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1296
+ switch (errorCode) {
1297
+ case "AccessDeniedException":
1298
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1299
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1300
+ case "InternalServerException":
1301
+ case "com.amazonaws.medicalimaging#InternalServerException":
1302
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1303
+ case "ResourceNotFoundException":
1304
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1305
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1306
+ case "ThrottlingException":
1307
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1308
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1309
+ case "ValidationException":
1310
+ case "com.amazonaws.medicalimaging#ValidationException":
1311
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1312
+ default:
1313
+ const parsedBody = parsedOutput.body;
1314
+ return throwDefaultError({
1315
+ output,
1316
+ parsedBody,
1317
+ errorCode,
1318
+ });
1319
+ }
1320
+ };
1321
+ const de_UpdateImageSetMetadataCommand = async (output, context) => {
1322
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1323
+ return de_UpdateImageSetMetadataCommandError(output, context);
1324
+ }
1325
+ const contents = (0, smithy_client_1.map)({
1326
+ $metadata: deserializeMetadata(output),
1327
+ });
1328
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1329
+ const doc = (0, smithy_client_1.take)(data, {
1330
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1331
+ datastoreId: smithy_client_1.expectString,
1332
+ imageSetId: smithy_client_1.expectString,
1333
+ imageSetState: smithy_client_1.expectString,
1334
+ imageSetWorkflowStatus: smithy_client_1.expectString,
1335
+ latestVersionId: smithy_client_1.expectString,
1336
+ message: smithy_client_1.expectString,
1337
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1338
+ });
1339
+ Object.assign(contents, doc);
1340
+ return contents;
1341
+ };
1342
+ exports.de_UpdateImageSetMetadataCommand = de_UpdateImageSetMetadataCommand;
1343
+ const de_UpdateImageSetMetadataCommandError = async (output, context) => {
1344
+ const parsedOutput = {
1345
+ ...output,
1346
+ body: await parseErrorBody(output.body, context),
1347
+ };
1348
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1349
+ switch (errorCode) {
1350
+ case "AccessDeniedException":
1351
+ case "com.amazonaws.medicalimaging#AccessDeniedException":
1352
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1353
+ case "ConflictException":
1354
+ case "com.amazonaws.medicalimaging#ConflictException":
1355
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1356
+ case "InternalServerException":
1357
+ case "com.amazonaws.medicalimaging#InternalServerException":
1358
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1359
+ case "ResourceNotFoundException":
1360
+ case "com.amazonaws.medicalimaging#ResourceNotFoundException":
1361
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1362
+ case "ServiceQuotaExceededException":
1363
+ case "com.amazonaws.medicalimaging#ServiceQuotaExceededException":
1364
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1365
+ case "ThrottlingException":
1366
+ case "com.amazonaws.medicalimaging#ThrottlingException":
1367
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1368
+ case "ValidationException":
1369
+ case "com.amazonaws.medicalimaging#ValidationException":
1370
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1371
+ default:
1372
+ const parsedBody = parsedOutput.body;
1373
+ return throwDefaultError({
1374
+ output,
1375
+ parsedBody,
1376
+ errorCode,
1377
+ });
1378
+ }
1379
+ };
1380
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MedicalImagingServiceException_1.MedicalImagingServiceException);
1381
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1382
+ const contents = (0, smithy_client_1.map)({});
1383
+ const data = parsedOutput.body;
1384
+ const doc = (0, smithy_client_1.take)(data, {
1385
+ message: smithy_client_1.expectString,
1386
+ });
1387
+ Object.assign(contents, doc);
1388
+ const exception = new models_0_1.AccessDeniedException({
1389
+ $metadata: deserializeMetadata(parsedOutput),
1390
+ ...contents,
1391
+ });
1392
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1393
+ };
1394
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
1395
+ const contents = (0, smithy_client_1.map)({});
1396
+ const data = parsedOutput.body;
1397
+ const doc = (0, smithy_client_1.take)(data, {
1398
+ message: smithy_client_1.expectString,
1399
+ });
1400
+ Object.assign(contents, doc);
1401
+ const exception = new models_0_1.ConflictException({
1402
+ $metadata: deserializeMetadata(parsedOutput),
1403
+ ...contents,
1404
+ });
1405
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1406
+ };
1407
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1408
+ const contents = (0, smithy_client_1.map)({});
1409
+ const data = parsedOutput.body;
1410
+ const doc = (0, smithy_client_1.take)(data, {
1411
+ message: smithy_client_1.expectString,
1412
+ });
1413
+ Object.assign(contents, doc);
1414
+ const exception = new models_0_1.InternalServerException({
1415
+ $metadata: deserializeMetadata(parsedOutput),
1416
+ ...contents,
1417
+ });
1418
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1419
+ };
1420
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1421
+ const contents = (0, smithy_client_1.map)({});
1422
+ const data = parsedOutput.body;
1423
+ const doc = (0, smithy_client_1.take)(data, {
1424
+ message: smithy_client_1.expectString,
1425
+ });
1426
+ Object.assign(contents, doc);
1427
+ const exception = new models_0_1.ResourceNotFoundException({
1428
+ $metadata: deserializeMetadata(parsedOutput),
1429
+ ...contents,
1430
+ });
1431
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1432
+ };
1433
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1434
+ const contents = (0, smithy_client_1.map)({});
1435
+ const data = parsedOutput.body;
1436
+ const doc = (0, smithy_client_1.take)(data, {
1437
+ message: smithy_client_1.expectString,
1438
+ });
1439
+ Object.assign(contents, doc);
1440
+ const exception = new models_0_1.ServiceQuotaExceededException({
1441
+ $metadata: deserializeMetadata(parsedOutput),
1442
+ ...contents,
1443
+ });
1444
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1445
+ };
1446
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1447
+ const contents = (0, smithy_client_1.map)({});
1448
+ const data = parsedOutput.body;
1449
+ const doc = (0, smithy_client_1.take)(data, {
1450
+ message: smithy_client_1.expectString,
1451
+ });
1452
+ Object.assign(contents, doc);
1453
+ const exception = new models_0_1.ThrottlingException({
1454
+ $metadata: deserializeMetadata(parsedOutput),
1455
+ ...contents,
1456
+ });
1457
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1458
+ };
1459
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1460
+ const contents = (0, smithy_client_1.map)({});
1461
+ const data = parsedOutput.body;
1462
+ const doc = (0, smithy_client_1.take)(data, {
1463
+ message: smithy_client_1.expectString,
1464
+ });
1465
+ Object.assign(contents, doc);
1466
+ const exception = new models_0_1.ValidationException({
1467
+ $metadata: deserializeMetadata(parsedOutput),
1468
+ ...contents,
1469
+ });
1470
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1471
+ };
1472
+ const se_DICOMUpdates = (input, context) => {
1473
+ return (0, smithy_client_1.take)(input, {
1474
+ removableAttributes: context.base64Encoder,
1475
+ updatableAttributes: context.base64Encoder,
1476
+ });
1477
+ };
1478
+ const se_MetadataUpdates = (input, context) => {
1479
+ return models_0_1.MetadataUpdates.visit(input, {
1480
+ DICOMUpdates: (value) => ({ DICOMUpdates: se_DICOMUpdates(value, context) }),
1481
+ _: (name, value) => ({ name: value }),
1482
+ });
1483
+ };
1484
+ const se_SearchByAttributeValue = (input, context) => {
1485
+ return models_0_1.SearchByAttributeValue.visit(input, {
1486
+ DICOMAccessionNumber: (value) => ({ DICOMAccessionNumber: value }),
1487
+ DICOMPatientId: (value) => ({ DICOMPatientId: value }),
1488
+ DICOMStudyDateAndTime: (value) => ({ DICOMStudyDateAndTime: (0, smithy_client_1._json)(value) }),
1489
+ DICOMStudyId: (value) => ({ DICOMStudyId: value }),
1490
+ DICOMStudyInstanceUID: (value) => ({ DICOMStudyInstanceUID: value }),
1491
+ createdAt: (value) => ({ createdAt: Math.round(value.getTime() / 1000) }),
1492
+ _: (name, value) => ({ name: value }),
1493
+ });
1494
+ };
1495
+ const se_SearchByAttributeValues = (input, context) => {
1496
+ return input
1497
+ .filter((e) => e != null)
1498
+ .map((entry) => {
1499
+ return se_SearchByAttributeValue(entry, context);
1500
+ });
1501
+ };
1502
+ const se_SearchCriteria = (input, context) => {
1503
+ return (0, smithy_client_1.take)(input, {
1504
+ filters: (_) => se_SearchFilters(_, context),
1505
+ });
1506
+ };
1507
+ const se_SearchFilter = (input, context) => {
1508
+ return (0, smithy_client_1.take)(input, {
1509
+ operator: [],
1510
+ values: (_) => se_SearchByAttributeValues(_, context),
1511
+ });
1512
+ };
1513
+ const se_SearchFilters = (input, context) => {
1514
+ return input
1515
+ .filter((e) => e != null)
1516
+ .map((entry) => {
1517
+ return se_SearchFilter(entry, context);
1518
+ });
1519
+ };
1520
+ const de_CopyDestinationImageSetProperties = (output, context) => {
1521
+ return (0, smithy_client_1.take)(output, {
1522
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1523
+ imageSetArn: smithy_client_1.expectString,
1524
+ imageSetId: smithy_client_1.expectString,
1525
+ imageSetState: smithy_client_1.expectString,
1526
+ imageSetWorkflowStatus: smithy_client_1.expectString,
1527
+ latestVersionId: smithy_client_1.expectString,
1528
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1529
+ });
1530
+ };
1531
+ const de_CopySourceImageSetProperties = (output, context) => {
1532
+ return (0, smithy_client_1.take)(output, {
1533
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1534
+ imageSetArn: smithy_client_1.expectString,
1535
+ imageSetId: smithy_client_1.expectString,
1536
+ imageSetState: smithy_client_1.expectString,
1537
+ imageSetWorkflowStatus: smithy_client_1.expectString,
1538
+ latestVersionId: smithy_client_1.expectString,
1539
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1540
+ });
1541
+ };
1542
+ const de_DatastoreProperties = (output, context) => {
1543
+ return (0, smithy_client_1.take)(output, {
1544
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1545
+ datastoreArn: smithy_client_1.expectString,
1546
+ datastoreId: smithy_client_1.expectString,
1547
+ datastoreName: smithy_client_1.expectString,
1548
+ datastoreStatus: smithy_client_1.expectString,
1549
+ kmsKeyArn: smithy_client_1.expectString,
1550
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1551
+ });
1552
+ };
1553
+ const de_DatastoreSummaries = (output, context) => {
1554
+ const retVal = (output || [])
1555
+ .filter((e) => e != null)
1556
+ .map((entry) => {
1557
+ return de_DatastoreSummary(entry, context);
1558
+ });
1559
+ return retVal;
1560
+ };
1561
+ const de_DatastoreSummary = (output, context) => {
1562
+ return (0, smithy_client_1.take)(output, {
1563
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1564
+ datastoreArn: smithy_client_1.expectString,
1565
+ datastoreId: smithy_client_1.expectString,
1566
+ datastoreName: smithy_client_1.expectString,
1567
+ datastoreStatus: smithy_client_1.expectString,
1568
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1569
+ });
1570
+ };
1571
+ const de_DICOMImportJobProperties = (output, context) => {
1572
+ return (0, smithy_client_1.take)(output, {
1573
+ dataAccessRoleArn: smithy_client_1.expectString,
1574
+ datastoreId: smithy_client_1.expectString,
1575
+ endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1576
+ inputS3Uri: smithy_client_1.expectString,
1577
+ jobId: smithy_client_1.expectString,
1578
+ jobName: smithy_client_1.expectString,
1579
+ jobStatus: smithy_client_1.expectString,
1580
+ message: smithy_client_1.expectString,
1581
+ outputS3Uri: smithy_client_1.expectString,
1582
+ submittedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1583
+ });
1584
+ };
1585
+ const de_DICOMImportJobSummaries = (output, context) => {
1586
+ const retVal = (output || [])
1587
+ .filter((e) => e != null)
1588
+ .map((entry) => {
1589
+ return de_DICOMImportJobSummary(entry, context);
1590
+ });
1591
+ return retVal;
1592
+ };
1593
+ const de_DICOMImportJobSummary = (output, context) => {
1594
+ return (0, smithy_client_1.take)(output, {
1595
+ dataAccessRoleArn: smithy_client_1.expectString,
1596
+ datastoreId: smithy_client_1.expectString,
1597
+ endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1598
+ jobId: smithy_client_1.expectString,
1599
+ jobName: smithy_client_1.expectString,
1600
+ jobStatus: smithy_client_1.expectString,
1601
+ message: smithy_client_1.expectString,
1602
+ submittedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1603
+ });
1604
+ };
1605
+ const de_ImageSetProperties = (output, context) => {
1606
+ return (0, smithy_client_1.take)(output, {
1607
+ ImageSetWorkflowStatus: smithy_client_1.expectString,
1608
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1609
+ deletedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1610
+ imageSetId: smithy_client_1.expectString,
1611
+ imageSetState: smithy_client_1.expectString,
1612
+ message: smithy_client_1.expectString,
1613
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1614
+ versionId: smithy_client_1.expectString,
1615
+ });
1616
+ };
1617
+ const de_ImageSetPropertiesList = (output, context) => {
1618
+ const retVal = (output || [])
1619
+ .filter((e) => e != null)
1620
+ .map((entry) => {
1621
+ return de_ImageSetProperties(entry, context);
1622
+ });
1623
+ return retVal;
1624
+ };
1625
+ const de_ImageSetsMetadataSummaries = (output, context) => {
1626
+ const retVal = (output || [])
1627
+ .filter((e) => e != null)
1628
+ .map((entry) => {
1629
+ return de_ImageSetsMetadataSummary(entry, context);
1630
+ });
1631
+ return retVal;
1632
+ };
1633
+ const de_ImageSetsMetadataSummary = (output, context) => {
1634
+ return (0, smithy_client_1.take)(output, {
1635
+ DICOMTags: smithy_client_1._json,
1636
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1637
+ imageSetId: smithy_client_1.expectString,
1638
+ updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1639
+ version: smithy_client_1.expectInt32,
1640
+ });
1641
+ };
1642
+ const deserializeMetadata = (output) => ({
1643
+ httpStatusCode: output.statusCode,
1644
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1645
+ extendedRequestId: output.headers["x-amz-id-2"],
1646
+ cfId: output.headers["x-amz-cf-id"],
1647
+ });
1648
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1649
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1650
+ value !== null &&
1651
+ value !== "" &&
1652
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1653
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1654
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1655
+ if (encoded.length) {
1656
+ return JSON.parse(encoded);
1657
+ }
1658
+ return {};
1659
+ });
1660
+ const parseErrorBody = async (errorBody, context) => {
1661
+ const value = await parseBody(errorBody, context);
1662
+ value.message = value.message ?? value.Message;
1663
+ return value;
1664
+ };
1665
+ const loadRestJsonErrorCode = (output, data) => {
1666
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1667
+ const sanitizeErrorCode = (rawValue) => {
1668
+ let cleanValue = rawValue;
1669
+ if (typeof cleanValue === "number") {
1670
+ cleanValue = cleanValue.toString();
1671
+ }
1672
+ if (cleanValue.indexOf(",") >= 0) {
1673
+ cleanValue = cleanValue.split(",")[0];
1674
+ }
1675
+ if (cleanValue.indexOf(":") >= 0) {
1676
+ cleanValue = cleanValue.split(":")[0];
1677
+ }
1678
+ if (cleanValue.indexOf("#") >= 0) {
1679
+ cleanValue = cleanValue.split("#")[1];
1680
+ }
1681
+ return cleanValue;
1682
+ };
1683
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1684
+ if (headerKey !== undefined) {
1685
+ return sanitizeErrorCode(output.headers[headerKey]);
1686
+ }
1687
+ if (data.code !== undefined) {
1688
+ return sanitizeErrorCode(data.code);
1689
+ }
1690
+ if (data["__type"] !== undefined) {
1691
+ return sanitizeErrorCode(data["__type"]);
1692
+ }
1693
+ };