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

import * as z from 'zod'

/**
 * DatasourceCredentialsResponse
 */
export const zDatasourceCredentialsResponse = z.object({
  result: z.unknown(),
})

/**
 * DatasourceCredentialPayload
 */
export const zDatasourceCredentialPayload = z.object({
  credentials: z.record(z.string(), z.unknown()),
  name: z.string().max(100).nullish(),
})

/**
 * SimpleResultResponse
 */
export const zSimpleResultResponse = z.object({
  result: z.string(),
})

/**
 * DatasourceCustomClientPayload
 */
export const zDatasourceCustomClientPayload = z.object({
  client_params: z.record(z.string(), z.unknown()).nullish(),
  enable_oauth_custom_client: z.boolean().nullish(),
})

/**
 * DatasourceDefaultPayload
 */
export const zDatasourceDefaultPayload = z.object({
  id: z.string(),
})

/**
 * DatasourceCredentialDeletePayload
 */
export const zDatasourceCredentialDeletePayload = z.object({
  credential_id: z.string(),
})

/**
 * DatasourceCredentialUpdatePayload
 */
export const zDatasourceCredentialUpdatePayload = z.object({
  credential_id: z.string(),
  credentials: z.record(z.string(), z.unknown()).nullish(),
  name: z.string().max(100).nullish(),
})

/**
 * DatasourceUpdateNamePayload
 */
export const zDatasourceUpdateNamePayload = z.object({
  credential_id: z.string(),
  name: z.string().max(100),
})

/**
 * Success
 */
export const zGetAuthPluginDatasourceDefaultListResponse = zDatasourceCredentialsResponse

/**
 * Success
 */
export const zGetAuthPluginDatasourceListResponse = zDatasourceCredentialsResponse

export const zGetAuthPluginDatasourceByProviderIdPath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zGetAuthPluginDatasourceByProviderIdResponse = zDatasourceCredentialsResponse

export const zPostAuthPluginDatasourceByProviderIdBody = zDatasourceCredentialPayload

export const zPostAuthPluginDatasourceByProviderIdPath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdResponse = zSimpleResultResponse

export const zDeleteAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse = zSimpleResultResponse

export const zPostAuthPluginDatasourceByProviderIdCustomClientBody = zDatasourceCustomClientPayload

export const zPostAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdCustomClientResponse = zSimpleResultResponse

export const zPostAuthPluginDatasourceByProviderIdDefaultBody = zDatasourceDefaultPayload

export const zPostAuthPluginDatasourceByProviderIdDefaultPath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdDefaultResponse = zSimpleResultResponse

export const zPostAuthPluginDatasourceByProviderIdDeleteBody = zDatasourceCredentialDeletePayload

export const zPostAuthPluginDatasourceByProviderIdDeletePath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdDeleteResponse = zSimpleResultResponse

export const zPostAuthPluginDatasourceByProviderIdUpdateBody = zDatasourceCredentialUpdatePayload

export const zPostAuthPluginDatasourceByProviderIdUpdatePath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdUpdateResponse = zSimpleResultResponse

export const zPostAuthPluginDatasourceByProviderIdUpdateNameBody = zDatasourceUpdateNamePayload

export const zPostAuthPluginDatasourceByProviderIdUpdateNamePath = z.object({
  provider_id: z.string(),
})

/**
 * Success
 */
export const zPostAuthPluginDatasourceByProviderIdUpdateNameResponse = zSimpleResultResponse
