// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as FlowsAPI from './flows'; export class Flows extends APIResource { /** * Get deployment counts by flow id. */ countDeployments( params: FlowCountDeploymentsParams, options?: Core.RequestOptions, ): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/ui/flows/count-deployments', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Get the next flow run by flow id. */ nextRuns(params: FlowNextRunsParams, options?: Core.RequestOptions): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/ui/flows/next-runs', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } export type FlowCountDeploymentsResponse = Record; export type FlowNextRunsResponse = Record; export namespace FlowNextRunsResponse { export interface item { /** * The flow run id. */ id: string; /** * The flow id. */ flow_id: string; /** * The flow run name */ name: string; /** * The next scheduled start time */ next_scheduled_start_time: string; /** * The state name. */ state_name: string; /** * The state type. */ state_type: | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING'; } } export interface FlowCountDeploymentsParams { /** * Body param: */ flow_ids: Array; /** * Header param: */ 'x-prefect-api-version'?: string; } export interface FlowNextRunsParams { /** * Body param: */ flow_ids: Array; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace Flows { export import FlowCountDeploymentsResponse = FlowsAPI.FlowCountDeploymentsResponse; export import FlowNextRunsResponse = FlowsAPI.FlowNextRunsResponse; export import FlowCountDeploymentsParams = FlowsAPI.FlowCountDeploymentsParams; export import FlowNextRunsParams = FlowsAPI.FlowNextRunsParams; }