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

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

import {
  zDeleteAgentsByAgentIdPath,
  zDeleteAgentsByAgentIdResponse,
  zGetAgentsByAgentIdPath,
  zGetAgentsByAgentIdResponse,
  zGetAgentsByAgentIdVersionsByVersionIdPath,
  zGetAgentsByAgentIdVersionsByVersionIdResponse,
  zGetAgentsByAgentIdVersionsPath,
  zGetAgentsByAgentIdVersionsResponse,
  zGetAgentsInviteOptionsQuery,
  zGetAgentsInviteOptionsResponse,
  zGetAgentsQuery,
  zGetAgentsResponse,
  zPatchAgentsByAgentIdBody,
  zPatchAgentsByAgentIdPath,
  zPatchAgentsByAgentIdResponse,
  zPostAgentsBody,
  zPostAgentsResponse,
} from './zod.gen'

export const get = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAgentsInviteOptions',
    path: '/agents/invite-options',
    tags: ['console'],
  })
  .input(z.object({ query: zGetAgentsInviteOptionsQuery.optional() }))
  .output(zGetAgentsInviteOptionsResponse)

export const inviteOptions = {
  get,
}

/**
 * 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 get2 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getAgentsByAgentIdVersionsByVersionId',
    path: '/agents/{agent_id}/versions/{version_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAgentsByAgentIdVersionsByVersionIdPath }))
  .output(zGetAgentsByAgentIdVersionsByVersionIdResponse)

export const byVersionId = {
  get: get2,
}

export const get3 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAgentsByAgentIdVersions',
    path: '/agents/{agent_id}/versions',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAgentsByAgentIdVersionsPath }))
  .output(zGetAgentsByAgentIdVersionsResponse)

export const versions = {
  get: get3,
  byVersionId,
}

export const delete_ = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAgentsByAgentId',
    path: '/agents/{agent_id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAgentsByAgentIdPath }))
  .output(zDeleteAgentsByAgentIdResponse)

export const get4 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAgentsByAgentId',
    path: '/agents/{agent_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAgentsByAgentIdPath }))
  .output(zGetAgentsByAgentIdResponse)

export const patch = oc
  .route({
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchAgentsByAgentId',
    path: '/agents/{agent_id}',
    tags: ['console'],
  })
  .input(z.object({ body: zPatchAgentsByAgentIdBody, params: zPatchAgentsByAgentIdPath }))
  .output(zPatchAgentsByAgentIdResponse)

export const byAgentId = {
  delete: delete_,
  get: get4,
  patch,
  versions,
}

export const get5 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAgents',
    path: '/agents',
    tags: ['console'],
  })
  .input(z.object({ query: zGetAgentsQuery.optional() }))
  .output(zGetAgentsResponse)

/**
 * 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 post = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAgents',
    path: '/agents',
    successStatus: 201,
    tags: ['console'],
  })
  .input(z.object({ body: zPostAgentsBody }))
  .output(zPostAgentsResponse)

export const agents = {
  get: get5,
  post,
  inviteOptions,
  byAgentId,
}

export const contract = {
  agents,
}
