Skip to content

Commit 228341b

Browse files
author
awstools
committed
feat(client-braket): Creating a job will result in DeviceOfflineException when using an offline device, and DeviceRetiredException when using a retired device.
1 parent 13b2406 commit 228341b

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

clients/client-braket/src/commands/CreateJobCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ export interface CreateJobCommandOutput extends CreateJobResponse, __MetadataBea
112112
* @throws {@link ConflictException} (client fault)
113113
* <p>An error occurred due to a conflict.</p>
114114
*
115+
* @throws {@link DeviceOfflineException} (client fault)
116+
* <p>The specified device is currently offline.</p>
117+
*
115118
* @throws {@link DeviceRetiredException} (client fault)
116119
* <p>The specified device has been retired.</p>
117120
*

clients/client-braket/src/models/models_0.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,26 @@ export interface CreateJobResponse {
809809
jobArn: string | undefined;
810810
}
811811

812+
/**
813+
* @public
814+
* <p>The specified device is currently offline.</p>
815+
*/
816+
export class DeviceOfflineException extends __BaseException {
817+
readonly name: "DeviceOfflineException" = "DeviceOfflineException";
818+
readonly $fault: "client" = "client";
819+
/**
820+
* @internal
821+
*/
822+
constructor(opts: __ExceptionOptionType<DeviceOfflineException, __BaseException>) {
823+
super({
824+
name: "DeviceOfflineException",
825+
$fault: "client",
826+
...opts,
827+
});
828+
Object.setPrototypeOf(this, DeviceOfflineException.prototype);
829+
}
830+
}
831+
812832
/**
813833
* @public
814834
* <p>The specified device has been retired.</p>
@@ -1388,26 +1408,6 @@ export interface CreateQuantumTaskResponse {
13881408
quantumTaskArn: string | undefined;
13891409
}
13901410

1391-
/**
1392-
* @public
1393-
* <p>The specified device is currently offline.</p>
1394-
*/
1395-
export class DeviceOfflineException extends __BaseException {
1396-
readonly name: "DeviceOfflineException" = "DeviceOfflineException";
1397-
readonly $fault: "client" = "client";
1398-
/**
1399-
* @internal
1400-
*/
1401-
constructor(opts: __ExceptionOptionType<DeviceOfflineException, __BaseException>) {
1402-
super({
1403-
name: "DeviceOfflineException",
1404-
$fault: "client",
1405-
...opts,
1406-
});
1407-
Object.setPrototypeOf(this, DeviceOfflineException.prototype);
1408-
}
1409-
}
1410-
14111411
/**
14121412
* @public
14131413
* @enum

clients/client-braket/src/protocols/Aws_restJson1.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,15 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
703703
case "ValidationException":
704704
case "com.amazonaws.braket#ValidationException":
705705
throw await de_ValidationExceptionRes(parsedOutput, context);
706+
case "DeviceOfflineException":
707+
case "com.amazonaws.braket#DeviceOfflineException":
708+
throw await de_DeviceOfflineExceptionRes(parsedOutput, context);
706709
case "DeviceRetiredException":
707710
case "com.amazonaws.braket#DeviceRetiredException":
708711
throw await de_DeviceRetiredExceptionRes(parsedOutput, context);
709712
case "ServiceQuotaExceededException":
710713
case "com.amazonaws.braket#ServiceQuotaExceededException":
711714
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
712-
case "DeviceOfflineException":
713-
case "com.amazonaws.braket#DeviceOfflineException":
714-
throw await de_DeviceOfflineExceptionRes(parsedOutput, context);
715715
default:
716716
const parsedBody = parsedOutput.body;
717717
return throwDefaultError({

codegen/sdk-codegen/aws-models/braket.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,9 @@
10221022
{
10231023
"target": "com.amazonaws.braket#ConflictException"
10241024
},
1025+
{
1026+
"target": "com.amazonaws.braket#DeviceOfflineException"
1027+
},
10251028
{
10261029
"target": "com.amazonaws.braket#DeviceRetiredException"
10271030
},
@@ -2285,7 +2288,7 @@
22852288
"service": "com.amazonaws.braket#Braket",
22862289
"resource": "com.amazonaws.braket#JobResource"
22872290
},
2288-
"smithy.api#pattern": "^arn:aws[a-z\\-]*:braket:[a-z0-9\\-]*:[0-9]{12}:job/.*$"
2291+
"smithy.api#pattern": "^arn:aws[a-z\\-]*:braket:[a-z0-9\\-]+:[0-9]{12}:job/.*$"
22892292
}
22902293
},
22912294
"com.amazonaws.braket#JobCheckpointConfig": {

0 commit comments

Comments
 (0)