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

import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
  zDeleteApiBasedExtensionByIdPath,
  zDeleteApiBasedExtensionByIdResponse,
  zGetApiBasedExtensionByIdPath,
  zGetApiBasedExtensionByIdResponse,
  zGetApiBasedExtensionResponse,
  zPostApiBasedExtensionBody,
  zPostApiBasedExtensionByIdBody,
  zPostApiBasedExtensionByIdPath,
  zPostApiBasedExtensionByIdResponse,
  zPostApiBasedExtensionResponse,
} from './zod.gen'

/**
 * Delete API-based extension
 */
export const delete_ = oc
  .route({
    description: 'Delete API-based extension',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteApiBasedExtensionById',
    path: '/api-based-extension/{id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteApiBasedExtensionByIdPath }))
  .output(zDeleteApiBasedExtensionByIdResponse)

/**
 * Get API-based extension by ID
 */
export const get = oc
  .route({
    description: 'Get API-based extension by ID',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getApiBasedExtensionById',
    path: '/api-based-extension/{id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetApiBasedExtensionByIdPath }))
  .output(zGetApiBasedExtensionByIdResponse)

/**
 * Update API-based extension
 */
export const post = oc
  .route({
    description: 'Update API-based extension',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postApiBasedExtensionById',
    path: '/api-based-extension/{id}',
    tags: ['console'],
  })
  .input(z.object({ body: zPostApiBasedExtensionByIdBody, params: zPostApiBasedExtensionByIdPath }))
  .output(zPostApiBasedExtensionByIdResponse)

export const byId = {
  delete: delete_,
  get,
  post,
}

/**
 * Get all API-based extensions for current tenant
 */
export const get2 = oc
  .route({
    description: 'Get all API-based extensions for current tenant',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getApiBasedExtension',
    path: '/api-based-extension',
    tags: ['console'],
  })
  .output(zGetApiBasedExtensionResponse)

/**
 * Create a new API-based extension
 */
export const post2 = oc
  .route({
    description: 'Create a new API-based extension',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postApiBasedExtension',
    path: '/api-based-extension',
    successStatus: 201,
    tags: ['console'],
  })
  .input(z.object({ body: zPostApiBasedExtensionBody }))
  .output(zPostApiBasedExtensionResponse)

export const apiBasedExtension = {
  get: get2,
  post: post2,
  byId,
}

export const contract = {
  apiBasedExtension,
}
