// 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 GraphAPI from './graph'; import * as FlowRunsAPI from './flow-runs'; export class Graph extends APIResource { /** * Get a task run dependency map for a given flow run. */ retrieve( id: string, params?: GraphRetrieveParams, options?: Core.RequestOptions, ): Core.APIPromise; retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise; retrieve( id: string, params: GraphRetrieveParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.retrieve(id, {}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion } = params; return this._client.get(`/api/flow_runs/${id}/graph`, { ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } export type GraphRetrieveResponse = Array; export interface GraphRetrieveParams { 'x-prefect-api-version'?: string; } export namespace Graph { export import GraphRetrieveResponse = GraphAPI.GraphRetrieveResponse; export import GraphRetrieveParams = GraphAPI.GraphRetrieveParams; }