// 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 GraphV2API from './graph-v2'; import * as FlowRunsAPI from './flow-runs'; export class GraphV2 extends APIResource { /** * Get a graph of the tasks and subflow runs for the given flow run */ retrieve( id: string, params?: GraphV2RetrieveParams, options?: Core.RequestOptions, ): Core.APIPromise; retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise; retrieve( id: string, params: GraphV2RetrieveParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.retrieve(id, {}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion, ...query } = params; return this._client.get(`/api/flow_runs/${id}/graph-v2`, { query, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } export interface GraphV2RetrieveParams { /** * Query param: Only include runs that start or end after this time. */ since?: string; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace GraphV2 { export import GraphV2RetrieveParams = GraphV2API.GraphV2RetrieveParams; }