@aws-sdk/client-braket 3.489.0 → 3.495.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 (30) hide show
  1. package/dist-cjs/Braket.js +1 -37
  2. package/dist-cjs/BraketClient.js +1 -43
  3. package/dist-cjs/commands/CancelJobCommand.js +1 -28
  4. package/dist-cjs/commands/CancelQuantumTaskCommand.js +1 -28
  5. package/dist-cjs/commands/CreateJobCommand.js +1 -28
  6. package/dist-cjs/commands/CreateQuantumTaskCommand.js +1 -28
  7. package/dist-cjs/commands/GetDeviceCommand.js +1 -28
  8. package/dist-cjs/commands/GetJobCommand.js +1 -28
  9. package/dist-cjs/commands/GetQuantumTaskCommand.js +1 -28
  10. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  11. package/dist-cjs/commands/SearchDevicesCommand.js +1 -28
  12. package/dist-cjs/commands/SearchJobsCommand.js +1 -28
  13. package/dist-cjs/commands/SearchQuantumTasksCommand.js +1 -28
  14. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  15. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  16. package/dist-cjs/commands/index.js +1 -16
  17. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  18. package/dist-cjs/extensionConfiguration.js +1 -2
  19. package/dist-cjs/index.js +1796 -11
  20. package/dist-cjs/models/BraketServiceException.js +1 -12
  21. package/dist-cjs/models/index.js +1 -4
  22. package/dist-cjs/models/models_0.js +1 -243
  23. package/dist-cjs/pagination/Interfaces.js +1 -2
  24. package/dist-cjs/pagination/SearchDevicesPaginator.js +1 -7
  25. package/dist-cjs/pagination/SearchJobsPaginator.js +1 -7
  26. package/dist-cjs/pagination/SearchQuantumTasksPaginator.js +1 -7
  27. package/dist-cjs/pagination/index.js +1 -7
  28. package/dist-cjs/protocols/Aws_restJson1.js +1 -1066
  29. package/dist-cjs/runtimeExtensions.js +1 -22
  30. package/package.json +40 -40
