cloudflare
Version:
The official TypeScript library for the Cloudflare API
80 lines • 2.88 kB
text/typescript
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class BaseBulkOperations extends APIResource {
static readonly _key: readonly ['rules', 'lists', 'bulkOperations'];
/**
* Gets the current status of an asynchronous operation on a list.
*
* The `status` property can have one of the following values: `pending`,
* `running`, `completed`, or `failed`. If the status is `failed`, the `error`
* property will contain a message describing the error.
*
* @example
* ```ts
* const bulkOperation =
* await client.rules.lists.bulkOperations.get(
* '4da8780eeb215e6cb7f48dd981c4ea02',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(operationID: string, params: BulkOperationGetParams, options?: RequestOptions): APIPromise<BulkOperationGetResponse>;
}
export declare class BulkOperations extends BaseBulkOperations {
}
export type BulkOperationGetResponse = BulkOperationGetResponse.ListsBulkOperationPendingOrRunning | BulkOperationGetResponse.ListsBulkOperationCompleted | BulkOperationGetResponse.ListsBulkOperationFailed;
export declare namespace BulkOperationGetResponse {
interface ListsBulkOperationPendingOrRunning {
/**
* The unique operation ID of the asynchronous action.
*/
id: string;
/**
* The current status of the asynchronous operation.
*/
status: 'pending' | 'running';
}
interface ListsBulkOperationCompleted {
/**
* The unique operation ID of the asynchronous action.
*/
id: string;
/**
* The RFC 3339 timestamp of when the operation was completed.
*/
completed: string;
/**
* The current status of the asynchronous operation.
*/
status: 'completed';
}
interface ListsBulkOperationFailed {
/**
* The unique operation ID of the asynchronous action.
*/
id: string;
/**
* The RFC 3339 timestamp of when the operation was completed.
*/
completed: string;
/**
* A message describing the error when the status is `failed`.
*/
error: string;
/**
* The current status of the asynchronous operation.
*/
status: 'failed';
}
}
export interface BulkOperationGetParams {
/**
* The Account ID for this resource.
*/
account_id: string;
}
export declare namespace BulkOperations {
export { type BulkOperationGetResponse as BulkOperationGetResponse, type BulkOperationGetParams as BulkOperationGetParams, };
}
//# sourceMappingURL=bulk-operations.d.mts.map