// 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 TaskRunsAPI from './task-runs'; import * as Shared from './shared'; export class TaskRuns extends APIResource { /** * Create a task run. If a task run with the same flow_run_id, task_key, and * dynamic_key already exists, the existing task run will be returned. * * If no state is provided, the task run will be created in a PENDING state. */ create(params: TaskRunCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/task_runs/', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Get a task run by id. */ retrieve( id: string, params?: TaskRunRetrieveParams, options?: Core.RequestOptions, ): Core.APIPromise; retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise; retrieve( id: string, params: TaskRunRetrieveParams | 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/task_runs/${id}`, { ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Updates a task run. */ update(id: string, params: TaskRunUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.patch(`/api/task_runs/${id}`, { body, ...options, headers: { Accept: '*/*', ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Delete a task run by id. */ delete(id: string, params?: TaskRunDeleteParams, options?: Core.RequestOptions): Core.APIPromise; delete(id: string, options?: Core.RequestOptions): Core.APIPromise; delete( id: string, params: TaskRunDeleteParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.delete(id, {}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion } = params; return this._client.delete(`/api/task_runs/${id}`, { ...options, headers: { Accept: '*/*', ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Count task runs. */ count(params?: TaskRunCountParams, options?: Core.RequestOptions): Core.APIPromise; count(options?: Core.RequestOptions): Core.APIPromise; count( params: TaskRunCountParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.count({}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/task_runs/count', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Query for task run history data across a given range and interval. */ history( params: TaskRunHistoryParams, options?: Core.RequestOptions, ): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/task_runs/history', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Query for task runs. */ query(params?: TaskRunQueryParams, options?: Core.RequestOptions): Core.APIPromise; query(options?: Core.RequestOptions): Core.APIPromise; query( params: TaskRunQueryParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.query({}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post('/api/task_runs/filter', { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } /** * Set a task run state, invoking any orchestration rules. */ setState( id: string, params: TaskRunSetStateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { 'x-prefect-api-version': xPrefectAPIVersion, ...body } = params; return this._client.post(`/api/task_runs/${id}/set_state`, { body, ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } /** * An ORM representation of task run data. */ export interface TaskRun { /** * A dynamic key used to differentiate between multiple runs of the same task * within the same flow run. */ dynamic_key: string; /** * A unique identifier for the task being run. */ task_key: string; id?: string; /** * Specifies when the cached state should expire. */ cache_expiration?: string | null; /** * An optional cache key. If a COMPLETED state associated with this cache key is * found, the cached COMPLETED state will be used instead of executing the task * run. */ cache_key?: string | null; created?: string | null; /** * Defines of how a task run should retry. */ empirical_policy?: TaskRun.EmpiricalPolicy; /** * The actual end time. */ end_time?: string | null; /** * A real-time estimate of total run time. */ estimated_run_time?: number; /** * The difference between actual and expected start time. */ estimated_start_time_delta?: number; /** * The task run's expected start time. */ expected_start_time?: string | null; /** * The flow run id of the task run. */ flow_run_id?: string | null; /** * If the parent flow has retried, this indicates the flow retry this run is * associated with. */ flow_run_run_count?: number; name?: string; /** * The next time the task run is scheduled to start. */ next_scheduled_start_time?: string | null; /** * The number of times the task run has been executed. */ run_count?: number; /** * The actual start time. */ start_time?: string | null; /** * Represents the state of a run. */ state?: Shared.State | null; /** * The id of the current task run state. */ state_id?: string | null; /** * The name of the current task run state. */ state_name?: string | null; /** * Enumeration of state types. */ state_type?: | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' | null; /** * A list of tags for the task run. */ tags?: Array; /** * Tracks the source of inputs to a task run. Used for internal bookkeeping. */ task_inputs?: Record>; /** * The version of the task being run. */ task_version?: string | null; /** * Total run time. If the task run was executed multiple times, the time of each * run will be summed. */ total_run_time?: number; updated?: string | null; } export namespace TaskRun { /** * Defines of how a task run should retry. */ export interface EmpiricalPolicy { /** * @deprecated: The maximum number of retries. Field is not used. Please use * `retries` instead. */ max_retries?: number; /** * The number of retries. */ retries?: number | null; /** * A delay time or list of delay times between retries, in seconds. */ retry_delay?: number | Array | null; /** * @deprecated: The delay between retries. Field is not used. Please use * `retry_delay` instead. */ retry_delay_seconds?: number; /** * Determines the amount a retry should jitter */ retry_jitter_factor?: number | null; } /** * Represents a task run result input to another task run. */ export interface TaskRunResult { id: string; input_type?: 'task_run'; } /** * Represents a parameter input to a task run. */ export interface Parameter { name: string; input_type?: 'parameter'; } /** * Represents constant input value to a task run. */ export interface Constant { type: string; input_type?: 'constant'; } } export type TaskRunCountResponse = number; export type TaskRunHistoryResponse = Array; export type TaskRunQueryResponse = Array; export interface TaskRunCreateParams { /** * Body param: A dynamic key used to differentiate between multiple runs of the * same task within the same flow run. */ dynamic_key: string; /** * Body param: A unique identifier for the task being run. */ task_key: string; /** * Body param: The ID to assign to the task run. If not provided, a random UUID * will be generated. */ id?: string | null; /** * Body param: Specifies when the cached state should expire. */ cache_expiration?: string | null; /** * Body param: An optional cache key. If a COMPLETED state associated with this * cache key is found, the cached COMPLETED state will be used instead of executing * the task run. */ cache_key?: string | null; /** * Body param: Defines of how a task run should retry. */ empirical_policy?: TaskRunCreateParams.EmpiricalPolicy; /** * Body param: The flow run id of the task run. */ flow_run_id?: string | null; /** * Body param: */ name?: string; /** * Body param: Data used by the Prefect REST API to create a new state. */ state?: TaskRunCreateParams.State | null; /** * Body param: A list of tags for the task run. */ tags?: Array; /** * Body param: The inputs to the task run. */ task_inputs?: Record< string, Array >; /** * Body param: The version of the task being run. */ task_version?: string | null; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace TaskRunCreateParams { /** * Defines of how a task run should retry. */ export interface EmpiricalPolicy { /** * @deprecated: The maximum number of retries. Field is not used. Please use * `retries` instead. */ max_retries?: number; /** * The number of retries. */ retries?: number | null; /** * A delay time or list of delay times between retries, in seconds. */ retry_delay?: number | Array | null; /** * @deprecated: The delay between retries. Field is not used. Please use * `retry_delay` instead. */ retry_delay_seconds?: number; /** * Determines the amount a retry should jitter */ retry_jitter_factor?: number | null; } /** * Data used by the Prefect REST API to create a new state. */ export interface State { /** * The type of the state to create */ type: | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING'; /** * The data of the state to create */ data?: unknown | null; /** * The message of the state to create */ message?: string | null; /** * The name of the state to create */ name?: string | null; /** * The details of the state to create */ state_details?: State.StateDetails; } export namespace State { /** * The details of the state to create */ export interface StateDetails { cache_expiration?: string | null; cache_key?: string | null; child_flow_run_id?: string | null; deferred?: boolean | null; flow_run_id?: string | null; pause_key?: string | null; pause_reschedule?: boolean; pause_timeout?: string | null; refresh_cache?: boolean | null; retriable?: boolean | null; run_input_keyset?: Record | null; scheduled_time?: string | null; task_parameters_id?: string | null; task_run_id?: string | null; transition_id?: string | null; untrackable_result?: boolean; } } /** * Represents a task run result input to another task run. */ export interface TaskRunResult { id: string; input_type?: 'task_run'; } /** * Represents a parameter input to a task run. */ export interface Parameter { name: string; input_type?: 'parameter'; } /** * Represents constant input value to a task run. */ export interface Constant { type: string; input_type?: 'constant'; } } export interface TaskRunRetrieveParams { 'x-prefect-api-version'?: string; } export interface TaskRunUpdateParams { /** * Body param: */ name?: string; /** * Header param: */ 'x-prefect-api-version'?: string; } export interface TaskRunDeleteParams { 'x-prefect-api-version'?: string; } export interface TaskRunCountParams { /** * Body param: Filter for deployments. Only deployments matching all criteria will * be returned. */ deployments?: TaskRunCountParams.Deployments; /** * Body param: Filter flow runs. Only flow runs matching all criteria will be * returned */ flow_runs?: TaskRunCountParams.FlowRuns; /** * Body param: Filter for flows. Only flows matching all criteria will be returned. */ flows?: TaskRunCountParams.Flows; /** * Body param: Filter task runs. Only task runs matching all criteria will be * returned */ task_runs?: TaskRunCountParams.TaskRuns; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace TaskRunCountParams { /** * Filter for deployments. Only deployments matching all criteria will be returned. */ export interface Deployments { /** * Filter by `Deployment.id`. */ id?: Deployments.ID | null; /** * Filter by `Deployment.concurrency_limit`. */ concurrency_limit?: Deployments.ConcurrencyLimit | null; /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ flow_or_deployment_name?: Deployments.FlowOrDeploymentName | null; /** * Filter by `Deployment.name`. */ name?: Deployments.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Deployment.paused`. */ paused?: Deployments.Paused | null; /** * Filter by `Deployment.tags`. */ tags?: Deployments.Tags | null; /** * Filter by `Deployment.work_queue_name`. */ work_queue_name?: Deployments.WorkQueueName | null; } export namespace Deployments { /** * Filter by `Deployment.id`. */ export interface ID { /** * A list of deployment ids to include */ any_?: Array | null; } /** * Filter by `Deployment.concurrency_limit`. */ export interface ConcurrencyLimit { /** * Only include deployments with a concurrency limit greater than or equal to this * value */ ge_?: number | null; /** * If true, only include deployments without a concurrency limit */ is_null_?: boolean | null; /** * Only include deployments with a concurrency limit less than or equal to this * value */ le_?: number | null; } /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ export interface FlowOrDeploymentName { /** * A case-insensitive partial match on deployment or flow names. For example, * passing 'example' might match deployments or flows with 'example' in their * names. */ like_?: string | null; } /** * Filter by `Deployment.name`. */ export interface Name { /** * A list of deployment names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Deployment.paused`. */ export interface Paused { /** * Only returns where deployment is/is not paused */ eq_?: boolean | null; } /** * Filter by `Deployment.tags`. */ export interface Tags { /** * A list of tags. Deployments will be returned only if their tags are a superset * of the list */ all_?: Array | null; /** * If true, only include deployments without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Deployment.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; } } /** * Filter flow runs. Only flow runs matching all criteria will be returned */ export interface FlowRuns { /** * Filter by `FlowRun.id`. */ id?: FlowRuns.ID | null; /** * Filter by `FlowRun.deployment_id`. */ deployment_id?: FlowRuns.DeploymentID | null; /** * Filter by `FlowRun.expected_start_time`. */ expected_start_time?: FlowRuns.ExpectedStartTime | null; /** * Filter by `FlowRun.flow_version`. */ flow_version?: FlowRuns.FlowVersion | null; /** * Filter by FlowRun.idempotency_key. */ idempotency_key?: FlowRuns.IdempotencyKey | null; /** * Filter by `FlowRun.name`. */ name?: FlowRuns.Name | null; /** * Filter by `FlowRun.next_scheduled_start_time`. */ next_scheduled_start_time?: FlowRuns.NextScheduledStartTime | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter for subflows of a given flow run */ parent_flow_run_id?: FlowRuns.ParentFlowRunID | null; /** * Filter by `FlowRun.parent_task_run_id`. */ parent_task_run_id?: FlowRuns.ParentTaskRunID | null; /** * Filter by `FlowRun.start_time`. */ start_time?: FlowRuns.StartTime | null; /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ state?: FlowRuns.State | null; /** * Filter by `FlowRun.tags`. */ tags?: FlowRuns.Tags | null; /** * Filter by `FlowRun.work_queue_name`. */ work_queue_name?: FlowRuns.WorkQueueName | null; } export namespace FlowRuns { /** * Filter by `FlowRun.id`. */ export interface ID { /** * A list of flow run ids to include */ any_?: Array | null; /** * A list of flow run ids to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.deployment_id`. */ export interface DeploymentID { /** * A list of flow run deployment ids to include */ any_?: Array | null; /** * If true, only include flow runs without deployment ids */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include flow runs scheduled to start at or after this time */ after_?: string | null; /** * Only include flow runs scheduled to start at or before this time */ before_?: string | null; } /** * Filter by `FlowRun.flow_version`. */ export interface FlowVersion { /** * A list of flow run flow_versions to include */ any_?: Array | null; } /** * Filter by FlowRun.idempotency_key. */ export interface IdempotencyKey { /** * A list of flow run idempotency keys to include */ any_?: Array | null; /** * A list of flow run idempotency keys to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.name`. */ export interface Name { /** * A list of flow run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `FlowRun.next_scheduled_start_time`. */ export interface NextScheduledStartTime { /** * Only include flow runs with a next_scheduled_start_time at or after this time */ after_?: string | null; /** * Only include flow runs with a next_scheduled_start_time or before this time */ before_?: string | null; } /** * Filter for subflows of a given flow run */ export interface ParentFlowRunID { /** * A list of parent flow run ids to include */ any_?: Array | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.parent_task_run_id`. */ export interface ParentTaskRunID { /** * A list of flow run parent_task_run_ids to include */ any_?: Array | null; /** * If true, only include flow runs without parent_task_run_id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.start_time`. */ export interface StartTime { /** * Only include flow runs starting at or after this time */ after_?: string | null; /** * Only include flow runs starting at or before this time */ before_?: string | null; /** * If true, only return flow runs without a start time */ is_null_?: boolean | null; } /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ export interface State { /** * Filter by `FlowRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `FlowRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `FlowRun.state_name`. */ export interface Name { /** * A list of flow run state names to include */ any_?: Array | null; /** * A list of flow run state names to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.state_type`. */ export interface Type { /** * A list of flow run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; /** * A list of flow run state types to exclude */ not_any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `FlowRun.tags`. */ export interface Tags { /** * A list of tags. Flow runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include flow runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; /** * If true, only include flow runs without work queue names */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter for flows. Only flows matching all criteria will be returned. */ export interface Flows { /** * Filter by `Flow.id`. */ id?: Flows.ID | null; /** * Filter by flows by deployment */ deployment?: Flows.Deployment | null; /** * Filter by `Flow.name`. */ name?: Flows.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Flow.tags`. */ tags?: Flows.Tags | null; } export namespace Flows { /** * Filter by `Flow.id`. */ export interface ID { /** * A list of flow ids to include */ any_?: Array | null; } /** * Filter by flows by deployment */ export interface Deployment { /** * If true, only include flows without deployments */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Flow.name`. */ export interface Name { /** * A list of flow names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Flow.tags`. */ export interface Tags { /** * A list of tags. Flows will be returned only if their tags are a superset of the * list */ all_?: Array | null; /** * If true, only include flows without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter task runs. Only task runs matching all criteria will be returned */ export interface TaskRuns { /** * Filter by `TaskRun.id`. */ id?: TaskRuns.ID | null; /** * Filter by `TaskRun.expected_start_time`. */ expected_start_time?: TaskRuns.ExpectedStartTime | null; /** * Filter by `TaskRun.flow_run_id`. */ flow_run_id?: TaskRuns.FlowRunID | null; /** * Filter by `TaskRun.name`. */ name?: TaskRuns.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.start_time`. */ start_time?: TaskRuns.StartTime | null; /** * Filter by `TaskRun.type` and `TaskRun.name`. */ state?: TaskRuns.State | null; /** * Filter by `TaskRun.subflow_run`. */ subflow_runs?: TaskRuns.SubflowRuns | null; /** * Filter by `TaskRun.tags`. */ tags?: TaskRuns.Tags | null; } export namespace TaskRuns { /** * Filter by `TaskRun.id`. */ export interface ID { /** * A list of task run ids to include */ any_?: Array | null; } /** * Filter by `TaskRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include task runs expected to start at or after this time */ after_?: string | null; /** * Only include task runs expected to start at or before this time */ before_?: string | null; } /** * Filter by `TaskRun.flow_run_id`. */ export interface FlowRunID { /** * A list of task run flow run ids to include */ any_?: Array | null; /** * Filter for task runs with None as their flow run id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `TaskRun.name`. */ export interface Name { /** * A list of task run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `TaskRun.start_time`. */ export interface StartTime { /** * Only include task runs starting at or after this time */ after_?: string | null; /** * Only include task runs starting at or before this time */ before_?: string | null; /** * If true, only return task runs without a start time */ is_null_?: boolean | null; } /** * Filter by `TaskRun.type` and `TaskRun.name`. */ export interface State { /** * Filter by `TaskRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `TaskRun.state_name`. */ export interface Name { /** * A list of task run state names to include */ any_?: Array | null; } /** * Filter by `TaskRun.state_type`. */ export interface Type { /** * A list of task run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `TaskRun.subflow_run`. */ export interface SubflowRuns { /** * If true, only include task runs that are subflow run parents; if false, exclude * parent task runs */ exists_?: boolean | null; } /** * Filter by `TaskRun.tags`. */ export interface Tags { /** * A list of tags. Task runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include task runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } } export interface TaskRunHistoryParams { /** * Body param: The history's end time. */ history_end: string; /** * Body param: The size of each history interval, in seconds. Must be at least 1 * second. */ history_interval: number; /** * Body param: The history's start time. */ history_start: string; /** * Body param: Filter for deployments. Only deployments matching all criteria will * be returned. */ deployments?: TaskRunHistoryParams.Deployments; /** * Body param: Filter flow runs. Only flow runs matching all criteria will be * returned */ flow_runs?: TaskRunHistoryParams.FlowRuns; /** * Body param: Filter for flows. Only flows matching all criteria will be returned. */ flows?: TaskRunHistoryParams.Flows; /** * Body param: Filter task runs. Only task runs matching all criteria will be * returned */ task_runs?: TaskRunHistoryParams.TaskRuns; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace TaskRunHistoryParams { /** * Filter for deployments. Only deployments matching all criteria will be returned. */ export interface Deployments { /** * Filter by `Deployment.id`. */ id?: Deployments.ID | null; /** * Filter by `Deployment.concurrency_limit`. */ concurrency_limit?: Deployments.ConcurrencyLimit | null; /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ flow_or_deployment_name?: Deployments.FlowOrDeploymentName | null; /** * Filter by `Deployment.name`. */ name?: Deployments.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Deployment.paused`. */ paused?: Deployments.Paused | null; /** * Filter by `Deployment.tags`. */ tags?: Deployments.Tags | null; /** * Filter by `Deployment.work_queue_name`. */ work_queue_name?: Deployments.WorkQueueName | null; } export namespace Deployments { /** * Filter by `Deployment.id`. */ export interface ID { /** * A list of deployment ids to include */ any_?: Array | null; } /** * Filter by `Deployment.concurrency_limit`. */ export interface ConcurrencyLimit { /** * Only include deployments with a concurrency limit greater than or equal to this * value */ ge_?: number | null; /** * If true, only include deployments without a concurrency limit */ is_null_?: boolean | null; /** * Only include deployments with a concurrency limit less than or equal to this * value */ le_?: number | null; } /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ export interface FlowOrDeploymentName { /** * A case-insensitive partial match on deployment or flow names. For example, * passing 'example' might match deployments or flows with 'example' in their * names. */ like_?: string | null; } /** * Filter by `Deployment.name`. */ export interface Name { /** * A list of deployment names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Deployment.paused`. */ export interface Paused { /** * Only returns where deployment is/is not paused */ eq_?: boolean | null; } /** * Filter by `Deployment.tags`. */ export interface Tags { /** * A list of tags. Deployments will be returned only if their tags are a superset * of the list */ all_?: Array | null; /** * If true, only include deployments without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Deployment.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; } } /** * Filter flow runs. Only flow runs matching all criteria will be returned */ export interface FlowRuns { /** * Filter by `FlowRun.id`. */ id?: FlowRuns.ID | null; /** * Filter by `FlowRun.deployment_id`. */ deployment_id?: FlowRuns.DeploymentID | null; /** * Filter by `FlowRun.expected_start_time`. */ expected_start_time?: FlowRuns.ExpectedStartTime | null; /** * Filter by `FlowRun.flow_version`. */ flow_version?: FlowRuns.FlowVersion | null; /** * Filter by FlowRun.idempotency_key. */ idempotency_key?: FlowRuns.IdempotencyKey | null; /** * Filter by `FlowRun.name`. */ name?: FlowRuns.Name | null; /** * Filter by `FlowRun.next_scheduled_start_time`. */ next_scheduled_start_time?: FlowRuns.NextScheduledStartTime | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter for subflows of a given flow run */ parent_flow_run_id?: FlowRuns.ParentFlowRunID | null; /** * Filter by `FlowRun.parent_task_run_id`. */ parent_task_run_id?: FlowRuns.ParentTaskRunID | null; /** * Filter by `FlowRun.start_time`. */ start_time?: FlowRuns.StartTime | null; /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ state?: FlowRuns.State | null; /** * Filter by `FlowRun.tags`. */ tags?: FlowRuns.Tags | null; /** * Filter by `FlowRun.work_queue_name`. */ work_queue_name?: FlowRuns.WorkQueueName | null; } export namespace FlowRuns { /** * Filter by `FlowRun.id`. */ export interface ID { /** * A list of flow run ids to include */ any_?: Array | null; /** * A list of flow run ids to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.deployment_id`. */ export interface DeploymentID { /** * A list of flow run deployment ids to include */ any_?: Array | null; /** * If true, only include flow runs without deployment ids */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include flow runs scheduled to start at or after this time */ after_?: string | null; /** * Only include flow runs scheduled to start at or before this time */ before_?: string | null; } /** * Filter by `FlowRun.flow_version`. */ export interface FlowVersion { /** * A list of flow run flow_versions to include */ any_?: Array | null; } /** * Filter by FlowRun.idempotency_key. */ export interface IdempotencyKey { /** * A list of flow run idempotency keys to include */ any_?: Array | null; /** * A list of flow run idempotency keys to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.name`. */ export interface Name { /** * A list of flow run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `FlowRun.next_scheduled_start_time`. */ export interface NextScheduledStartTime { /** * Only include flow runs with a next_scheduled_start_time at or after this time */ after_?: string | null; /** * Only include flow runs with a next_scheduled_start_time or before this time */ before_?: string | null; } /** * Filter for subflows of a given flow run */ export interface ParentFlowRunID { /** * A list of parent flow run ids to include */ any_?: Array | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.parent_task_run_id`. */ export interface ParentTaskRunID { /** * A list of flow run parent_task_run_ids to include */ any_?: Array | null; /** * If true, only include flow runs without parent_task_run_id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.start_time`. */ export interface StartTime { /** * Only include flow runs starting at or after this time */ after_?: string | null; /** * Only include flow runs starting at or before this time */ before_?: string | null; /** * If true, only return flow runs without a start time */ is_null_?: boolean | null; } /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ export interface State { /** * Filter by `FlowRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `FlowRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `FlowRun.state_name`. */ export interface Name { /** * A list of flow run state names to include */ any_?: Array | null; /** * A list of flow run state names to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.state_type`. */ export interface Type { /** * A list of flow run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; /** * A list of flow run state types to exclude */ not_any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `FlowRun.tags`. */ export interface Tags { /** * A list of tags. Flow runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include flow runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; /** * If true, only include flow runs without work queue names */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter for flows. Only flows matching all criteria will be returned. */ export interface Flows { /** * Filter by `Flow.id`. */ id?: Flows.ID | null; /** * Filter by flows by deployment */ deployment?: Flows.Deployment | null; /** * Filter by `Flow.name`. */ name?: Flows.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Flow.tags`. */ tags?: Flows.Tags | null; } export namespace Flows { /** * Filter by `Flow.id`. */ export interface ID { /** * A list of flow ids to include */ any_?: Array | null; } /** * Filter by flows by deployment */ export interface Deployment { /** * If true, only include flows without deployments */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Flow.name`. */ export interface Name { /** * A list of flow names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Flow.tags`. */ export interface Tags { /** * A list of tags. Flows will be returned only if their tags are a superset of the * list */ all_?: Array | null; /** * If true, only include flows without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter task runs. Only task runs matching all criteria will be returned */ export interface TaskRuns { /** * Filter by `TaskRun.id`. */ id?: TaskRuns.ID | null; /** * Filter by `TaskRun.expected_start_time`. */ expected_start_time?: TaskRuns.ExpectedStartTime | null; /** * Filter by `TaskRun.flow_run_id`. */ flow_run_id?: TaskRuns.FlowRunID | null; /** * Filter by `TaskRun.name`. */ name?: TaskRuns.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.start_time`. */ start_time?: TaskRuns.StartTime | null; /** * Filter by `TaskRun.type` and `TaskRun.name`. */ state?: TaskRuns.State | null; /** * Filter by `TaskRun.subflow_run`. */ subflow_runs?: TaskRuns.SubflowRuns | null; /** * Filter by `TaskRun.tags`. */ tags?: TaskRuns.Tags | null; } export namespace TaskRuns { /** * Filter by `TaskRun.id`. */ export interface ID { /** * A list of task run ids to include */ any_?: Array | null; } /** * Filter by `TaskRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include task runs expected to start at or after this time */ after_?: string | null; /** * Only include task runs expected to start at or before this time */ before_?: string | null; } /** * Filter by `TaskRun.flow_run_id`. */ export interface FlowRunID { /** * A list of task run flow run ids to include */ any_?: Array | null; /** * Filter for task runs with None as their flow run id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `TaskRun.name`. */ export interface Name { /** * A list of task run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `TaskRun.start_time`. */ export interface StartTime { /** * Only include task runs starting at or after this time */ after_?: string | null; /** * Only include task runs starting at or before this time */ before_?: string | null; /** * If true, only return task runs without a start time */ is_null_?: boolean | null; } /** * Filter by `TaskRun.type` and `TaskRun.name`. */ export interface State { /** * Filter by `TaskRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `TaskRun.state_name`. */ export interface Name { /** * A list of task run state names to include */ any_?: Array | null; } /** * Filter by `TaskRun.state_type`. */ export interface Type { /** * A list of task run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `TaskRun.subflow_run`. */ export interface SubflowRuns { /** * If true, only include task runs that are subflow run parents; if false, exclude * parent task runs */ exists_?: boolean | null; } /** * Filter by `TaskRun.tags`. */ export interface Tags { /** * A list of tags. Task runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include task runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } } export interface TaskRunQueryParams { /** * Body param: Filter for deployments. Only deployments matching all criteria will * be returned. */ deployments?: TaskRunQueryParams.Deployments | null; /** * Body param: Filter flow runs. Only flow runs matching all criteria will be * returned */ flow_runs?: TaskRunQueryParams.FlowRuns | null; /** * Body param: Filter for flows. Only flows matching all criteria will be returned. */ flows?: TaskRunQueryParams.Flows | null; /** * Body param: Defaults to PREFECT_API_DEFAULT_LIMIT if not provided. */ limit?: number; /** * Body param: */ offset?: number; /** * Body param: Defines task run sorting options. */ sort?: | 'ID_DESC' | 'EXPECTED_START_TIME_ASC' | 'EXPECTED_START_TIME_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'NEXT_SCHEDULED_START_TIME_ASC' | 'END_TIME_DESC'; /** * Body param: Filter task runs. Only task runs matching all criteria will be * returned */ task_runs?: TaskRunQueryParams.TaskRuns | null; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace TaskRunQueryParams { /** * Filter for deployments. Only deployments matching all criteria will be returned. */ export interface Deployments { /** * Filter by `Deployment.id`. */ id?: Deployments.ID | null; /** * Filter by `Deployment.concurrency_limit`. */ concurrency_limit?: Deployments.ConcurrencyLimit | null; /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ flow_or_deployment_name?: Deployments.FlowOrDeploymentName | null; /** * Filter by `Deployment.name`. */ name?: Deployments.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Deployment.paused`. */ paused?: Deployments.Paused | null; /** * Filter by `Deployment.tags`. */ tags?: Deployments.Tags | null; /** * Filter by `Deployment.work_queue_name`. */ work_queue_name?: Deployments.WorkQueueName | null; } export namespace Deployments { /** * Filter by `Deployment.id`. */ export interface ID { /** * A list of deployment ids to include */ any_?: Array | null; } /** * Filter by `Deployment.concurrency_limit`. */ export interface ConcurrencyLimit { /** * Only include deployments with a concurrency limit greater than or equal to this * value */ ge_?: number | null; /** * If true, only include deployments without a concurrency limit */ is_null_?: boolean | null; /** * Only include deployments with a concurrency limit less than or equal to this * value */ le_?: number | null; } /** * Filter by `Deployment.name` or `Flow.name` with a single input string for ilike * filtering. */ export interface FlowOrDeploymentName { /** * A case-insensitive partial match on deployment or flow names. For example, * passing 'example' might match deployments or flows with 'example' in their * names. */ like_?: string | null; } /** * Filter by `Deployment.name`. */ export interface Name { /** * A list of deployment names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Deployment.paused`. */ export interface Paused { /** * Only returns where deployment is/is not paused */ eq_?: boolean | null; } /** * Filter by `Deployment.tags`. */ export interface Tags { /** * A list of tags. Deployments will be returned only if their tags are a superset * of the list */ all_?: Array | null; /** * If true, only include deployments without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Deployment.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; } } /** * Filter flow runs. Only flow runs matching all criteria will be returned */ export interface FlowRuns { /** * Filter by `FlowRun.id`. */ id?: FlowRuns.ID | null; /** * Filter by `FlowRun.deployment_id`. */ deployment_id?: FlowRuns.DeploymentID | null; /** * Filter by `FlowRun.expected_start_time`. */ expected_start_time?: FlowRuns.ExpectedStartTime | null; /** * Filter by `FlowRun.flow_version`. */ flow_version?: FlowRuns.FlowVersion | null; /** * Filter by FlowRun.idempotency_key. */ idempotency_key?: FlowRuns.IdempotencyKey | null; /** * Filter by `FlowRun.name`. */ name?: FlowRuns.Name | null; /** * Filter by `FlowRun.next_scheduled_start_time`. */ next_scheduled_start_time?: FlowRuns.NextScheduledStartTime | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter for subflows of a given flow run */ parent_flow_run_id?: FlowRuns.ParentFlowRunID | null; /** * Filter by `FlowRun.parent_task_run_id`. */ parent_task_run_id?: FlowRuns.ParentTaskRunID | null; /** * Filter by `FlowRun.start_time`. */ start_time?: FlowRuns.StartTime | null; /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ state?: FlowRuns.State | null; /** * Filter by `FlowRun.tags`. */ tags?: FlowRuns.Tags | null; /** * Filter by `FlowRun.work_queue_name`. */ work_queue_name?: FlowRuns.WorkQueueName | null; } export namespace FlowRuns { /** * Filter by `FlowRun.id`. */ export interface ID { /** * A list of flow run ids to include */ any_?: Array | null; /** * A list of flow run ids to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.deployment_id`. */ export interface DeploymentID { /** * A list of flow run deployment ids to include */ any_?: Array | null; /** * If true, only include flow runs without deployment ids */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include flow runs scheduled to start at or after this time */ after_?: string | null; /** * Only include flow runs scheduled to start at or before this time */ before_?: string | null; } /** * Filter by `FlowRun.flow_version`. */ export interface FlowVersion { /** * A list of flow run flow_versions to include */ any_?: Array | null; } /** * Filter by FlowRun.idempotency_key. */ export interface IdempotencyKey { /** * A list of flow run idempotency keys to include */ any_?: Array | null; /** * A list of flow run idempotency keys to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.name`. */ export interface Name { /** * A list of flow run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `FlowRun.next_scheduled_start_time`. */ export interface NextScheduledStartTime { /** * Only include flow runs with a next_scheduled_start_time at or after this time */ after_?: string | null; /** * Only include flow runs with a next_scheduled_start_time or before this time */ before_?: string | null; } /** * Filter for subflows of a given flow run */ export interface ParentFlowRunID { /** * A list of parent flow run ids to include */ any_?: Array | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.parent_task_run_id`. */ export interface ParentTaskRunID { /** * A list of flow run parent_task_run_ids to include */ any_?: Array | null; /** * If true, only include flow runs without parent_task_run_id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.start_time`. */ export interface StartTime { /** * Only include flow runs starting at or after this time */ after_?: string | null; /** * Only include flow runs starting at or before this time */ before_?: string | null; /** * If true, only return flow runs without a start time */ is_null_?: boolean | null; } /** * Filter by `FlowRun.state_type` and `FlowRun.state_name`. */ export interface State { /** * Filter by `FlowRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `FlowRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `FlowRun.state_name`. */ export interface Name { /** * A list of flow run state names to include */ any_?: Array | null; /** * A list of flow run state names to exclude */ not_any_?: Array | null; } /** * Filter by `FlowRun.state_type`. */ export interface Type { /** * A list of flow run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; /** * A list of flow run state types to exclude */ not_any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `FlowRun.tags`. */ export interface Tags { /** * A list of tags. Flow runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include flow runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `FlowRun.work_queue_name`. */ export interface WorkQueueName { /** * A list of work queue names to include */ any_?: Array | null; /** * If true, only include flow runs without work queue names */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter for flows. Only flows matching all criteria will be returned. */ export interface Flows { /** * Filter by `Flow.id`. */ id?: Flows.ID | null; /** * Filter by flows by deployment */ deployment?: Flows.Deployment | null; /** * Filter by `Flow.name`. */ name?: Flows.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `Flow.tags`. */ tags?: Flows.Tags | null; } export namespace Flows { /** * Filter by `Flow.id`. */ export interface ID { /** * A list of flow ids to include */ any_?: Array | null; } /** * Filter by flows by deployment */ export interface Deployment { /** * If true, only include flows without deployments */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `Flow.name`. */ export interface Name { /** * A list of flow names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `Flow.tags`. */ export interface Tags { /** * A list of tags. Flows will be returned only if their tags are a superset of the * list */ all_?: Array | null; /** * If true, only include flows without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } /** * Filter task runs. Only task runs matching all criteria will be returned */ export interface TaskRuns { /** * Filter by `TaskRun.id`. */ id?: TaskRuns.ID | null; /** * Filter by `TaskRun.expected_start_time`. */ expected_start_time?: TaskRuns.ExpectedStartTime | null; /** * Filter by `TaskRun.flow_run_id`. */ flow_run_id?: TaskRuns.FlowRunID | null; /** * Filter by `TaskRun.name`. */ name?: TaskRuns.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.start_time`. */ start_time?: TaskRuns.StartTime | null; /** * Filter by `TaskRun.type` and `TaskRun.name`. */ state?: TaskRuns.State | null; /** * Filter by `TaskRun.subflow_run`. */ subflow_runs?: TaskRuns.SubflowRuns | null; /** * Filter by `TaskRun.tags`. */ tags?: TaskRuns.Tags | null; } export namespace TaskRuns { /** * Filter by `TaskRun.id`. */ export interface ID { /** * A list of task run ids to include */ any_?: Array | null; } /** * Filter by `TaskRun.expected_start_time`. */ export interface ExpectedStartTime { /** * Only include task runs expected to start at or after this time */ after_?: string | null; /** * Only include task runs expected to start at or before this time */ before_?: string | null; } /** * Filter by `TaskRun.flow_run_id`. */ export interface FlowRunID { /** * A list of task run flow run ids to include */ any_?: Array | null; /** * Filter for task runs with None as their flow run id */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } /** * Filter by `TaskRun.name`. */ export interface Name { /** * A list of task run names to include */ any_?: Array | null; /** * A case-insensitive partial match. For example, passing 'marvin' will match * 'marvin', 'sad-Marvin', and 'marvin-robot'. */ like_?: string | null; } /** * Filter by `TaskRun.start_time`. */ export interface StartTime { /** * Only include task runs starting at or after this time */ after_?: string | null; /** * Only include task runs starting at or before this time */ before_?: string | null; /** * If true, only return task runs without a start time */ is_null_?: boolean | null; } /** * Filter by `TaskRun.type` and `TaskRun.name`. */ export interface State { /** * Filter by `TaskRun.state_name`. */ name?: State.Name | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; /** * Filter by `TaskRun.state_type`. */ type?: State.Type | null; } export namespace State { /** * Filter by `TaskRun.state_name`. */ export interface Name { /** * A list of task run state names to include */ any_?: Array | null; } /** * Filter by `TaskRun.state_type`. */ export interface Type { /** * A list of task run state types to include */ any_?: Array< | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING' > | null; } } /** * Filter by `TaskRun.subflow_run`. */ export interface SubflowRuns { /** * If true, only include task runs that are subflow run parents; if false, exclude * parent task runs */ exists_?: boolean | null; } /** * Filter by `TaskRun.tags`. */ export interface Tags { /** * A list of tags. Task runs will be returned only if their tags are a superset of * the list */ all_?: Array | null; /** * If true, only include task runs without tags */ is_null_?: boolean | null; /** * Operator for combining filter criteria. Defaults to 'and\_'. */ operator?: 'and_' | 'or_'; } } } export interface TaskRunSetStateParams { /** * Body param: The intended state. */ state: TaskRunSetStateParams.State; /** * Body param: If false, orchestration rules will be applied that may alter or * prevent the state transition. If True, orchestration rules are not applied. */ force?: boolean; /** * Header param: */ 'x-prefect-api-version'?: string; } export namespace TaskRunSetStateParams { /** * The intended state. */ export interface State { /** * The type of the state to create */ type: | 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING'; /** * The data of the state to create */ data?: unknown | null; /** * The message of the state to create */ message?: string | null; /** * The name of the state to create */ name?: string | null; /** * The details of the state to create */ state_details?: State.StateDetails; } export namespace State { /** * The details of the state to create */ export interface StateDetails { cache_expiration?: string | null; cache_key?: string | null; child_flow_run_id?: string | null; deferred?: boolean | null; flow_run_id?: string | null; pause_key?: string | null; pause_reschedule?: boolean; pause_timeout?: string | null; refresh_cache?: boolean | null; retriable?: boolean | null; run_input_keyset?: Record | null; scheduled_time?: string | null; task_parameters_id?: string | null; task_run_id?: string | null; transition_id?: string | null; untrackable_result?: boolean; } } } export namespace TaskRuns { export import TaskRun = TaskRunsAPI.TaskRun; export import TaskRunCountResponse = TaskRunsAPI.TaskRunCountResponse; export import TaskRunHistoryResponse = TaskRunsAPI.TaskRunHistoryResponse; export import TaskRunQueryResponse = TaskRunsAPI.TaskRunQueryResponse; export import TaskRunCreateParams = TaskRunsAPI.TaskRunCreateParams; export import TaskRunRetrieveParams = TaskRunsAPI.TaskRunRetrieveParams; export import TaskRunUpdateParams = TaskRunsAPI.TaskRunUpdateParams; export import TaskRunDeleteParams = TaskRunsAPI.TaskRunDeleteParams; export import TaskRunCountParams = TaskRunsAPI.TaskRunCountParams; export import TaskRunHistoryParams = TaskRunsAPI.TaskRunHistoryParams; export import TaskRunQueryParams = TaskRunsAPI.TaskRunQueryParams; export import TaskRunSetStateParams = TaskRunsAPI.TaskRunSetStateParams; }