// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import * as ConfigurationAPI from './configuration'; import { Configuration, ConfigurationRetrieveResponse, ConfigurationUpdateParams, SandboxJobConfiguration, } from './configuration'; import { APIPromise } from '../../../core/api-promise'; import { RequestOptions } from '../../../internal/request-options'; export class Jobs extends APIResource { configuration: ConfigurationAPI.Configuration = new ConfigurationAPI.Configuration(this._client); /** * Enqueue a new sandbox job * * @example * ```ts * const job = await client.sandbox.jobs.create({ * type: 'data_sync_all', * }); * ``` */ create(body: JobCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/sandbox/jobs', { body, ...options, __security: { bearerAuth: true } }); } } export interface JobCreateResponse { /** * The number of allowed refreshes per hour (per hour, fixed window) */ allowed_refreshes: number; /** * The id of the job that has been created. */ job_id: string; /** * The url that can be used to retrieve the job status */ job_url: string; /** * The number of remaining refreshes available (per hour, fixed window) */ remaining_refreshes: number; } export interface JobCreateParams { /** * The type of job to start. Currently the only supported type is `data_sync_all` */ type: 'data_sync_all'; } Jobs.Configuration = Configuration; export declare namespace Jobs { export { type JobCreateResponse as JobCreateResponse, type JobCreateParams as JobCreateParams }; export { Configuration as Configuration, type SandboxJobConfiguration as SandboxJobConfiguration, type ConfigurationRetrieveResponse as ConfigurationRetrieveResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, }; }