@@ -1,1066 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SearchQuantumTasksCommand = exports.de_SearchJobsCommand = exports.de_SearchDevicesCommand = exports.de_ListTagsForResourceCommand = exports.de_GetQuantumTaskCommand = exports.de_GetJobCommand = exports.de_GetDeviceCommand = exports.de_CreateQuantumTaskCommand = exports.de_CreateJobCommand = exports.de_CancelQuantumTaskCommand = exports.de_CancelJobCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SearchQuantumTasksCommand = exports.se_SearchJobsCommand = exports.se_SearchDevicesCommand = exports.se_ListTagsForResourceCommand = exports.se_GetQuantumTaskCommand = exports.se_GetJobCommand = exports.se_GetDeviceCommand = exports.se_CreateQuantumTaskCommand = exports.se_CreateJobCommand = exports.se_CancelQuantumTaskCommand = exports.se_CancelJobCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const BraketServiceException_1 = require("../models/BraketServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_CancelJobCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {};
12
- b.bp("/job/{jobArn}/cancel");
13
- b.p("jobArn", () => input.jobArn, "{jobArn}", false);
14
- let body;
15
- b.m("PUT").h(headers).b(body);
16
- return b.build();
17
- };
18
- exports.se_CancelJobCommand = se_CancelJobCommand;
19
- const se_CancelQuantumTaskCommand = async (input, context) => {
20
- const b = (0, core_1.requestBuilder)(input, context);
21
- const headers = {
22
- "content-type": "application/json",
23
- };
24
- b.bp("/quantum-task/{quantumTaskArn}/cancel");
25
- b.p("quantumTaskArn", () => input.quantumTaskArn, "{quantumTaskArn}", false);
26
- let body;
27
- body = JSON.stringify((0, smithy_client_1.take)(input, {
28
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
29
- }));
30
- b.m("PUT").h(headers).b(body);
31
- return b.build();
32
- };
33
- exports.se_CancelQuantumTaskCommand = se_CancelQuantumTaskCommand;
34
- const se_CreateJobCommand = async (input, context) => {
35
- const b = (0, core_1.requestBuilder)(input, context);
36
- const headers = {
37
- "content-type": "application/json",
38
- };
39
- b.bp("/job");
40
- let body;
41
- body = JSON.stringify((0, smithy_client_1.take)(input, {
42
- algorithmSpecification: (_) => (0, smithy_client_1._json)(_),
43
- associations: (_) => (0, smithy_client_1._json)(_),
44
- checkpointConfig: (_) => (0, smithy_client_1._json)(_),
45
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
46
- deviceConfig: (_) => (0, smithy_client_1._json)(_),
47
- hyperParameters: (_) => (0, smithy_client_1._json)(_),
48
- inputDataConfig: (_) => (0, smithy_client_1._json)(_),
49
- instanceConfig: (_) => (0, smithy_client_1._json)(_),
50
- jobName: [],
51
- outputDataConfig: (_) => (0, smithy_client_1._json)(_),
52
- roleArn: [],
53
- stoppingCondition: (_) => (0, smithy_client_1._json)(_),
54
- tags: (_) => (0, smithy_client_1._json)(_),
55
- }));
56
- b.m("POST").h(headers).b(body);
57
- return b.build();
58
- };
59
- exports.se_CreateJobCommand = se_CreateJobCommand;
60
- const se_CreateQuantumTaskCommand = async (input, context) => {
61
- const b = (0, core_1.requestBuilder)(input, context);
62
- const headers = {
63
- "content-type": "application/json",
64
- };
65
- b.bp("/quantum-task");
66
- let body;
67
- body = JSON.stringify((0, smithy_client_1.take)(input, {
68
- action: (_) => smithy_client_1.LazyJsonString.fromObject(_),
69
- associations: (_) => (0, smithy_client_1._json)(_),
70
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
71
- deviceArn: [],
72
- deviceParameters: (_) => smithy_client_1.LazyJsonString.fromObject(_),
73
- jobToken: [],
74
- outputS3Bucket: [],
75
- outputS3KeyPrefix: [],
76
- shots: [],
77
- tags: (_) => (0, smithy_client_1._json)(_),
78
- }));
79
- b.m("POST").h(headers).b(body);
80
- return b.build();
81
- };
82
- exports.se_CreateQuantumTaskCommand = se_CreateQuantumTaskCommand;
83
- const se_GetDeviceCommand = async (input, context) => {
84
- const b = (0, core_1.requestBuilder)(input, context);
85
- const headers = {};
86
- b.bp("/device/{deviceArn}");
87
- b.p("deviceArn", () => input.deviceArn, "{deviceArn}", false);
88
- let body;
89
- b.m("GET").h(headers).b(body);
90
- return b.build();
91
- };
92
- exports.se_GetDeviceCommand = se_GetDeviceCommand;
93
- const se_GetJobCommand = async (input, context) => {
94
- const b = (0, core_1.requestBuilder)(input, context);
95
- const headers = {};
96
- b.bp("/job/{jobArn}");
97
- b.p("jobArn", () => input.jobArn, "{jobArn}", false);
98
- const query = (0, smithy_client_1.map)({
99
- [_aAN]: [
100
- () => input.additionalAttributeNames !== void 0,
101
- () => (input[_aAN] || []).map((_entry) => _entry),
102
- ],
103
- });
104
- let body;
105
- b.m("GET").h(headers).q(query).b(body);
106
- return b.build();
107
- };
108
- exports.se_GetJobCommand = se_GetJobCommand;
109
- const se_GetQuantumTaskCommand = async (input, context) => {
110
- const b = (0, core_1.requestBuilder)(input, context);
111
- const headers = {};
112
- b.bp("/quantum-task/{quantumTaskArn}");
113
- b.p("quantumTaskArn", () => input.quantumTaskArn, "{quantumTaskArn}", false);
114
- const query = (0, smithy_client_1.map)({
115
- [_aAN]: [
116
- () => input.additionalAttributeNames !== void 0,
117
- () => (input[_aAN] || []).map((_entry) => _entry),
118
- ],
119
- });
120
- let body;
121
- b.m("GET").h(headers).q(query).b(body);
122
- return b.build();
123
- };
124
- exports.se_GetQuantumTaskCommand = se_GetQuantumTaskCommand;
125
- const se_ListTagsForResourceCommand = async (input, context) => {
126
- const b = (0, core_1.requestBuilder)(input, context);
127
- const headers = {};
128
- b.bp("/tags/{resourceArn}");
129
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
130
- let body;
131
- b.m("GET").h(headers).b(body);
132
- return b.build();
133
- };
134
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
135
- const se_SearchDevicesCommand = async (input, context) => {
136
- const b = (0, core_1.requestBuilder)(input, context);
137
- const headers = {
138
- "content-type": "application/json",
139
- };
140
- b.bp("/devices");
141
- let body;
142
- body = JSON.stringify((0, smithy_client_1.take)(input, {
143
- filters: (_) => (0, smithy_client_1._json)(_),
144
- maxResults: [],
145
- nextToken: [],
146
- }));
147
- b.m("POST").h(headers).b(body);
148
- return b.build();
149
- };
150
- exports.se_SearchDevicesCommand = se_SearchDevicesCommand;
151
- const se_SearchJobsCommand = async (input, context) => {
152
- const b = (0, core_1.requestBuilder)(input, context);
153
- const headers = {
154
- "content-type": "application/json",
155
- };
156
- b.bp("/jobs");
157
- let body;
158
- body = JSON.stringify((0, smithy_client_1.take)(input, {
159
- filters: (_) => (0, smithy_client_1._json)(_),
160
- maxResults: [],
161
- nextToken: [],
162
- }));
163
- b.m("POST").h(headers).b(body);
164
- return b.build();
165
- };
166
- exports.se_SearchJobsCommand = se_SearchJobsCommand;
167
- const se_SearchQuantumTasksCommand = async (input, context) => {
168
- const b = (0, core_1.requestBuilder)(input, context);
169
- const headers = {
170
- "content-type": "application/json",
171
- };
172
- b.bp("/quantum-tasks");
173
- let body;
174
- body = JSON.stringify((0, smithy_client_1.take)(input, {
175
- filters: (_) => (0, smithy_client_1._json)(_),
176
- maxResults: [],
177
- nextToken: [],
178
- }));
179
- b.m("POST").h(headers).b(body);
180
- return b.build();
181
- };
182
- exports.se_SearchQuantumTasksCommand = se_SearchQuantumTasksCommand;
183
- const se_TagResourceCommand = async (input, context) => {
184
- const b = (0, core_1.requestBuilder)(input, context);
185
- const headers = {
186
- "content-type": "application/json",
187
- };
188
- b.bp("/tags/{resourceArn}");
189
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
190
- let body;
191
- body = JSON.stringify((0, smithy_client_1.take)(input, {
192
- tags: (_) => (0, smithy_client_1._json)(_),
193
- }));
194
- b.m("POST").h(headers).b(body);
195
- return b.build();
196
- };
197
- exports.se_TagResourceCommand = se_TagResourceCommand;
198
- const se_UntagResourceCommand = async (input, context) => {
199
- const b = (0, core_1.requestBuilder)(input, context);
200
- const headers = {};
201
- b.bp("/tags/{resourceArn}");
202
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
203
- const query = (0, smithy_client_1.map)({
204
- [_tK]: [
205
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
206
- () => (input[_tK] || []).map((_entry) => _entry),
207
- ],
208
- });
209
- let body;
210
- b.m("DELETE").h(headers).q(query).b(body);
211
- return b.build();
212
- };
213
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
214
- const de_CancelJobCommand = async (output, context) => {
215
- if (output.statusCode !== 200 && output.statusCode >= 300) {
216
- return de_CancelJobCommandError(output, context);
217
- }
218
- const contents = (0, smithy_client_1.map)({
219
- $metadata: deserializeMetadata(output),
220
- });
221
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
222
- const doc = (0, smithy_client_1.take)(data, {
223
- cancellationStatus: smithy_client_1.expectString,
224
- jobArn: smithy_client_1.expectString,
225
- });
226
- Object.assign(contents, doc);
227
- return contents;
228
- };
229
- exports.de_CancelJobCommand = de_CancelJobCommand;
230
- const de_CancelJobCommandError = async (output, context) => {
231
- const parsedOutput = {
232
- ...output,
233
- body: await parseErrorBody(output.body, context),
234
- };
235
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
236
- switch (errorCode) {
237
- case "AccessDeniedException":
238
- case "com.amazonaws.braket#AccessDeniedException":
239
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
240
- case "ConflictException":
241
- case "com.amazonaws.braket#ConflictException":
242
- throw await de_ConflictExceptionRes(parsedOutput, context);
243
- case "InternalServiceException":
244
- case "com.amazonaws.braket#InternalServiceException":
245
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
246
- case "ResourceNotFoundException":
247
- case "com.amazonaws.braket#ResourceNotFoundException":
248
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
249
- case "ThrottlingException":
250
- case "com.amazonaws.braket#ThrottlingException":
251
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
252
- case "ValidationException":
253
- case "com.amazonaws.braket#ValidationException":
254
- throw await de_ValidationExceptionRes(parsedOutput, context);
255
- default:
256
- const parsedBody = parsedOutput.body;
257
- return throwDefaultError({
258
- output,
259
- parsedBody,
260
- errorCode,
261
- });
262
- }
263
- };
264
- const de_CancelQuantumTaskCommand = async (output, context) => {
265
- if (output.statusCode !== 200 && output.statusCode >= 300) {
266
- return de_CancelQuantumTaskCommandError(output, context);
267
- }
268
- const contents = (0, smithy_client_1.map)({
269
- $metadata: deserializeMetadata(output),
270
- });
271
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
272
- const doc = (0, smithy_client_1.take)(data, {
273
- cancellationStatus: smithy_client_1.expectString,
274
- quantumTaskArn: smithy_client_1.expectString,
275
- });
276
- Object.assign(contents, doc);
277
- return contents;
278
- };
279
- exports.de_CancelQuantumTaskCommand = de_CancelQuantumTaskCommand;
280
- const de_CancelQuantumTaskCommandError = async (output, context) => {
281
- const parsedOutput = {
282
- ...output,
283
- body: await parseErrorBody(output.body, context),
284
- };
285
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
286
- switch (errorCode) {
287
- case "AccessDeniedException":
288
- case "com.amazonaws.braket#AccessDeniedException":
289
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
290
- case "ConflictException":
291
- case "com.amazonaws.braket#ConflictException":
292
- throw await de_ConflictExceptionRes(parsedOutput, context);
293
- case "InternalServiceException":
294
- case "com.amazonaws.braket#InternalServiceException":
295
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
296
- case "ResourceNotFoundException":
297
- case "com.amazonaws.braket#ResourceNotFoundException":
298
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
299
- case "ThrottlingException":
300
- case "com.amazonaws.braket#ThrottlingException":
301
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
302
- case "ValidationException":
303
- case "com.amazonaws.braket#ValidationException":
304
- throw await de_ValidationExceptionRes(parsedOutput, context);
305
- default:
306
- const parsedBody = parsedOutput.body;
307
- return throwDefaultError({
308
- output,
309
- parsedBody,
310
- errorCode,
311
- });
312
- }
313
- };
314
- const de_CreateJobCommand = async (output, context) => {
315
- if (output.statusCode !== 201 && output.statusCode >= 300) {
316
- return de_CreateJobCommandError(output, context);
317
- }
318
- const contents = (0, smithy_client_1.map)({
319
- $metadata: deserializeMetadata(output),
320
- });
321
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
322
- const doc = (0, smithy_client_1.take)(data, {
323
- jobArn: smithy_client_1.expectString,
324
- });
325
- Object.assign(contents, doc);
326
- return contents;
327
- };
328
- exports.de_CreateJobCommand = de_CreateJobCommand;
329
- const de_CreateJobCommandError = async (output, context) => {
330
- const parsedOutput = {
331
- ...output,
332
- body: await parseErrorBody(output.body, context),
333
- };
334
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
335
- switch (errorCode) {
336
- case "AccessDeniedException":
337
- case "com.amazonaws.braket#AccessDeniedException":
338
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
339
- case "ConflictException":
340
- case "com.amazonaws.braket#ConflictException":
341
- throw await de_ConflictExceptionRes(parsedOutput, context);
342
- case "DeviceRetiredException":
343
- case "com.amazonaws.braket#DeviceRetiredException":
344
- throw await de_DeviceRetiredExceptionRes(parsedOutput, context);
345
- case "InternalServiceException":
346
- case "com.amazonaws.braket#InternalServiceException":
347
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
348
- case "ServiceQuotaExceededException":
349
- case "com.amazonaws.braket#ServiceQuotaExceededException":
350
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
351
- case "ThrottlingException":
352
- case "com.amazonaws.braket#ThrottlingException":
353
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
354
- case "ValidationException":
355
- case "com.amazonaws.braket#ValidationException":
356
- throw await de_ValidationExceptionRes(parsedOutput, context);
357
- default:
358
- const parsedBody = parsedOutput.body;
359
- return throwDefaultError({
360
- output,
361
- parsedBody,
362
- errorCode,
363
- });
364
- }
365
- };
366
- const de_CreateQuantumTaskCommand = async (output, context) => {
367
- if (output.statusCode !== 201 && output.statusCode >= 300) {
368
- return de_CreateQuantumTaskCommandError(output, context);
369
- }
370
- const contents = (0, smithy_client_1.map)({
371
- $metadata: deserializeMetadata(output),
372
- });
373
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
374
- const doc = (0, smithy_client_1.take)(data, {
375
- quantumTaskArn: smithy_client_1.expectString,
376
- });
377
- Object.assign(contents, doc);
378
- return contents;
379
- };
380
- exports.de_CreateQuantumTaskCommand = de_CreateQuantumTaskCommand;
381
- const de_CreateQuantumTaskCommandError = async (output, context) => {
382
- const parsedOutput = {
383
- ...output,
384
- body: await parseErrorBody(output.body, context),
385
- };
386
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
387
- switch (errorCode) {
388
- case "AccessDeniedException":
389
- case "com.amazonaws.braket#AccessDeniedException":
390
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
391
- case "DeviceOfflineException":
392
- case "com.amazonaws.braket#DeviceOfflineException":
393
- throw await de_DeviceOfflineExceptionRes(parsedOutput, context);
394
- case "DeviceRetiredException":
395
- case "com.amazonaws.braket#DeviceRetiredException":
396
- throw await de_DeviceRetiredExceptionRes(parsedOutput, context);
397
- case "InternalServiceException":
398
- case "com.amazonaws.braket#InternalServiceException":
399
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
400
- case "ServiceQuotaExceededException":
401
- case "com.amazonaws.braket#ServiceQuotaExceededException":
402
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
403
- case "ThrottlingException":
404
- case "com.amazonaws.braket#ThrottlingException":
405
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
406
- case "ValidationException":
407
- case "com.amazonaws.braket#ValidationException":
408
- throw await de_ValidationExceptionRes(parsedOutput, context);
409
- default:
410
- const parsedBody = parsedOutput.body;
411
- return throwDefaultError({
412
- output,
413
- parsedBody,
414
- errorCode,
415
- });
416
- }
417
- };
418
- const de_GetDeviceCommand = async (output, context) => {
419
- if (output.statusCode !== 200 && output.statusCode >= 300) {
420
- return de_GetDeviceCommandError(output, context);
421
- }
422
- const contents = (0, smithy_client_1.map)({
423
- $metadata: deserializeMetadata(output),
424
- });
425
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
426
- const doc = (0, smithy_client_1.take)(data, {
427
- deviceArn: smithy_client_1.expectString,
428
- deviceCapabilities: (_) => new smithy_client_1.LazyJsonString(_),
429
- deviceName: smithy_client_1.expectString,
430
- deviceQueueInfo: smithy_client_1._json,
431
- deviceStatus: smithy_client_1.expectString,
432
- deviceType: smithy_client_1.expectString,
433
- providerName: smithy_client_1.expectString,
434
- });
435
- Object.assign(contents, doc);
436
- return contents;
437
- };
438
- exports.de_GetDeviceCommand = de_GetDeviceCommand;
439
- const de_GetDeviceCommandError = async (output, context) => {
440
- const parsedOutput = {
441
- ...output,
442
- body: await parseErrorBody(output.body, context),
443
- };
444
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
445
- switch (errorCode) {
446
- case "AccessDeniedException":
447
- case "com.amazonaws.braket#AccessDeniedException":
448
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
449
- case "InternalServiceException":
450
- case "com.amazonaws.braket#InternalServiceException":
451
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
452
- case "ResourceNotFoundException":
453
- case "com.amazonaws.braket#ResourceNotFoundException":
454
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
455
- case "ThrottlingException":
456
- case "com.amazonaws.braket#ThrottlingException":
457
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
458
- case "ValidationException":
459
- case "com.amazonaws.braket#ValidationException":
460
- throw await de_ValidationExceptionRes(parsedOutput, context);
461
- default:
462
- const parsedBody = parsedOutput.body;
463
- return throwDefaultError({
464
- output,
465
- parsedBody,
466
- errorCode,
467
- });
468
- }
469
- };
470
- const de_GetJobCommand = async (output, context) => {
471
- if (output.statusCode !== 200 && output.statusCode >= 300) {
472
- return de_GetJobCommandError(output, context);
473
- }
474
- const contents = (0, smithy_client_1.map)({
475
- $metadata: deserializeMetadata(output),
476
- });
477
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
478
- const doc = (0, smithy_client_1.take)(data, {
479
- algorithmSpecification: smithy_client_1._json,
480
- associations: smithy_client_1._json,
481
- billableDuration: smithy_client_1.expectInt32,
482
- checkpointConfig: smithy_client_1._json,
483
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
484
- deviceConfig: smithy_client_1._json,
485
- endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
486
- events: (_) => de_JobEvents(_, context),
487
- failureReason: smithy_client_1.expectString,
488
- hyperParameters: smithy_client_1._json,
489
- inputDataConfig: smithy_client_1._json,
490
- instanceConfig: smithy_client_1._json,
491
- jobArn: smithy_client_1.expectString,
492
- jobName: smithy_client_1.expectString,
493
- outputDataConfig: smithy_client_1._json,
494
- queueInfo: smithy_client_1._json,
495
- roleArn: smithy_client_1.expectString,
496
- startedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
497
- status: smithy_client_1.expectString,
498
- stoppingCondition: smithy_client_1._json,
499
- tags: smithy_client_1._json,
500
- });
501
- Object.assign(contents, doc);
502
- return contents;
503
- };
504
- exports.de_GetJobCommand = de_GetJobCommand;
505
- const de_GetJobCommandError = async (output, context) => {
506
- const parsedOutput = {
507
- ...output,
508
- body: await parseErrorBody(output.body, context),
509
- };
510
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
511
- switch (errorCode) {
512
- case "AccessDeniedException":
513
- case "com.amazonaws.braket#AccessDeniedException":
514
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
515
- case "InternalServiceException":
516
- case "com.amazonaws.braket#InternalServiceException":
517
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
518
- case "ResourceNotFoundException":
519
- case "com.amazonaws.braket#ResourceNotFoundException":
520
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
521
- case "ThrottlingException":
522
- case "com.amazonaws.braket#ThrottlingException":
523
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
524
- case "ValidationException":
525
- case "com.amazonaws.braket#ValidationException":
526
- throw await de_ValidationExceptionRes(parsedOutput, context);
527
- default:
528
- const parsedBody = parsedOutput.body;
529
- return throwDefaultError({
530
- output,
531
- parsedBody,
532
- errorCode,
533
- });
534
- }
535
- };
536
- const de_GetQuantumTaskCommand = async (output, context) => {
537
- if (output.statusCode !== 200 && output.statusCode >= 300) {
538
- return de_GetQuantumTaskCommandError(output, context);
539
- }
540
- const contents = (0, smithy_client_1.map)({
541
- $metadata: deserializeMetadata(output),
542
- });
543
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
544
- const doc = (0, smithy_client_1.take)(data, {
545
- associations: smithy_client_1._json,
546
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
547
- deviceArn: smithy_client_1.expectString,
548
- deviceParameters: (_) => new smithy_client_1.LazyJsonString(_),
549
- endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
550
- failureReason: smithy_client_1.expectString,
551
- jobArn: smithy_client_1.expectString,
552
- outputS3Bucket: smithy_client_1.expectString,
553
- outputS3Directory: smithy_client_1.expectString,
554
- quantumTaskArn: smithy_client_1.expectString,
555
- queueInfo: smithy_client_1._json,
556
- shots: smithy_client_1.expectLong,
557
- status: smithy_client_1.expectString,
558
- tags: smithy_client_1._json,
559
- });
560
- Object.assign(contents, doc);
561
- return contents;
562
- };
563
- exports.de_GetQuantumTaskCommand = de_GetQuantumTaskCommand;
564
- const de_GetQuantumTaskCommandError = async (output, context) => {
565
- const parsedOutput = {
566
- ...output,
567
- body: await parseErrorBody(output.body, context),
568
- };
569
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
570
- switch (errorCode) {
571
- case "AccessDeniedException":
572
- case "com.amazonaws.braket#AccessDeniedException":
573
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
574
- case "InternalServiceException":
575
- case "com.amazonaws.braket#InternalServiceException":
576
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
577
- case "ResourceNotFoundException":
578
- case "com.amazonaws.braket#ResourceNotFoundException":
579
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
580
- case "ThrottlingException":
581
- case "com.amazonaws.braket#ThrottlingException":
582
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
583
- case "ValidationException":
584
- case "com.amazonaws.braket#ValidationException":
585
- throw await de_ValidationExceptionRes(parsedOutput, context);
586
- default:
587
- const parsedBody = parsedOutput.body;
588
- return throwDefaultError({
589
- output,
590
- parsedBody,
591
- errorCode,
592
- });
593
- }
594
- };
595
- const de_ListTagsForResourceCommand = async (output, context) => {
596
- if (output.statusCode !== 200 && output.statusCode >= 300) {
597
- return de_ListTagsForResourceCommandError(output, context);
598
- }
599
- const contents = (0, smithy_client_1.map)({
600
- $metadata: deserializeMetadata(output),
601
- });
602
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
603
- const doc = (0, smithy_client_1.take)(data, {
604
- tags: smithy_client_1._json,
605
- });
606
- Object.assign(contents, doc);
607
- return contents;
608
- };
609
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
610
- const de_ListTagsForResourceCommandError = async (output, context) => {
611
- const parsedOutput = {
612
- ...output,
613
- body: await parseErrorBody(output.body, context),
614
- };
615
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
616
- switch (errorCode) {
617
- case "InternalServiceException":
618
- case "com.amazonaws.braket#InternalServiceException":
619
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
620
- case "ResourceNotFoundException":
621
- case "com.amazonaws.braket#ResourceNotFoundException":
622
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
623
- case "ValidationException":
624
- case "com.amazonaws.braket#ValidationException":
625
- throw await de_ValidationExceptionRes(parsedOutput, context);
626
- default:
627
- const parsedBody = parsedOutput.body;
628
- return throwDefaultError({
629
- output,
630
- parsedBody,
631
- errorCode,
632
- });
633
- }
634
- };
635
- const de_SearchDevicesCommand = async (output, context) => {
636
- if (output.statusCode !== 200 && output.statusCode >= 300) {
637
- return de_SearchDevicesCommandError(output, context);
638
- }
639
- const contents = (0, smithy_client_1.map)({
640
- $metadata: deserializeMetadata(output),
641
- });
642
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
643
- const doc = (0, smithy_client_1.take)(data, {
644
- devices: smithy_client_1._json,
645
- nextToken: smithy_client_1.expectString,
646
- });
647
- Object.assign(contents, doc);
648
- return contents;
649
- };
650
- exports.de_SearchDevicesCommand = de_SearchDevicesCommand;
651
- const de_SearchDevicesCommandError = async (output, context) => {
652
- const parsedOutput = {
653
- ...output,
654
- body: await parseErrorBody(output.body, context),
655
- };
656
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
657
- switch (errorCode) {
658
- case "AccessDeniedException":
659
- case "com.amazonaws.braket#AccessDeniedException":
660
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
661
- case "InternalServiceException":
662
- case "com.amazonaws.braket#InternalServiceException":
663
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
664
- case "ThrottlingException":
665
- case "com.amazonaws.braket#ThrottlingException":
666
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
667
- case "ValidationException":
668
- case "com.amazonaws.braket#ValidationException":
669
- throw await de_ValidationExceptionRes(parsedOutput, context);
670
- default:
671
- const parsedBody = parsedOutput.body;
672
- return throwDefaultError({
673
- output,
674
- parsedBody,
675
- errorCode,
676
- });
677
- }
678
- };
679
- const de_SearchJobsCommand = async (output, context) => {
680
- if (output.statusCode !== 200 && output.statusCode >= 300) {
681
- return de_SearchJobsCommandError(output, context);
682
- }
683
- const contents = (0, smithy_client_1.map)({
684
- $metadata: deserializeMetadata(output),
685
- });
686
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
687
- const doc = (0, smithy_client_1.take)(data, {
688
- jobs: (_) => de_JobSummaryList(_, context),
689
- nextToken: smithy_client_1.expectString,
690
- });
691
- Object.assign(contents, doc);
692
- return contents;
693
- };
694
- exports.de_SearchJobsCommand = de_SearchJobsCommand;
695
- const de_SearchJobsCommandError = async (output, context) => {
696
- const parsedOutput = {
697
- ...output,
698
- body: await parseErrorBody(output.body, context),
699
- };
700
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
701
- switch (errorCode) {
702
- case "AccessDeniedException":
703
- case "com.amazonaws.braket#AccessDeniedException":
704
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
705
- case "InternalServiceException":
706
- case "com.amazonaws.braket#InternalServiceException":
707
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
708
- case "ThrottlingException":
709
- case "com.amazonaws.braket#ThrottlingException":
710
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
711
- case "ValidationException":
712
- case "com.amazonaws.braket#ValidationException":
713
- throw await de_ValidationExceptionRes(parsedOutput, context);
714
- default:
715
- const parsedBody = parsedOutput.body;
716
- return throwDefaultError({
717
- output,
718
- parsedBody,
719
- errorCode,
720
- });
721
- }
722
- };
723
- const de_SearchQuantumTasksCommand = async (output, context) => {
724
- if (output.statusCode !== 200 && output.statusCode >= 300) {
725
- return de_SearchQuantumTasksCommandError(output, context);
726
- }
727
- const contents = (0, smithy_client_1.map)({
728
- $metadata: deserializeMetadata(output),
729
- });
730
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
731
- const doc = (0, smithy_client_1.take)(data, {
732
- nextToken: smithy_client_1.expectString,
733
- quantumTasks: (_) => de_QuantumTaskSummaryList(_, context),
734
- });
735
- Object.assign(contents, doc);
736
- return contents;
737
- };
738
- exports.de_SearchQuantumTasksCommand = de_SearchQuantumTasksCommand;
739
- const de_SearchQuantumTasksCommandError = async (output, context) => {
740
- const parsedOutput = {
741
- ...output,
742
- body: await parseErrorBody(output.body, context),
743
- };
744
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
745
- switch (errorCode) {
746
- case "AccessDeniedException":
747
- case "com.amazonaws.braket#AccessDeniedException":
748
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
749
- case "InternalServiceException":
750
- case "com.amazonaws.braket#InternalServiceException":
751
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
752
- case "ThrottlingException":
753
- case "com.amazonaws.braket#ThrottlingException":
754
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
755
- case "ValidationException":
756
- case "com.amazonaws.braket#ValidationException":
757
- throw await de_ValidationExceptionRes(parsedOutput, context);
758
- default:
759
- const parsedBody = parsedOutput.body;
760
- return throwDefaultError({
761
- output,
762
- parsedBody,
763
- errorCode,
764
- });
765
- }
766
- };
767
- const de_TagResourceCommand = async (output, context) => {
768
- if (output.statusCode !== 200 && output.statusCode >= 300) {
769
- return de_TagResourceCommandError(output, context);
770
- }
771
- const contents = (0, smithy_client_1.map)({
772
- $metadata: deserializeMetadata(output),
773
- });
774
- await (0, smithy_client_1.collectBody)(output.body, context);
775
- return contents;
776
- };
777
- exports.de_TagResourceCommand = de_TagResourceCommand;
778
- const de_TagResourceCommandError = async (output, context) => {
779
- const parsedOutput = {
780
- ...output,
781
- body: await parseErrorBody(output.body, context),
782
- };
783
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
784
- switch (errorCode) {
785
- case "InternalServiceException":
786
- case "com.amazonaws.braket#InternalServiceException":
787
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
788
- case "ResourceNotFoundException":
789
- case "com.amazonaws.braket#ResourceNotFoundException":
790
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
791
- case "ValidationException":
792
- case "com.amazonaws.braket#ValidationException":
793
- throw await de_ValidationExceptionRes(parsedOutput, context);
794
- default:
795
- const parsedBody = parsedOutput.body;
796
- return throwDefaultError({
797
- output,
798
- parsedBody,
799
- errorCode,
800
- });
801
- }
802
- };
803
- const de_UntagResourceCommand = async (output, context) => {
804
- if (output.statusCode !== 200 && output.statusCode >= 300) {
805
- return de_UntagResourceCommandError(output, context);
806
- }
807
- const contents = (0, smithy_client_1.map)({
808
- $metadata: deserializeMetadata(output),
809
- });
810
- await (0, smithy_client_1.collectBody)(output.body, context);
811
- return contents;
812
- };
813
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
814
- const de_UntagResourceCommandError = async (output, context) => {
815
- const parsedOutput = {
816
- ...output,
817
- body: await parseErrorBody(output.body, context),
818
- };
819
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
820
- switch (errorCode) {
821
- case "InternalServiceException":
822
- case "com.amazonaws.braket#InternalServiceException":
823
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
824
- case "ResourceNotFoundException":
825
- case "com.amazonaws.braket#ResourceNotFoundException":
826
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
827
- case "ValidationException":
828
- case "com.amazonaws.braket#ValidationException":
829
- throw await de_ValidationExceptionRes(parsedOutput, context);
830
- default:
831
- const parsedBody = parsedOutput.body;
832
- return throwDefaultError({
833
- output,
834
- parsedBody,
835
- errorCode,
836
- });
837
- }
838
- };
839
- const throwDefaultError = (0, smithy_client_1.withBaseException)(BraketServiceException_1.BraketServiceException);
840
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
841
- const contents = (0, smithy_client_1.map)({});
842
- const data = parsedOutput.body;
843
- const doc = (0, smithy_client_1.take)(data, {
844
- message: smithy_client_1.expectString,
845
- });
846
- Object.assign(contents, doc);
847
- const exception = new models_0_1.AccessDeniedException({
848
- $metadata: deserializeMetadata(parsedOutput),
849
- ...contents,
850
- });
851
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
852
- };
853
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
854
- const contents = (0, smithy_client_1.map)({});
855
- const data = parsedOutput.body;
856
- const doc = (0, smithy_client_1.take)(data, {
857
- message: smithy_client_1.expectString,
858
- });
859
- Object.assign(contents, doc);
860
- const exception = new models_0_1.ConflictException({
861
- $metadata: deserializeMetadata(parsedOutput),
862
- ...contents,
863
- });
864
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
865
- };
866
- const de_DeviceOfflineExceptionRes = async (parsedOutput, context) => {
867
- const contents = (0, smithy_client_1.map)({});
868
- const data = parsedOutput.body;
869
- const doc = (0, smithy_client_1.take)(data, {
870
- message: smithy_client_1.expectString,
871
- });
872
- Object.assign(contents, doc);
873
- const exception = new models_0_1.DeviceOfflineException({
874
- $metadata: deserializeMetadata(parsedOutput),
875
- ...contents,
876
- });
877
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
878
- };
879
- const de_DeviceRetiredExceptionRes = async (parsedOutput, context) => {
880
- const contents = (0, smithy_client_1.map)({});
881
- const data = parsedOutput.body;
882
- const doc = (0, smithy_client_1.take)(data, {
883
- message: smithy_client_1.expectString,
884
- });
885
- Object.assign(contents, doc);
886
- const exception = new models_0_1.DeviceRetiredException({
887
- $metadata: deserializeMetadata(parsedOutput),
888
- ...contents,
889
- });
890
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
891
- };
892
- const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
893
- const contents = (0, smithy_client_1.map)({});
894
- const data = parsedOutput.body;
895
- const doc = (0, smithy_client_1.take)(data, {
896
- message: smithy_client_1.expectString,
897
- });
898
- Object.assign(contents, doc);
899
- const exception = new models_0_1.InternalServiceException({
900
- $metadata: deserializeMetadata(parsedOutput),
901
- ...contents,
902
- });
903
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
904
- };
905
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
906
- const contents = (0, smithy_client_1.map)({});
907
- const data = parsedOutput.body;
908
- const doc = (0, smithy_client_1.take)(data, {
909
- message: smithy_client_1.expectString,
910
- });
911
- Object.assign(contents, doc);
912
- const exception = new models_0_1.ResourceNotFoundException({
913
- $metadata: deserializeMetadata(parsedOutput),
914
- ...contents,
915
- });
916
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
917
- };
918
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
919
- const contents = (0, smithy_client_1.map)({});
920
- const data = parsedOutput.body;
921
- const doc = (0, smithy_client_1.take)(data, {
922
- message: smithy_client_1.expectString,
923
- });
924
- Object.assign(contents, doc);
925
- const exception = new models_0_1.ServiceQuotaExceededException({
926
- $metadata: deserializeMetadata(parsedOutput),
927
- ...contents,
928
- });
929
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
930
- };
931
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
932
- const contents = (0, smithy_client_1.map)({});
933
- const data = parsedOutput.body;
934
- const doc = (0, smithy_client_1.take)(data, {
935
- message: smithy_client_1.expectString,
936
- });
937
- Object.assign(contents, doc);
938
- const exception = new models_0_1.ThrottlingException({
939
- $metadata: deserializeMetadata(parsedOutput),
940
- ...contents,
941
- });
942
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
943
- };
944
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
945
- const contents = (0, smithy_client_1.map)({});
946
- const data = parsedOutput.body;
947
- const doc = (0, smithy_client_1.take)(data, {
948
- message: smithy_client_1.expectString,
949
- });
950
- Object.assign(contents, doc);
951
- const exception = new models_0_1.ValidationException({
952
- $metadata: deserializeMetadata(parsedOutput),
953
- ...contents,
954
- });
955
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
956
- };
957
- const de_JobEventDetails = (output, context) => {
958
- return (0, smithy_client_1.take)(output, {
959
- eventType: smithy_client_1.expectString,
960
- message: smithy_client_1.expectString,
961
- timeOfEvent: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
962
- });
963
- };
964
- const de_JobEvents = (output, context) => {
965
- const retVal = (output || [])
966
- .filter((e) => e != null)
967
- .map((entry) => {
968
- return de_JobEventDetails(entry, context);
969
- });
970
- return retVal;
971
- };
972
- const de_JobSummary = (output, context) => {
973
- return (0, smithy_client_1.take)(output, {
974
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
975
- device: smithy_client_1.expectString,
976
- endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
977
- jobArn: smithy_client_1.expectString,
978
- jobName: smithy_client_1.expectString,
979
- startedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
980
- status: smithy_client_1.expectString,
981
- tags: smithy_client_1._json,
982
- });
983
- };
984
- const de_JobSummaryList = (output, context) => {
985
- const retVal = (output || [])
986
- .filter((e) => e != null)
987
- .map((entry) => {
988
- return de_JobSummary(entry, context);
989
- });
990
- return retVal;
991
- };
992
- const de_QuantumTaskSummary = (output, context) => {
993
- return (0, smithy_client_1.take)(output, {
994
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
995
- deviceArn: smithy_client_1.expectString,
996
- endedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
997
- outputS3Bucket: smithy_client_1.expectString,
998
- outputS3Directory: smithy_client_1.expectString,
999
- quantumTaskArn: smithy_client_1.expectString,
1000
- shots: smithy_client_1.expectLong,
1001
- status: smithy_client_1.expectString,
1002
- tags: smithy_client_1._json,
1003
- });
1004
- };
1005
- const de_QuantumTaskSummaryList = (output, context) => {
1006
- const retVal = (output || [])
1007
- .filter((e) => e != null)
1008
- .map((entry) => {
1009
- return de_QuantumTaskSummary(entry, context);
1010
- });
1011
- return retVal;
1012
- };
1013
- const deserializeMetadata = (output) => ({
1014
- httpStatusCode: output.statusCode,
1015
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1016
- extendedRequestId: output.headers["x-amz-id-2"],
1017
- cfId: output.headers["x-amz-cf-id"],
1018
- });
1019
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1020
- const isSerializableHeaderValue = (value) => value !== undefined &&
1021
- value !== null &&
1022
- value !== "" &&
1023
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1024
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1025
- const _aAN = "additionalAttributeNames";
1026
- const _tK = "tagKeys";
1027
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1028
- if (encoded.length) {
1029
- return JSON.parse(encoded);
1030
- }
1031
- return {};
1032
- });
1033
- const parseErrorBody = async (errorBody, context) => {
1034
- const value = await parseBody(errorBody, context);
1035
- value.message = value.message ?? value.Message;
1036
- return value;
1037
- };
1038
- const loadRestJsonErrorCode = (output, data) => {
1039
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1040
- const sanitizeErrorCode = (rawValue) => {
1041
- let cleanValue = rawValue;
1042
- if (typeof cleanValue === "number") {
1043
- cleanValue = cleanValue.toString();
1044
- }
1045
- if (cleanValue.indexOf(",") >= 0) {
1046
- cleanValue = cleanValue.split(",")[0];
1047
- }
1048
- if (cleanValue.indexOf(":") >= 0) {
1049
- cleanValue = cleanValue.split(":")[0];
1050
- }
1051
- if (cleanValue.indexOf("#") >= 0) {
1052
- cleanValue = cleanValue.split("#")[1];
1053
- }
1054
- return cleanValue;
1055
- };
1056
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1057
- if (headerKey !== undefined) {
1058
- return sanitizeErrorCode(output.headers[headerKey]);
1059
- }
1060
- if (data.code !== undefined) {
1061
- return sanitizeErrorCode(data.code);
1062
- }
1063
- if (data["__type"] !== undefined) {
1064
- return sanitizeErrorCode(data["__type"]);
1065
- }
1066
- };
1
+ module.exports = require("../index.js");