braket.schema_common.schema_base module

class braket.schema_common.schema_base.BraketSchemaBase(*, braketSchemaHeader: BraketSchemaHeader)[source]

Bases: 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.

braketSchemaHeader: BraketSchemaHeader
static import_schema_module(schema: 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) 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.

static get_schema_class(module, name)[source]