// This file is auto-generated by @hey-api/openapi-ts

import { oc } from '@orpc/contract'
import * as z from 'zod'

import {
  zGetWorkflowByWorkflowRunIdEventsPath,
  zGetWorkflowByWorkflowRunIdEventsResponse,
  zGetWorkflowByWorkflowRunIdPauseDetailsPath,
  zGetWorkflowByWorkflowRunIdPauseDetailsResponse,
} from './zod.gen'

/**
 * Get workflow execution events stream after resume
 *
 * GET /console/api/workflow/<workflow_run_id>/events
 *
 * Returns Server-Sent Events stream.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get = oc
  .route({
    deprecated: true,
    description:
      'GET /console/api/workflow/<workflow_run_id>/events\n\nReturns Server-Sent Events stream.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getWorkflowByWorkflowRunIdEvents',
    path: '/workflow/{workflow_run_id}/events',
    summary: 'Get workflow execution events stream after resume',
    tags: ['console'],
  })
  .input(z.object({ params: zGetWorkflowByWorkflowRunIdEventsPath }))
  .output(zGetWorkflowByWorkflowRunIdEventsResponse)

export const events = {
  get,
}

/**
 * Get workflow pause details
 *
 * Get workflow pause details
 * GET /console/api/workflow/<workflow_run_id>/pause-details
 *
 * Returns information about why and where the workflow is paused.
 */
export const get2 = oc
  .route({
    description:
      'Get workflow pause details\nGET /console/api/workflow/<workflow_run_id>/pause-details\n\nReturns information about why and where the workflow is paused.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getWorkflowByWorkflowRunIdPauseDetails',
    path: '/workflow/{workflow_run_id}/pause-details',
    summary: 'Get workflow pause details',
    tags: ['console'],
  })
  .input(z.object({ params: zGetWorkflowByWorkflowRunIdPauseDetailsPath }))
  .output(zGetWorkflowByWorkflowRunIdPauseDetailsResponse)

export const pauseDetails = {
  get: get2,
}

export const byWorkflowRunId = {
  events,
  pauseDetails,
}

export const workflow = {
  byWorkflowRunId,
}

export const contract = {
  workflow,
}
