// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as LogsAPI from './logs'; export class Logs extends APIResource { /** * Download all flow run logs as a CSV file, collecting all logs until there are no * more logs to retrieve. */ download(id: string, params?: LogDownloadParams, options?: Core.RequestOptions): Core.APIPromise; download(id: string, options?: Core.RequestOptions): Core.APIPromise; download( id: string, params: LogDownloadParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.download(id, {}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion } = params; return this._client.get(`/api/flow_runs/${id}/logs/download`, { ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } export type LogDownloadResponse = unknown; export interface LogDownloadParams { 'x-prefect-api-version'?: string; } export namespace Logs { export import LogDownloadResponse = LogsAPI.LogDownloadResponse; export import LogDownloadParams = LogsAPI.LogDownloadParams; }