pub struct Batches<'a> { /* private fields */ }Expand description
Batches resource. Workflow polling happens only on an explicit wait call.
Implementations§
Source§impl<'a> Batches<'a>
impl<'a> Batches<'a>
Sourcepub async fn create<'r>(
&self,
input: impl Into<BatchCreateInput<'r>>,
idempotency_key: Option<&str>,
) -> Result<Batch, BatchOperationError>
pub async fn create<'r>( &self, input: impl Into<BatchCreateInput<'r>>, idempotency_key: Option<&str>, ) -> Result<Batch, BatchOperationError>
Create from an uploaded file or from native requests (via CreateBatchFromRequests).
The requests path uploads buffered JSONL and creates the batch, without polling or retries.
Post-upload failure exposes a recoverable file id/key in BatchOperationError::Submission.
Sourcepub async fn retrieve(&self, id: &str) -> Result<Batch, Error>
pub async fn retrieve(&self, id: &str) -> Result<Batch, Error>
Retrieve the latest state without polling.
Sourcepub async fn list(
&self,
options: BatchListOptions<'_>,
) -> Result<BatchPage<Batch>, Error>
pub async fn list( &self, options: BatchListOptions<'_>, ) -> Result<BatchPage<Batch>, Error>
Retrieve one page without automatic pagination.
Sourcepub async fn cancel(&self, id: &str) -> Result<Batch, Error>
pub async fn cancel(&self, id: &str) -> Result<Batch, Error>
Explicitly request server cancellation; partial results may remain.
Sourcepub async fn wait(
&self,
id: &str,
options: BatchWaitOptions,
) -> Result<Batch, BatchOperationError>
pub async fn wait( &self, id: &str, options: BatchWaitOptions, ) -> Result<Batch, BatchOperationError>
Wait until completed/failed/expired/cancelled. HTTP errors propagate without retry. Timeout or dropping this future stops client-side polling, never the server batch.
Sourcepub async fn results(
&self,
id: &str,
) -> Result<BatchResults<'a>, BatchOperationError>
pub async fn results( &self, id: &str, ) -> Result<BatchResults<'a>, BatchOperationError>
Read terminal output and error files through a bounded, per-file buffered async cursor.
This never waits for completion. Inspect cursor.batch() for batch-level validation errors.
Sourcepub async fn results_with_options(
&self,
id: &str,
options: BatchResultsOptions,
) -> Result<BatchResults<'a>, BatchOperationError>
pub async fn results_with_options( &self, id: &str, options: BatchResultsOptions, ) -> Result<BatchResults<'a>, BatchOperationError>
Results cursor with an explicit per-file byte allowance.