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

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

import {
  zGetBillingInvoicesResponse,
  zGetBillingSubscriptionResponse,
  zPutBillingPartnersByPartnerKeyTenantsBody,
  zPutBillingPartnersByPartnerKeyTenantsPath,
  zPutBillingPartnersByPartnerKeyTenantsResponse,
} from './zod.gen'

/**
 * 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:
      '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: 'getBillingInvoices',
    path: '/billing/invoices',
    tags: ['console'],
  })
  .output(zGetBillingInvoicesResponse)

export const invoices = {
  get,
}

/**
 * Sync partner tenants bindings
 *
 * 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 put = oc
  .route({
    deprecated: true,
    description:
      'Sync partner tenants bindings\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: 'PUT',
    operationId: 'putBillingPartnersByPartnerKeyTenants',
    path: '/billing/partners/{partner_key}/tenants',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPutBillingPartnersByPartnerKeyTenantsBody,
      params: zPutBillingPartnersByPartnerKeyTenantsPath,
    }),
  )
  .output(zPutBillingPartnersByPartnerKeyTenantsResponse)

export const tenants = {
  put,
}

export const byPartnerKey = {
  tenants,
}

export const partners = {
  byPartnerKey,
}

/**
 * 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: 'getBillingSubscription',
    path: '/billing/subscription',
    tags: ['console'],
  })
  .output(zGetBillingSubscriptionResponse)

export const subscription = {
  get: get2,
}

export const billing = {
  invoices,
  partners,
  subscription,
}

export const contract = {
  billing,
}
