import * as Utils from '@datocms/rest-client-utils'; import BaseResource from '../../BaseResource.js'; import type * as ApiTypes from '../ApiTypes.js'; import type * as RawApiTypes from '../RawApiTypes.js'; export default class JobResult extends BaseResource { static readonly TYPE = 'job_result' as const; /** * Retrieve a job result * * @throws {ApiError} * @throws {TimeoutError} */ find(jobResultId: string | ApiTypes.JobResultData) { return this.rawFind(Utils.toId(jobResultId)).then((body) => Utils.deserializeResponseBody(body), ); } /** * Retrieve a job result * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(jobResultId: string): Promise { return this.client.request({ method: 'GET', url: `/job-results/${jobResultId}`, }); } }