import { APIResource } from "../../../../core/resource.js"; import * as CancelAPI from "./cancel.js"; import { BaseCancel, Cancel, CancelCreateParams, CancelCreateResponse } from "./cancel.js"; import * as MessagesAPI from "./messages.js"; import { BaseMessages, MessageListParams, MessageListResponse, MessageListResponsesV4PagePaginationArray, Messages } from "./messages.js"; import { APIPromise } from "../../../../core/api-promise.js"; import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../../core/pagination.js"; import { RequestOptions } from "../../../../internal/request-options.js"; export declare class BaseBulk extends APIResource { static readonly _key: readonly ['emailSecurity', 'investigate', 'bulk']; /** * Creates a new bulk action job to move or release messages that match the * provided search parameters. * * @example * ```ts * const bulk = * await client.emailSecurity.investigate.bulk.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * action: 'MOVE', * search_params: {}, * }); * ``` */ create(params: BulkCreateParams, options?: RequestOptions): APIPromise; /** * Returns a paginated list of bulk action jobs for the account. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const bulkListResponse of client.emailSecurity.investigate.bulk.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params: BulkListParams, options?: RequestOptions): PagePromise; /** * Deletes the job, removing it from all list and detail endpoints. Only jobs in a * terminal state (`COMPLETED`, `CANCELLED`, `FAILED`, or `SKIPPED`) can be * deleted. To stop an in-progress job without removing it, use the cancel endpoint * instead. * * @example * ```ts * const bulk = * await client.emailSecurity.investigate.bulk.delete( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(jobID: string, params: BulkDeleteParams, options?: RequestOptions): APIPromise; /** * Returns the status and details of a specific bulk action job. * * @example * ```ts * const bulk = * await client.emailSecurity.investigate.bulk.get( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(jobID: string, params: BulkGetParams, options?: RequestOptions): APIPromise; } export declare class Bulk extends BaseBulk { cancel: CancelAPI.Cancel; messages: MessagesAPI.Messages; } export type BulkListResponsesV4PagePaginationArray = V4PagePaginationArray; export interface BulkCreateResponse { action_params: BulkCreateResponse.Move | BulkCreateResponse.Release; action_type: 'MOVE' | 'RELEASE'; created_at: string; job_id: string; messages_failed: number; messages_pending: number; messages_successful: number; search_params: BulkCreateResponse.SearchParams; status: 'PENDING' | 'DISCOVERING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'SKIPPED'; total_messages_discovered: number; comment?: string | null; completed_at?: string | null; started_at?: string | null; status_message?: string | null; } export declare namespace BulkCreateResponse { interface Move { destination: 'Inbox' | 'JunkEmail' | 'DeletedItems' | 'RecoverableItemsDeletions' | 'RecoverableItemsPurges'; type: 'MOVE'; expected_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; } interface Release { type: 'RELEASE'; } interface SearchParams { /** * @deprecated Use GET /investigate/{investigate_id}/action_log instead. */ action_log?: boolean; alert_id?: string | null; /** * Delivery status of the message. */ delivery_status?: 'delivered' | 'moved' | 'quarantined' | 'rejected' | 'deferred' | 'bounced' | 'queued'; detections_only?: boolean; domain?: string | null; /** * End of search date range. */ end?: string; exact_subject?: string | null; final_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; message_action?: 'PREVIEW' | 'QUARANTINE_RELEASED' | 'MOVED' | null; message_id?: string | null; metric?: string | null; query?: string | null; recipient?: string | null; sender?: string | null; /** * Beginning of search date range. */ start?: string; subject?: string | null; submissions?: boolean; } } export interface BulkListResponse { action_params: BulkListResponse.Move | BulkListResponse.Release; action_type: 'MOVE' | 'RELEASE'; created_at: string; job_id: string; messages_failed: number; messages_pending: number; messages_successful: number; search_params: BulkListResponse.SearchParams; status: 'PENDING' | 'DISCOVERING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'SKIPPED'; total_messages_discovered: number; comment?: string | null; completed_at?: string | null; started_at?: string | null; status_message?: string | null; } export declare namespace BulkListResponse { interface Move { destination: 'Inbox' | 'JunkEmail' | 'DeletedItems' | 'RecoverableItemsDeletions' | 'RecoverableItemsPurges'; type: 'MOVE'; expected_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; } interface Release { type: 'RELEASE'; } interface SearchParams { /** * @deprecated Use GET /investigate/{investigate_id}/action_log instead. */ action_log?: boolean; alert_id?: string | null; /** * Delivery status of the message. */ delivery_status?: 'delivered' | 'moved' | 'quarantined' | 'rejected' | 'deferred' | 'bounced' | 'queued'; detections_only?: boolean; domain?: string | null; /** * End of search date range. */ end?: string; exact_subject?: string | null; final_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; message_action?: 'PREVIEW' | 'QUARANTINE_RELEASED' | 'MOVED' | null; message_id?: string | null; metric?: string | null; query?: string | null; recipient?: string | null; sender?: string | null; /** * Beginning of search date range. */ start?: string; subject?: string | null; submissions?: boolean; } } export interface BulkDeleteResponse { id: string; } export interface BulkGetResponse { action_params: BulkGetResponse.Move | BulkGetResponse.Release; action_type: 'MOVE' | 'RELEASE'; created_at: string; job_id: string; messages_failed: number; messages_pending: number; messages_successful: number; search_params: BulkGetResponse.SearchParams; status: 'PENDING' | 'DISCOVERING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'SKIPPED'; total_messages_discovered: number; comment?: string | null; completed_at?: string | null; started_at?: string | null; status_message?: string | null; } export declare namespace BulkGetResponse { interface Move { destination: 'Inbox' | 'JunkEmail' | 'DeletedItems' | 'RecoverableItemsDeletions' | 'RecoverableItemsPurges'; type: 'MOVE'; expected_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; } interface Release { type: 'RELEASE'; } interface SearchParams { /** * @deprecated Use GET /investigate/{investigate_id}/action_log instead. */ action_log?: boolean; alert_id?: string | null; /** * Delivery status of the message. */ delivery_status?: 'delivered' | 'moved' | 'quarantined' | 'rejected' | 'deferred' | 'bounced' | 'queued'; detections_only?: boolean; domain?: string | null; /** * End of search date range. */ end?: string; exact_subject?: string | null; final_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; message_action?: 'PREVIEW' | 'QUARANTINE_RELEASED' | 'MOVED' | null; message_id?: string | null; metric?: string | null; query?: string | null; recipient?: string | null; sender?: string | null; /** * Beginning of search date range. */ start?: string; subject?: string | null; submissions?: boolean; } } export interface BulkCreateParams { /** * Path param: Identifier. */ account_id: string; /** * Body param */ action: 'MOVE' | 'RELEASE'; /** * Body param */ search_params: BulkCreateParams.SearchParams; /** * Body param */ comment?: string | null; /** * Body param */ destination?: 'Inbox' | 'JunkEmail' | 'DeletedItems' | 'RecoverableItemsDeletions' | 'RecoverableItemsPurges'; /** * Body param */ expected_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; } export declare namespace BulkCreateParams { interface SearchParams { /** * @deprecated Use GET /investigate/{investigate_id}/action_log instead. */ action_log?: boolean; alert_id?: string | null; /** * Delivery status of the message. */ delivery_status?: 'delivered' | 'moved' | 'quarantined' | 'rejected' | 'deferred' | 'bounced' | 'queued'; detections_only?: boolean; domain?: string | null; /** * End of search date range. */ end?: string; exact_subject?: string | null; final_disposition?: 'MALICIOUS' | 'MALICIOUS-BEC' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'ENCRYPTED' | 'EXTERNAL' | 'UNKNOWN' | 'NONE'; message_action?: 'PREVIEW' | 'QUARANTINE_RELEASED' | 'MOVED' | null; message_id?: string | null; metric?: string | null; query?: string | null; recipient?: string | null; sender?: string | null; /** * Beginning of search date range. */ start?: string; subject?: string | null; submissions?: boolean; } } export interface BulkListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ account_id: string; /** * Query param */ action_type?: 'MOVE' | 'RELEASE'; /** * Query param */ status?: 'PENDING' | 'DISCOVERING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'SKIPPED'; } export interface BulkDeleteParams { /** * Identifier. */ account_id: string; } export interface BulkGetParams { /** * Identifier. */ account_id: string; } export declare namespace Bulk { export { type BulkCreateResponse as BulkCreateResponse, type BulkListResponse as BulkListResponse, type BulkDeleteResponse as BulkDeleteResponse, type BulkGetResponse as BulkGetResponse, type BulkListResponsesV4PagePaginationArray as BulkListResponsesV4PagePaginationArray, type BulkCreateParams as BulkCreateParams, type BulkListParams as BulkListParams, type BulkDeleteParams as BulkDeleteParams, type BulkGetParams as BulkGetParams, }; export { Cancel as Cancel, BaseCancel as BaseCancel, type CancelCreateResponse as CancelCreateResponse, type CancelCreateParams as CancelCreateParams, }; export { Messages as Messages, BaseMessages as BaseMessages, type MessageListResponse as MessageListResponse, type MessageListResponsesV4PagePaginationArray as MessageListResponsesV4PagePaginationArray, type MessageListParams as MessageListParams, }; } //# sourceMappingURL=bulk.d.ts.map