cancel

suspend fun cancel(name: String, config: CancelBatchJobConfig? = null)

Cancels a batch job. Only available for batch jobs that are running or pending.

Parameters

name

A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the Gemini Enterprise Agent Platform client. Or "batches/abc" using the Gemini Developer API client.

config

A CancelBatchJobConfig for configuring the cancel request.