aito.client.v2.responses.V2BatchResponse

class aito.client.v2.responses.V2BatchResponse(json: Dict)

Bases: V2Response

A batch response — an array of typed sub-results

Each element is itself a full typed response, so a caller dispatches per element with response_for_kind().

In practice the engine returns a bare JSON array here, not the {"kind": "batch", "data": [...]} envelope the response-format spec documents. Both are accepted: the bare array is what actually arrives today, and the envelope is what the spec promises, so the class keeps working if the engine is brought in line. Filed against the engine.

Parameters:

json (Dict) – the parsed JSON response

Methods

Attributes

data

the raw sub-results

engine

which engine answered, if the client requested meta

json

the raw JSON response

kind

the result kind this response class represents

meta

the response metadata, empty unless the client was built with meta=True

responses

the sub-results, each parsed into its own response class

warnings

the non-fatal notes the engine attached to this response

property data: List[Dict]

the raw sub-results

Return type:

List[Dict]

property engine: str | None

which engine answered, if the client requested meta

Return type:

Optional[str]

property json: Dict

the raw JSON response

Return type:

Dict

kind: str = 'batch'

the result kind this response class represents

property meta: Dict

the response metadata, empty unless the client was built with meta=True

Currently carries enginev2 for a collection served by the rep2 engine, v1 for a legacy table served by the compatibility shim.

Return type:

Dict

property responses: List[V2Response]

the sub-results, each parsed into its own response class

Return type:

List[V2Response]

property warnings: List[V2Warning]

the non-fatal notes the engine attached to this response

Empty for the great majority of responses. Worth checking when a result is unexpectedly broad or unexpectedly empty — the engine reports a where it could not apply here rather than failing the request.

Return type:

List[V2Warning]