Skip to content

Commit

Permalink
feat(client-braket): Creating a job will result in DeviceOfflineExcep…
Browse files Browse the repository at this point in the history
…tion when using an offline device, and DeviceRetiredException when using a retired device.
  • Loading branch information
awstools committed Feb 9, 2024
1 parent 13b2406 commit 228341b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
3 changes: 3 additions & 0 deletions clients/client-braket/src/commands/CreateJobCommand.ts
Expand Up @@ -112,6 +112,9 @@ export interface CreateJobCommandOutput extends CreateJobResponse, __MetadataBea
* @throws {@link ConflictException} (client fault)
* <p>An error occurred due to a conflict.</p>
*
* @throws {@link DeviceOfflineException} (client fault)
* <p>The specified device is currently offline.</p>
*
* @throws {@link DeviceRetiredException} (client fault)
* <p>The specified device has been retired.</p>
*
Expand Down
40 changes: 20 additions & 20 deletions clients/client-braket/src/models/models_0.ts
Expand Up @@ -809,6 +809,26 @@ export interface CreateJobResponse {
jobArn: string | undefined;
}

/**
* @public
* <p>The specified device is currently offline.</p>
*/
export class DeviceOfflineException extends __BaseException {
readonly name: "DeviceOfflineException" = "DeviceOfflineException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<DeviceOfflineException, __BaseException>) {
super({
name: "DeviceOfflineException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, DeviceOfflineException.prototype);
}
}

/**
* @public
* <p>The specified device has been retired.</p>
Expand Down Expand Up @@ -1388,26 +1408,6 @@ export interface CreateQuantumTaskResponse {
quantumTaskArn: string | undefined;
}

/**
* @public
* <p>The specified device is currently offline.</p>
*/
export class DeviceOfflineException extends __BaseException {
readonly name: "DeviceOfflineException" = "DeviceOfflineException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<DeviceOfflineException, __BaseException>) {
super({
name: "DeviceOfflineException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, DeviceOfflineException.prototype);
}
}

/**
* @public
* @enum
Expand Down
6 changes: 3 additions & 3 deletions clients/client-braket/src/protocols/Aws_restJson1.ts
Expand Up @@ -703,15 +703,15 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "ValidationException":
case "com.amazonaws.braket#ValidationException":
throw await de_ValidationExceptionRes(parsedOutput, context);
case "DeviceOfflineException":
case "com.amazonaws.braket#DeviceOfflineException":
throw await de_DeviceOfflineExceptionRes(parsedOutput, context);
case "DeviceRetiredException":
case "com.amazonaws.braket#DeviceRetiredException":
throw await de_DeviceRetiredExceptionRes(parsedOutput, context);
case "ServiceQuotaExceededException":
case "com.amazonaws.braket#ServiceQuotaExceededException":
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
case "DeviceOfflineException":
case "com.amazonaws.braket#DeviceOfflineException":
throw await de_DeviceOfflineExceptionRes(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
return throwDefaultError({
Expand Down
5 changes: 4 additions & 1 deletion codegen/sdk-codegen/aws-models/braket.json
Expand Up @@ -1022,6 +1022,9 @@
{
"target": "com.amazonaws.braket#ConflictException"
},
{
"target": "com.amazonaws.braket#DeviceOfflineException"
},
{
"target": "com.amazonaws.braket#DeviceRetiredException"
},
Expand Down Expand Up @@ -2285,7 +2288,7 @@
"service": "com.amazonaws.braket#Braket",
"resource": "com.amazonaws.braket#JobResource"
},
"smithy.api#pattern": "^arn:aws[a-z\\-]*:braket:[a-z0-9\\-]*:[0-9]{12}:job/.*$"
"smithy.api#pattern": "^arn:aws[a-z\\-]*:braket:[a-z0-9\\-]+:[0-9]{12}:job/.*$"
}
},
"com.amazonaws.braket#JobCheckpointConfig": {
Expand Down

0 comments on commit 228341b

Please sign in to comment.