Interface BatchServiceAsync
-
- All Implemented Interfaces:
public interface BatchServiceAsync
-
-
Method Summary
Modifier and Type Method Description abstract CompletableFuture<BetaMessageBatch>create(BetaMessageBatchCreateParams params, RequestOptions requestOptions)Send a batch of Message creation requests. abstract CompletableFuture<BetaMessageBatch>create(BetaMessageBatchCreateParams params)Send a batch of Message creation requests. abstract CompletableFuture<BetaMessageBatch>retrieve(BetaMessageBatchRetrieveParams params, RequestOptions requestOptions)This endpoint is idempotent and can be used to poll for Message Batch completion. abstract CompletableFuture<BetaMessageBatch>retrieve(BetaMessageBatchRetrieveParams params)This endpoint is idempotent and can be used to poll for Message Batch completion. abstract CompletableFuture<BetaMessageBatchListPageAsync>list(BetaMessageBatchListParams params, RequestOptions requestOptions)List all Message Batches within a Workspace. abstract CompletableFuture<BetaMessageBatchListPageAsync>list(BetaMessageBatchListParams params)List all Message Batches within a Workspace. abstract CompletableFuture<BetaDeletedMessageBatch>delete(BetaMessageBatchDeleteParams params, RequestOptions requestOptions)Delete a Message Batch. abstract CompletableFuture<BetaDeletedMessageBatch>delete(BetaMessageBatchDeleteParams params)Delete a Message Batch. abstract CompletableFuture<BetaMessageBatch>cancel(BetaMessageBatchCancelParams params, RequestOptions requestOptions)Batches may be canceled any time before processing ends. abstract CompletableFuture<BetaMessageBatch>cancel(BetaMessageBatchCancelParams params)Batches may be canceled any time before processing ends. abstract AsyncStreamResponse<BetaMessageBatchIndividualResponse>resultsStreaming(BetaMessageBatchResultsParams params, RequestOptions requestOptions)Streams the results of a Message Batch as a .jsonlfile.abstract AsyncStreamResponse<BetaMessageBatchIndividualResponse>resultsStreaming(BetaMessageBatchResultsParams params)Streams the results of a Message Batch as a .jsonlfile.-
-
Method Detail
-
create
abstract CompletableFuture<BetaMessageBatch> create(BetaMessageBatchCreateParams params, RequestOptions requestOptions)
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
-
create
abstract CompletableFuture<BetaMessageBatch> create(BetaMessageBatchCreateParams params)
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
-
retrieve
abstract CompletableFuture<BetaMessageBatch> retrieve(BetaMessageBatchRetrieveParams params, RequestOptions requestOptions)
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the
results_urlfield in the response.
-
retrieve
abstract CompletableFuture<BetaMessageBatch> retrieve(BetaMessageBatchRetrieveParams params)
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the
results_urlfield in the response.
-
list
abstract CompletableFuture<BetaMessageBatchListPageAsync> list(BetaMessageBatchListParams params, RequestOptions requestOptions)
List all Message Batches within a Workspace. Most recently created batches are returned first.
-
list
abstract CompletableFuture<BetaMessageBatchListPageAsync> list(BetaMessageBatchListParams params)
List all Message Batches within a Workspace. Most recently created batches are returned first.
-
delete
abstract CompletableFuture<BetaDeletedMessageBatch> delete(BetaMessageBatchDeleteParams params, RequestOptions requestOptions)
Delete a Message Batch.
Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
-
delete
abstract CompletableFuture<BetaDeletedMessageBatch> delete(BetaMessageBatchDeleteParams params)
Delete a Message Batch.
Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
-
cancel
abstract CompletableFuture<BetaMessageBatch> cancel(BetaMessageBatchCancelParams params, RequestOptions requestOptions)
Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a
cancelingstate, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.The number of canceled requests is specified in
request_counts. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
-
cancel
abstract CompletableFuture<BetaMessageBatch> cancel(BetaMessageBatchCancelParams params)
Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a
cancelingstate, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.The number of canceled requests is specified in
request_counts. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
-
resultsStreaming
abstract AsyncStreamResponse<BetaMessageBatchIndividualResponse> resultsStreaming(BetaMessageBatchResultsParams params, RequestOptions requestOptions)
Streams the results of a Message Batch as a
.jsonlfile.Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the
custom_idfield to match results to requests.
-
resultsStreaming
abstract AsyncStreamResponse<BetaMessageBatchIndividualResponse> resultsStreaming(BetaMessageBatchResultsParams params)
Streams the results of a Message Batch as a
.jsonlfile.Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the
custom_idfield to match results to requests.
-
-
-
-