Coverage for src/braket/device_schema/device_action_properties.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"). You
4# may not use this file except in compliance with the License. A copy of
5# the License is located at
6#
7# http://aws.amazon.com/apache2.0/
8#
9# or in the "license" file accompanying this file. This file is
10# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11# ANY KIND, either express or implied. See the License for the specific
12# language governing permissions and limitations under the License.
14from enum import Enum
15from typing import List
17from pydantic import BaseModel
20class DeviceActionType(str, Enum):
21 """
22 These are the actions supported by braket.
23 """
25 JAQCD = "braket.ir.jaqcd.program"
26 ANNEALING = "braket.ir.annealing.problem"
29class DeviceActionProperties(BaseModel):
30 """
31 This class defines the actions that can be performed by a device
33 Attributes:
34 version: List of versions for the actions the device supports
35 actionType: Enum for the action type. Type of the action to be performed.
37 Examples:
38 >>> import json
39 >>> input_json = {
40 ... "actionType": "braket.ir.jaqcd.program",
41 ... "version": ["1.0", "1.1"],
42 ... }
43 >>> DeviceActionProperties.parse_raw(json.dumps(input_json))
44 """
46 version: List[str]
47 actionType: DeviceActionType