prefactor_http.models.bulk module
prefactor_http.models.bulk module
Section titled “prefactor_http.models.bulk module”Models for the Bulk API.
class prefactor_http.models.bulk.BulkItem(, _type: str, idempotency_key: Annotated[str, MinLen(min_length=8), MaxLen(max_length=64)], **extra_data: Any)
Section titled “class prefactor_http.models.bulk.BulkItem(, _type: str, idempotency_key: Annotated[str, MinLen(min_length=8), MaxLen(max_length=64)], **extra_data: Any)”Bases: BaseModel
A single item in a bulk request.
Each item must include _type and idempotency_key, plus any additional parameters required by the specific action type.
idempotency_key : str
Section titled “idempotency_key : str”Required unique idempotency key for this item. Must be at least 8 characters long and unique within the request.
model_config = {‘extra’: ‘allow’}
Section titled “model_config = {‘extra’: ‘allow’}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
type : str
Section titled “type : str”The type of query/action to execute (e.g., ‘agents/list’, ‘agents/create’).
class prefactor_http.models.bulk.BulkOutput(, status: str, **extra_data: Any)
Section titled “class prefactor_http.models.bulk.BulkOutput(, status: str, **extra_data: Any)”Bases: BaseModel
Output from a query or action.
Contains either a success response (with ‘status’: ‘success’ and operation-specific data) or an error response (with ‘status’: ‘error’, ‘code’, ‘message’, and optionally ‘errors’).
model_config = {‘extra’: ‘allow’}
Section titled “model_config = {‘extra’: ‘allow’}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
status : str
Section titled “status : str”‘success’ or ‘error’.
- Type: Status of the operation
classmethod validate_status(v: str) → str
Section titled “classmethod validate_status(v: str) → str”class prefactor_http.models.bulk.BulkRequest(, items: Annotated[list[BulkItem], MinLen(min_length=1)])
Section titled “class prefactor_http.models.bulk.BulkRequest(, items: Annotated[list[BulkItem], MinLen(min_length=1)])”Bases: BaseModel
Request body for bulk query/action operations.
Allows executing multiple API operations in a single request.
items : list[BulkItem]
Section titled “items : list[BulkItem]”List of items to process in bulk. Each item will be processed independently in its own transaction.
model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
classmethod validate_unique_idempotency_keys(items: list[BulkItem]) → list[BulkItem]
Section titled “classmethod validate_unique_idempotency_keys(items: list[BulkItem]) → list[BulkItem]”Validate that all idempotency keys are unique within the request.
class prefactor_http.models.bulk.BulkResponse(, status: str = ‘success’, outputs: dict[str, BulkOutput])
Section titled “class prefactor_http.models.bulk.BulkResponse(, status: str = ‘success’, outputs: dict[str, BulkOutput])”Bases: BaseModel
Response from bulk query/action operations.
Contains a map of results keyed by the idempotency_key from each request item.
model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
outputs : dict[str, BulkOutput]
Section titled “outputs : dict[str, BulkOutput]”Map where keys are the idempotency_key values from the request, and values are the corresponding query/action outputs or error responses.
status : str
Section titled “status : str”Response status, always ‘success’ when the request is processed.