leaf_engine.io.api.crud_openapi

Attributes

OPENAPI_ENDPOINT

OPENAPI_TOKEN

schemas

Functions

_get_api_schemas(→ dict)

Gets CRUD API schema.

_validate(→ None)

Validates record against schema.

get_columns(→ Mapping[str, Any])

Returns a mapping of column names and data types for a given table. Returns

validate_network_move(→ None)

Validates network move record.

validate_raw_insert(→ None)

Validates raw shipment or raw lane record.

Module Contents

leaf_engine.io.api.crud_openapi._get_api_schemas() dict

Gets CRUD API schema.

Return type:

dict

leaf_engine.io.api.crud_openapi._validate(record: Mapping[str, Any], schema: Mapping[str, Any]) None

Validates record against schema.

Raises:

ValidationError – Raises when record is invalid.

Parameters:
  • record (Mapping[str, Any]) – Record to validate.

  • schema (Mapping[str, Any]) – OpenAPI/Swagger 2.0 json schema.

Return type:

None

leaf_engine.io.api.crud_openapi.get_columns(table_name: str) Mapping[str, Any]

Returns a mapping of column names and data types for a given table. Returns all properties defined, and does not distinguish between required or not.

Parameters:

table_name (str) – (str): Name of database table

Return type:

Mapping[str, Any]

leaf_engine.io.api.crud_openapi.validate_network_move(record: Mapping[str, Any]) None

Validates network move record.

Raises:

ValidationError – Raises when record is invalid.

Parameters:

record (Mapping[str, Any]) – Network move record.

Return type:

None

leaf_engine.io.api.crud_openapi.validate_raw_insert(record: Mapping[str, Any], table_name: str) None

Validates raw shipment or raw lane record.

Raises:

ValidationError – Raises when record is invalid.

Parameters:
  • record (Mapping[str, Any]) – Raw db record.

  • table_name (str) –

Return type:

None

leaf_engine.io.api.crud_openapi.OPENAPI_ENDPOINT
leaf_engine.io.api.crud_openapi.OPENAPI_TOKEN
leaf_engine.io.api.crud_openapi.schemas