braket.schema_common.schema_base module¶
-
class
braket.schema_common.schema_base.
BraketSchemaBase
[source]¶ Bases:
pydantic.main.BaseModel
BraketSchemaBase which includes the schema header and should be the parent class for all schemas
-
braketSchemaHeader
¶ Schema header
Type: BraketSchemaHeader
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
-
static
import_schema_module
(schema: braket.schema_common.schema_base.BraketSchemaBase)[source]¶ Imports the module that holds the schema given the schema
Parameters: schema (BraketSchemaBase) – The schema
Returns: Module of the schema
Raises: ModuleNotFoundError
– If the schema module cannot be found according to- schema header
Examples
>> schema = BraketSchemaBase.parse_raw(json_string) >> module = import_schema_module(schema) >> module.AnnealingTaskResult.parse_raw(json_string)
-
static
parse_raw_schema
(json_str: str) → braket.schema_common.schema_base.BraketSchemaBase[source]¶ Return schema object given JSON string
Parameters: json_str (str) – The JSON string of the schema Returns: BraketSchemaBase – The schema object. This can also be an instance of a subclass of BraketSchemaBase.
-