// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../core/resource'; import * as RequestsAPI from './requests'; import { APIPromise } from '../../../../core/api-promise'; import { buildHeaders } from '../../../../internal/headers'; import { RequestOptions } from '../../../../internal/request-options'; export class Active extends APIResource { /** * Cancel the caller's queued or processing export so a new request can be created. */ cancel( params: ActiveCancelParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.post('/users/personal-data-export/requests/active/cancel', { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response after cancelling the user's active export request. */ export interface ActiveCancelResponse { /** * User-facing confirmation message. */ message: string; /** * Cancelled export request identifier. */ request_id: string; /** * Updated lifecycle status. */ status: RequestsAPI.PersonalDataExportStatus; } export interface ActiveCancelParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Active { export { type ActiveCancelResponse as ActiveCancelResponse, type ActiveCancelParams as ActiveCancelParams }; }