@aws-sdk/client-braket 3.118.1 → 3.128.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.
@@ -73,41 +73,34 @@ const serializeAws_restJson1CreateJobCommand = async (input, context) => {
73
73
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/job";
74
74
  let body;
75
75
  body = JSON.stringify({
76
- ...(input.algorithmSpecification !== undefined &&
77
- input.algorithmSpecification !== null && {
76
+ ...(input.algorithmSpecification != null && {
78
77
  algorithmSpecification: serializeAws_restJson1AlgorithmSpecification(input.algorithmSpecification, context),
79
78
  }),
80
- ...(input.checkpointConfig !== undefined &&
81
- input.checkpointConfig !== null && {
79
+ ...(input.checkpointConfig != null && {
82
80
  checkpointConfig: serializeAws_restJson1JobCheckpointConfig(input.checkpointConfig, context),
83
81
  }),
84
82
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
85
- ...(input.deviceConfig !== undefined &&
86
- input.deviceConfig !== null && { deviceConfig: serializeAws_restJson1DeviceConfig(input.deviceConfig, context) }),
87
- ...(input.hyperParameters !== undefined &&
88
- input.hyperParameters !== null && {
83
+ ...(input.deviceConfig != null && {
84
+ deviceConfig: serializeAws_restJson1DeviceConfig(input.deviceConfig, context),
85
+ }),
86
+ ...(input.hyperParameters != null && {
89
87
  hyperParameters: serializeAws_restJson1HyperParameters(input.hyperParameters, context),
90
88
  }),
91
- ...(input.inputDataConfig !== undefined &&
92
- input.inputDataConfig !== null && {
89
+ ...(input.inputDataConfig != null && {
93
90
  inputDataConfig: serializeAws_restJson1InputConfigList(input.inputDataConfig, context),
94
91
  }),
95
- ...(input.instanceConfig !== undefined &&
96
- input.instanceConfig !== null && {
92
+ ...(input.instanceConfig != null && {
97
93
  instanceConfig: serializeAws_restJson1InstanceConfig(input.instanceConfig, context),
98
94
  }),
99
- ...(input.jobName !== undefined && input.jobName !== null && { jobName: input.jobName }),
100
- ...(input.outputDataConfig !== undefined &&
101
- input.outputDataConfig !== null && {
95
+ ...(input.jobName != null && { jobName: input.jobName }),
96
+ ...(input.outputDataConfig != null && {
102
97
  outputDataConfig: serializeAws_restJson1JobOutputDataConfig(input.outputDataConfig, context),
103
98
  }),
104
- ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }),
105
- ...(input.stoppingCondition !== undefined &&
106
- input.stoppingCondition !== null && {
99
+ ...(input.roleArn != null && { roleArn: input.roleArn }),
100
+ ...(input.stoppingCondition != null && {
107
101
  stoppingCondition: serializeAws_restJson1JobStoppingCondition(input.stoppingCondition, context),
108
102
  }),
109
- ...(input.tags !== undefined &&
110
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
103
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
111
104
  });
112
105
  return new protocol_http_1.HttpRequest({
113
106
  protocol,
@@ -129,19 +122,15 @@ const serializeAws_restJson1CreateQuantumTaskCommand = async (input, context) =>
129
122
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-task";
130
123
  let body;
131
124
  body = JSON.stringify({
132
- ...(input.action !== undefined && input.action !== null && { action: smithy_client_1.LazyJsonString.fromObject(input.action) }),
125
+ ...(input.action != null && { action: smithy_client_1.LazyJsonString.fromObject(input.action) }),
133
126
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
134
- ...(input.deviceArn !== undefined && input.deviceArn !== null && { deviceArn: input.deviceArn }),
135
- ...(input.deviceParameters !== undefined &&
136
- input.deviceParameters !== null && { deviceParameters: smithy_client_1.LazyJsonString.fromObject(input.deviceParameters) }),
137
- ...(input.jobToken !== undefined && input.jobToken !== null && { jobToken: input.jobToken }),
138
- ...(input.outputS3Bucket !== undefined &&
139
- input.outputS3Bucket !== null && { outputS3Bucket: input.outputS3Bucket }),
140
- ...(input.outputS3KeyPrefix !== undefined &&
141
- input.outputS3KeyPrefix !== null && { outputS3KeyPrefix: input.outputS3KeyPrefix }),
142
- ...(input.shots !== undefined && input.shots !== null && { shots: input.shots }),
143
- ...(input.tags !== undefined &&
144
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
127
+ ...(input.deviceArn != null && { deviceArn: input.deviceArn }),
128
+ ...(input.deviceParameters != null && { deviceParameters: smithy_client_1.LazyJsonString.fromObject(input.deviceParameters) }),
129
+ ...(input.jobToken != null && { jobToken: input.jobToken }),
130
+ ...(input.outputS3Bucket != null && { outputS3Bucket: input.outputS3Bucket }),
131
+ ...(input.outputS3KeyPrefix != null && { outputS3KeyPrefix: input.outputS3KeyPrefix }),
132
+ ...(input.shots != null && { shots: input.shots }),
133
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
145
134
  });
146
135
  return new protocol_http_1.HttpRequest({
147
136
  protocol,
@@ -266,10 +255,9 @@ const serializeAws_restJson1SearchDevicesCommand = async (input, context) => {
266
255
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/devices";
267
256
  let body;
268
257
  body = JSON.stringify({
269
- ...(input.filters !== undefined &&
270
- input.filters !== null && { filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context) }),
271
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
272
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
258
+ ...(input.filters != null && { filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context) }),
259
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
260
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
273
261
  });
274
262
  return new protocol_http_1.HttpRequest({
275
263
  protocol,
@@ -290,10 +278,9 @@ const serializeAws_restJson1SearchJobsCommand = async (input, context) => {
290
278
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs";
291
279
  let body;
292
280
  body = JSON.stringify({
293
- ...(input.filters !== undefined &&
294
- input.filters !== null && { filters: serializeAws_restJson1SearchJobsFilterList(input.filters, context) }),
295
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
296
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
281
+ ...(input.filters != null && { filters: serializeAws_restJson1SearchJobsFilterList(input.filters, context) }),
282
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
283
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
297
284
  });
298
285
  return new protocol_http_1.HttpRequest({
299
286
  protocol,
@@ -314,12 +301,11 @@ const serializeAws_restJson1SearchQuantumTasksCommand = async (input, context) =
314
301
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-tasks";
315
302
  let body;
316
303
  body = JSON.stringify({
317
- ...(input.filters !== undefined &&
318
- input.filters !== null && {
304
+ ...(input.filters != null && {
319
305
  filters: serializeAws_restJson1SearchQuantumTasksFilterList(input.filters, context),
320
306
  }),
321
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
322
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
307
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
308
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
323
309
  });
324
310
  return new protocol_http_1.HttpRequest({
325
311
  protocol,
@@ -350,8 +336,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
350
336
  }
351
337
  let body;
352
338
  body = JSON.stringify({
353
- ...(input.tags !== undefined &&
354
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
339
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
355
340
  });
356
341
  return new protocol_http_1.HttpRequest({
357
342
  protocol,
@@ -419,8 +404,7 @@ const deserializeAws_restJson1CancelJobCommandError = async (output, context) =>
419
404
  body: await parseBody(output.body, context),
420
405
  };
421
406
  let response;
422
- let errorCode = "UnknownError";
423
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
407
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
424
408
  switch (errorCode) {
425
409
  case "AccessDeniedException":
426
410
  case "com.amazonaws.braket#AccessDeniedException":
@@ -442,10 +426,12 @@ const deserializeAws_restJson1CancelJobCommandError = async (output, context) =>
442
426
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
443
427
  default:
444
428
  const parsedBody = parsedOutput.body;
429
+ const $metadata = deserializeMetadata(output);
430
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
445
431
  response = new BraketServiceException_1.BraketServiceException({
446
- name: parsedBody.code || parsedBody.Code || errorCode,
432
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
447
433
  $fault: "client",
448
- $metadata: deserializeMetadata(output),
434
+ $metadata,
449
435
  });
450
436
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
451
437
  }
@@ -475,8 +461,7 @@ const deserializeAws_restJson1CancelQuantumTaskCommandError = async (output, con
475
461
  body: await parseBody(output.body, context),
476
462
  };
477
463
  let response;
478
- let errorCode = "UnknownError";
479
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
464
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
480
465
  switch (errorCode) {
481
466
  case "AccessDeniedException":
482
467
  case "com.amazonaws.braket#AccessDeniedException":
@@ -498,10 +483,12 @@ const deserializeAws_restJson1CancelQuantumTaskCommandError = async (output, con
498
483
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
499
484
  default:
500
485
  const parsedBody = parsedOutput.body;
486
+ const $metadata = deserializeMetadata(output);
487
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
501
488
  response = new BraketServiceException_1.BraketServiceException({
502
- name: parsedBody.code || parsedBody.Code || errorCode,
489
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
503
490
  $fault: "client",
504
- $metadata: deserializeMetadata(output),
491
+ $metadata,
505
492
  });
506
493
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
507
494
  }
@@ -527,8 +514,7 @@ const deserializeAws_restJson1CreateJobCommandError = async (output, context) =>
527
514
  body: await parseBody(output.body, context),
528
515
  };
529
516
  let response;
530
- let errorCode = "UnknownError";
531
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
517
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
532
518
  switch (errorCode) {
533
519
  case "AccessDeniedException":
534
520
  case "com.amazonaws.braket#AccessDeniedException":
@@ -553,10 +539,12 @@ const deserializeAws_restJson1CreateJobCommandError = async (output, context) =>
553
539
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
554
540
  default:
555
541
  const parsedBody = parsedOutput.body;
542
+ const $metadata = deserializeMetadata(output);
543
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
556
544
  response = new BraketServiceException_1.BraketServiceException({
557
- name: parsedBody.code || parsedBody.Code || errorCode,
545
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
558
546
  $fault: "client",
559
- $metadata: deserializeMetadata(output),
547
+ $metadata,
560
548
  });
561
549
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
562
550
  }
@@ -582,8 +570,7 @@ const deserializeAws_restJson1CreateQuantumTaskCommandError = async (output, con
582
570
  body: await parseBody(output.body, context),
583
571
  };
584
572
  let response;
585
- let errorCode = "UnknownError";
586
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
573
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
587
574
  switch (errorCode) {
588
575
  case "AccessDeniedException":
589
576
  case "com.amazonaws.braket#AccessDeniedException":
@@ -608,10 +595,12 @@ const deserializeAws_restJson1CreateQuantumTaskCommandError = async (output, con
608
595
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
609
596
  default:
610
597
  const parsedBody = parsedOutput.body;
598
+ const $metadata = deserializeMetadata(output);
599
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
611
600
  response = new BraketServiceException_1.BraketServiceException({
612
- name: parsedBody.code || parsedBody.Code || errorCode,
601
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
613
602
  $fault: "client",
614
- $metadata: deserializeMetadata(output),
603
+ $metadata,
615
604
  });
616
605
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
617
606
  }
@@ -657,8 +646,7 @@ const deserializeAws_restJson1GetDeviceCommandError = async (output, context) =>
657
646
  body: await parseBody(output.body, context),
658
647
  };
659
648
  let response;
660
- let errorCode = "UnknownError";
661
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
649
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
650
  switch (errorCode) {
663
651
  case "AccessDeniedException":
664
652
  case "com.amazonaws.braket#AccessDeniedException":
@@ -677,10 +665,12 @@ const deserializeAws_restJson1GetDeviceCommandError = async (output, context) =>
677
665
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
678
666
  default:
679
667
  const parsedBody = parsedOutput.body;
668
+ const $metadata = deserializeMetadata(output);
669
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
680
670
  response = new BraketServiceException_1.BraketServiceException({
681
- name: parsedBody.code || parsedBody.Code || errorCode,
671
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
682
672
  $fault: "client",
683
- $metadata: deserializeMetadata(output),
673
+ $metadata,
684
674
  });
685
675
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
686
676
  }
@@ -778,8 +768,7 @@ const deserializeAws_restJson1GetJobCommandError = async (output, context) => {
778
768
  body: await parseBody(output.body, context),
779
769
  };
780
770
  let response;
781
- let errorCode = "UnknownError";
782
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
771
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
783
772
  switch (errorCode) {
784
773
  case "AccessDeniedException":
785
774
  case "com.amazonaws.braket#AccessDeniedException":
@@ -798,10 +787,12 @@ const deserializeAws_restJson1GetJobCommandError = async (output, context) => {
798
787
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
799
788
  default:
800
789
  const parsedBody = parsedOutput.body;
790
+ const $metadata = deserializeMetadata(output);
791
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
801
792
  response = new BraketServiceException_1.BraketServiceException({
802
- name: parsedBody.code || parsedBody.Code || errorCode,
793
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
803
794
  $fault: "client",
804
- $metadata: deserializeMetadata(output),
795
+ $metadata,
805
796
  });
806
797
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
807
798
  }
@@ -871,8 +862,7 @@ const deserializeAws_restJson1GetQuantumTaskCommandError = async (output, contex
871
862
  body: await parseBody(output.body, context),
872
863
  };
873
864
  let response;
874
- let errorCode = "UnknownError";
875
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
865
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
876
866
  switch (errorCode) {
877
867
  case "AccessDeniedException":
878
868
  case "com.amazonaws.braket#AccessDeniedException":
@@ -891,10 +881,12 @@ const deserializeAws_restJson1GetQuantumTaskCommandError = async (output, contex
891
881
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
892
882
  default:
893
883
  const parsedBody = parsedOutput.body;
884
+ const $metadata = deserializeMetadata(output);
885
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
894
886
  response = new BraketServiceException_1.BraketServiceException({
895
- name: parsedBody.code || parsedBody.Code || errorCode,
887
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
896
888
  $fault: "client",
897
- $metadata: deserializeMetadata(output),
889
+ $metadata,
898
890
  });
899
891
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
900
892
  }
@@ -920,8 +912,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
920
912
  body: await parseBody(output.body, context),
921
913
  };
922
914
  let response;
923
- let errorCode = "UnknownError";
924
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
915
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
925
916
  switch (errorCode) {
926
917
  case "InternalServiceException":
927
918
  case "com.amazonaws.braket#InternalServiceException":
@@ -934,10 +925,12 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
934
925
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
935
926
  default:
936
927
  const parsedBody = parsedOutput.body;
928
+ const $metadata = deserializeMetadata(output);
929
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
937
930
  response = new BraketServiceException_1.BraketServiceException({
938
- name: parsedBody.code || parsedBody.Code || errorCode,
931
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
939
932
  $fault: "client",
940
- $metadata: deserializeMetadata(output),
933
+ $metadata,
941
934
  });
942
935
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
943
936
  }
@@ -967,8 +960,7 @@ const deserializeAws_restJson1SearchDevicesCommandError = async (output, context
967
960
  body: await parseBody(output.body, context),
968
961
  };
969
962
  let response;
970
- let errorCode = "UnknownError";
971
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
963
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
964
  switch (errorCode) {
973
965
  case "AccessDeniedException":
974
966
  case "com.amazonaws.braket#AccessDeniedException":
@@ -984,10 +976,12 @@ const deserializeAws_restJson1SearchDevicesCommandError = async (output, context
984
976
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
985
977
  default:
986
978
  const parsedBody = parsedOutput.body;
979
+ const $metadata = deserializeMetadata(output);
980
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
987
981
  response = new BraketServiceException_1.BraketServiceException({
988
- name: parsedBody.code || parsedBody.Code || errorCode,
982
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
989
983
  $fault: "client",
990
- $metadata: deserializeMetadata(output),
984
+ $metadata,
991
985
  });
992
986
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
993
987
  }
@@ -1017,8 +1011,7 @@ const deserializeAws_restJson1SearchJobsCommandError = async (output, context) =
1017
1011
  body: await parseBody(output.body, context),
1018
1012
  };
1019
1013
  let response;
1020
- let errorCode = "UnknownError";
1021
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1014
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1022
1015
  switch (errorCode) {
1023
1016
  case "AccessDeniedException":
1024
1017
  case "com.amazonaws.braket#AccessDeniedException":
@@ -1034,10 +1027,12 @@ const deserializeAws_restJson1SearchJobsCommandError = async (output, context) =
1034
1027
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1035
1028
  default:
1036
1029
  const parsedBody = parsedOutput.body;
1030
+ const $metadata = deserializeMetadata(output);
1031
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1037
1032
  response = new BraketServiceException_1.BraketServiceException({
1038
- name: parsedBody.code || parsedBody.Code || errorCode,
1033
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1039
1034
  $fault: "client",
1040
- $metadata: deserializeMetadata(output),
1035
+ $metadata,
1041
1036
  });
1042
1037
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1043
1038
  }
@@ -1067,8 +1062,7 @@ const deserializeAws_restJson1SearchQuantumTasksCommandError = async (output, co
1067
1062
  body: await parseBody(output.body, context),
1068
1063
  };
1069
1064
  let response;
1070
- let errorCode = "UnknownError";
1071
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1065
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1072
1066
  switch (errorCode) {
1073
1067
  case "AccessDeniedException":
1074
1068
  case "com.amazonaws.braket#AccessDeniedException":
@@ -1084,10 +1078,12 @@ const deserializeAws_restJson1SearchQuantumTasksCommandError = async (output, co
1084
1078
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1085
1079
  default:
1086
1080
  const parsedBody = parsedOutput.body;
1081
+ const $metadata = deserializeMetadata(output);
1082
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1087
1083
  response = new BraketServiceException_1.BraketServiceException({
1088
- name: parsedBody.code || parsedBody.Code || errorCode,
1084
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1089
1085
  $fault: "client",
1090
- $metadata: deserializeMetadata(output),
1086
+ $metadata,
1091
1087
  });
1092
1088
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1093
1089
  }
@@ -1109,8 +1105,7 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1109
1105
  body: await parseBody(output.body, context),
1110
1106
  };
1111
1107
  let response;
1112
- let errorCode = "UnknownError";
1113
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1108
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1114
1109
  switch (errorCode) {
1115
1110
  case "InternalServiceException":
1116
1111
  case "com.amazonaws.braket#InternalServiceException":
@@ -1123,10 +1118,12 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1123
1118
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1124
1119
  default:
1125
1120
  const parsedBody = parsedOutput.body;
1121
+ const $metadata = deserializeMetadata(output);
1122
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1126
1123
  response = new BraketServiceException_1.BraketServiceException({
1127
- name: parsedBody.code || parsedBody.Code || errorCode,
1124
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1128
1125
  $fault: "client",
1129
- $metadata: deserializeMetadata(output),
1126
+ $metadata,
1130
1127
  });
1131
1128
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1132
1129
  }
@@ -1148,8 +1145,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1148
1145
  body: await parseBody(output.body, context),
1149
1146
  };
1150
1147
  let response;
1151
- let errorCode = "UnknownError";
1152
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1148
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1153
1149
  switch (errorCode) {
1154
1150
  case "InternalServiceException":
1155
1151
  case "com.amazonaws.braket#InternalServiceException":
@@ -1162,10 +1158,12 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1162
1158
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1163
1159
  default:
1164
1160
  const parsedBody = parsedOutput.body;
1161
+ const $metadata = deserializeMetadata(output);
1162
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1165
1163
  response = new BraketServiceException_1.BraketServiceException({
1166
- name: parsedBody.code || parsedBody.Code || errorCode,
1164
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1167
1165
  $fault: "client",
1168
- $metadata: deserializeMetadata(output),
1166
+ $metadata,
1169
1167
  });
1170
1168
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1171
1169
  }
@@ -1280,30 +1278,29 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
1280
1278
  };
1281
1279
  const serializeAws_restJson1AlgorithmSpecification = (input, context) => {
1282
1280
  return {
1283
- ...(input.containerImage !== undefined &&
1284
- input.containerImage !== null && {
1281
+ ...(input.containerImage != null && {
1285
1282
  containerImage: serializeAws_restJson1ContainerImage(input.containerImage, context),
1286
1283
  }),
1287
- ...(input.scriptModeConfig !== undefined &&
1288
- input.scriptModeConfig !== null && {
1284
+ ...(input.scriptModeConfig != null && {
1289
1285
  scriptModeConfig: serializeAws_restJson1ScriptModeConfig(input.scriptModeConfig, context),
1290
1286
  }),
1291
1287
  };
1292
1288
  };
1293
1289
  const serializeAws_restJson1ContainerImage = (input, context) => {
1294
1290
  return {
1295
- ...(input.uri !== undefined && input.uri !== null && { uri: input.uri }),
1291
+ ...(input.uri != null && { uri: input.uri }),
1296
1292
  };
1297
1293
  };
1298
1294
  const serializeAws_restJson1DataSource = (input, context) => {
1299
1295
  return {
1300
- ...(input.s3DataSource !== undefined &&
1301
- input.s3DataSource !== null && { s3DataSource: serializeAws_restJson1S3DataSource(input.s3DataSource, context) }),
1296
+ ...(input.s3DataSource != null && {
1297
+ s3DataSource: serializeAws_restJson1S3DataSource(input.s3DataSource, context),
1298
+ }),
1302
1299
  };
1303
1300
  };
1304
1301
  const serializeAws_restJson1DeviceConfig = (input, context) => {
1305
1302
  return {
1306
- ...(input.device !== undefined && input.device !== null && { device: input.device }),
1303
+ ...(input.device != null && { device: input.device }),
1307
1304
  };
1308
1305
  };
1309
1306
  const serializeAws_restJson1HyperParameters = (input, context) => {
@@ -1329,56 +1326,51 @@ const serializeAws_restJson1InputConfigList = (input, context) => {
1329
1326
  };
1330
1327
  const serializeAws_restJson1InputFileConfig = (input, context) => {
1331
1328
  return {
1332
- ...(input.channelName !== undefined && input.channelName !== null && { channelName: input.channelName }),
1333
- ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }),
1334
- ...(input.dataSource !== undefined &&
1335
- input.dataSource !== null && { dataSource: serializeAws_restJson1DataSource(input.dataSource, context) }),
1329
+ ...(input.channelName != null && { channelName: input.channelName }),
1330
+ ...(input.contentType != null && { contentType: input.contentType }),
1331
+ ...(input.dataSource != null && { dataSource: serializeAws_restJson1DataSource(input.dataSource, context) }),
1336
1332
  };
1337
1333
  };
1338
1334
  const serializeAws_restJson1InstanceConfig = (input, context) => {
1339
1335
  return {
1340
- ...(input.instanceCount !== undefined && input.instanceCount !== null && { instanceCount: input.instanceCount }),
1341
- ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }),
1342
- ...(input.volumeSizeInGb !== undefined &&
1343
- input.volumeSizeInGb !== null && { volumeSizeInGb: input.volumeSizeInGb }),
1336
+ ...(input.instanceCount != null && { instanceCount: input.instanceCount }),
1337
+ ...(input.instanceType != null && { instanceType: input.instanceType }),
1338
+ ...(input.volumeSizeInGb != null && { volumeSizeInGb: input.volumeSizeInGb }),
1344
1339
  };
1345
1340
  };
1346
1341
  const serializeAws_restJson1JobCheckpointConfig = (input, context) => {
1347
1342
  return {
1348
- ...(input.localPath !== undefined && input.localPath !== null && { localPath: input.localPath }),
1349
- ...(input.s3Uri !== undefined && input.s3Uri !== null && { s3Uri: input.s3Uri }),
1343
+ ...(input.localPath != null && { localPath: input.localPath }),
1344
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1350
1345
  };
1351
1346
  };
1352
1347
  const serializeAws_restJson1JobOutputDataConfig = (input, context) => {
1353
1348
  return {
1354
- ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }),
1355
- ...(input.s3Path !== undefined && input.s3Path !== null && { s3Path: input.s3Path }),
1349
+ ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
1350
+ ...(input.s3Path != null && { s3Path: input.s3Path }),
1356
1351
  };
1357
1352
  };
1358
1353
  const serializeAws_restJson1JobStoppingCondition = (input, context) => {
1359
1354
  return {
1360
- ...(input.maxRuntimeInSeconds !== undefined &&
1361
- input.maxRuntimeInSeconds !== null && { maxRuntimeInSeconds: input.maxRuntimeInSeconds }),
1355
+ ...(input.maxRuntimeInSeconds != null && { maxRuntimeInSeconds: input.maxRuntimeInSeconds }),
1362
1356
  };
1363
1357
  };
1364
1358
  const serializeAws_restJson1S3DataSource = (input, context) => {
1365
1359
  return {
1366
- ...(input.s3Uri !== undefined && input.s3Uri !== null && { s3Uri: input.s3Uri }),
1360
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1367
1361
  };
1368
1362
  };
1369
1363
  const serializeAws_restJson1ScriptModeConfig = (input, context) => {
1370
1364
  return {
1371
- ...(input.compressionType !== undefined &&
1372
- input.compressionType !== null && { compressionType: input.compressionType }),
1373
- ...(input.entryPoint !== undefined && input.entryPoint !== null && { entryPoint: input.entryPoint }),
1374
- ...(input.s3Uri !== undefined && input.s3Uri !== null && { s3Uri: input.s3Uri }),
1365
+ ...(input.compressionType != null && { compressionType: input.compressionType }),
1366
+ ...(input.entryPoint != null && { entryPoint: input.entryPoint }),
1367
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1375
1368
  };
1376
1369
  };
1377
1370
  const serializeAws_restJson1SearchDevicesFilter = (input, context) => {
1378
1371
  return {
1379
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
1380
- ...(input.values !== undefined &&
1381
- input.values !== null && { values: serializeAws_restJson1String256List(input.values, context) }),
1372
+ ...(input.name != null && { name: input.name }),
1373
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1382
1374
  };
1383
1375
  };
1384
1376
  const serializeAws_restJson1SearchDevicesFilterList = (input, context) => {
@@ -1393,10 +1385,9 @@ const serializeAws_restJson1SearchDevicesFilterList = (input, context) => {
1393
1385
  };
1394
1386
  const serializeAws_restJson1SearchJobsFilter = (input, context) => {
1395
1387
  return {
1396
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
1397
- ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }),
1398
- ...(input.values !== undefined &&
1399
- input.values !== null && { values: serializeAws_restJson1String256List(input.values, context) }),
1388
+ ...(input.name != null && { name: input.name }),
1389
+ ...(input.operator != null && { operator: input.operator }),
1390
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1400
1391
  };
1401
1392
  };
1402
1393
  const serializeAws_restJson1SearchJobsFilterList = (input, context) => {
@@ -1411,10 +1402,9 @@ const serializeAws_restJson1SearchJobsFilterList = (input, context) => {
1411
1402
  };
1412
1403
  const serializeAws_restJson1SearchQuantumTasksFilter = (input, context) => {
1413
1404
  return {
1414
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
1415
- ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }),
1416
- ...(input.values !== undefined &&
1417
- input.values !== null && { values: serializeAws_restJson1String256List(input.values, context) }),
1405
+ ...(input.name != null && { name: input.name }),
1406
+ ...(input.operator != null && { operator: input.operator }),
1407
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1418
1408
  };
1419
1409
  };
1420
1410
  const serializeAws_restJson1SearchQuantumTasksFilterList = (input, context) => {
@@ -1450,10 +1440,10 @@ const serializeAws_restJson1TagsMap = (input, context) => {
1450
1440
  };
1451
1441
  const deserializeAws_restJson1AlgorithmSpecification = (output, context) => {
1452
1442
  return {
1453
- containerImage: output.containerImage !== undefined && output.containerImage !== null
1443
+ containerImage: output.containerImage != null
1454
1444
  ? deserializeAws_restJson1ContainerImage(output.containerImage, context)
1455
1445
  : undefined,
1456
- scriptModeConfig: output.scriptModeConfig !== undefined && output.scriptModeConfig !== null
1446
+ scriptModeConfig: output.scriptModeConfig != null
1457
1447
  ? deserializeAws_restJson1ScriptModeConfig(output.scriptModeConfig, context)
1458
1448
  : undefined,
1459
1449
  };
@@ -1465,9 +1455,7 @@ const deserializeAws_restJson1ContainerImage = (output, context) => {
1465
1455
  };
1466
1456
  const deserializeAws_restJson1DataSource = (output, context) => {
1467
1457
  return {
1468
- s3DataSource: output.s3DataSource !== undefined && output.s3DataSource !== null
1469
- ? deserializeAws_restJson1S3DataSource(output.s3DataSource, context)
1470
- : undefined,
1458
+ s3DataSource: output.s3DataSource != null ? deserializeAws_restJson1S3DataSource(output.s3DataSource, context) : undefined,
1471
1459
  };
1472
1460
  };
1473
1461
  const deserializeAws_restJson1DeviceConfig = (output, context) => {
@@ -1521,9 +1509,7 @@ const deserializeAws_restJson1InputFileConfig = (output, context) => {
1521
1509
  return {
1522
1510
  channelName: (0, smithy_client_1.expectString)(output.channelName),
1523
1511
  contentType: (0, smithy_client_1.expectString)(output.contentType),
1524
- dataSource: output.dataSource !== undefined && output.dataSource !== null
1525
- ? deserializeAws_restJson1DataSource(output.dataSource, context)
1526
- : undefined,
1512
+ dataSource: output.dataSource != null ? deserializeAws_restJson1DataSource(output.dataSource, context) : undefined,
1527
1513
  };
1528
1514
  };
1529
1515
  const deserializeAws_restJson1InstanceConfig = (output, context) => {
@@ -1543,9 +1529,7 @@ const deserializeAws_restJson1JobEventDetails = (output, context) => {
1543
1529
  return {
1544
1530
  eventType: (0, smithy_client_1.expectString)(output.eventType),
1545
1531
  message: (0, smithy_client_1.expectString)(output.message),
1546
- timeOfEvent: output.timeOfEvent !== undefined && output.timeOfEvent !== null
1547
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.timeOfEvent))
1548
- : undefined,
1532
+ timeOfEvent: output.timeOfEvent != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.timeOfEvent)) : undefined,
1549
1533
  };
1550
1534
  };
1551
1535
  const deserializeAws_restJson1JobEvents = (output, context) => {
@@ -1572,22 +1556,14 @@ const deserializeAws_restJson1JobStoppingCondition = (output, context) => {
1572
1556
  };
1573
1557
  const deserializeAws_restJson1JobSummary = (output, context) => {
1574
1558
  return {
1575
- createdAt: output.createdAt !== undefined && output.createdAt !== null
1576
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
1577
- : undefined,
1559
+ createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt)) : undefined,
1578
1560
  device: (0, smithy_client_1.expectString)(output.device),
1579
- endedAt: output.endedAt !== undefined && output.endedAt !== null
1580
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.endedAt))
1581
- : undefined,
1561
+ endedAt: output.endedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.endedAt)) : undefined,
1582
1562
  jobArn: (0, smithy_client_1.expectString)(output.jobArn),
1583
1563
  jobName: (0, smithy_client_1.expectString)(output.jobName),
1584
- startedAt: output.startedAt !== undefined && output.startedAt !== null
1585
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.startedAt))
1586
- : undefined,
1564
+ startedAt: output.startedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.startedAt)) : undefined,
1587
1565
  status: (0, smithy_client_1.expectString)(output.status),
1588
- tags: output.tags !== undefined && output.tags !== null
1589
- ? deserializeAws_restJson1TagsMap(output.tags, context)
1590
- : undefined,
1566
+ tags: output.tags != null ? deserializeAws_restJson1TagsMap(output.tags, context) : undefined,
1591
1567
  };
1592
1568
  };
1593
1569
  const deserializeAws_restJson1JobSummaryList = (output, context) => {
@@ -1603,21 +1579,15 @@ const deserializeAws_restJson1JobSummaryList = (output, context) => {
1603
1579
  };
1604
1580
  const deserializeAws_restJson1QuantumTaskSummary = (output, context) => {
1605
1581
  return {
1606
- createdAt: output.createdAt !== undefined && output.createdAt !== null
1607
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
1608
- : undefined,
1582
+ createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt)) : undefined,
1609
1583
  deviceArn: (0, smithy_client_1.expectString)(output.deviceArn),
1610
- endedAt: output.endedAt !== undefined && output.endedAt !== null
1611
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.endedAt))
1612
- : undefined,
1584
+ endedAt: output.endedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.endedAt)) : undefined,
1613
1585
  outputS3Bucket: (0, smithy_client_1.expectString)(output.outputS3Bucket),
1614
1586
  outputS3Directory: (0, smithy_client_1.expectString)(output.outputS3Directory),
1615
1587
  quantumTaskArn: (0, smithy_client_1.expectString)(output.quantumTaskArn),
1616
1588
  shots: (0, smithy_client_1.expectLong)(output.shots),
1617
1589
  status: (0, smithy_client_1.expectString)(output.status),
1618
- tags: output.tags !== undefined && output.tags !== null
1619
- ? deserializeAws_restJson1TagsMap(output.tags, context)
1620
- : undefined,
1590
+ tags: output.tags != null ? deserializeAws_restJson1TagsMap(output.tags, context) : undefined,
1621
1591
  };
1622
1592
  };
1623
1593
  const deserializeAws_restJson1QuantumTaskSummaryList = (output, context) => {
@@ -1703,5 +1673,4 @@ const loadRestJsonErrorCode = (output, data) => {
1703
1673
  if (data["__type"] !== undefined) {
1704
1674
  return sanitizeErrorCode(data["__type"]);
1705
1675
  }
1706
- return "";
1707
1676
  };