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

import * as z from 'zod'

/**
 * ApiKeyItem
 */
export const zApiKeyItem = z.object({
  created_at: z.int().nullish(),
  id: z.string(),
  last_used_at: z.int().nullish(),
  token: z.string(),
  type: z.string(),
})

/**
 * ApiKeyList
 */
export const zApiKeyList = z.object({
  data: z.array(zApiKeyItem),
})

/**
 * BatchImportPayload
 */
export const zBatchImportPayload = z.object({
  upload_file_id: z.string(),
})

/**
 * ExternalDatasetCreatePayload
 */
export const zExternalDatasetCreatePayload = z.object({
  description: z.string().max(400).nullish(),
  external_knowledge_api_id: z.string(),
  external_knowledge_id: z.string(),
  external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
  name: z.string().min(1).max(100),
})

export const zDatasetDetail = z.record(z.string(), z.unknown())

/**
 * ExternalKnowledgeApiPayload
 */
export const zExternalKnowledgeApiPayload = z.object({
  name: z.string().min(1).max(40),
  settings: z.record(z.string(), z.unknown()),
})

/**
 * IndexingEstimatePayload
 */
export const zIndexingEstimatePayload = z.object({
  dataset_id: z.string().nullish(),
  doc_form: z.string().optional().default('text_model'),
  doc_language: z.string().optional().default('English'),
  indexing_technique: z.string(),
  info_list: z.record(z.string(), z.unknown()),
  process_rule: z.record(z.string(), z.unknown()),
})

/**
 * NotionEstimatePayload
 */
export const zNotionEstimatePayload = z.object({
  doc_form: z.string().optional().default('text_model'),
  doc_language: z.string().optional().default('English'),
  notion_info_list: z.array(z.record(z.string(), z.unknown())),
  process_rule: z.record(z.string(), z.unknown()),
})

/**
 * DocumentBatchDownloadZipPayload
 *
 * Request payload for bulk downloading documents as a zip archive.
 */
export const zDocumentBatchDownloadZipPayload = z.object({
  document_ids: z.array(z.uuid()).min(1).max(100),
})

/**
 * GenerateSummaryPayload
 */
export const zGenerateSummaryPayload = z.object({
  document_list: z.array(z.string()),
})

/**
 * DocumentMetadataUpdatePayload
 */
export const zDocumentMetadataUpdatePayload = z.object({
  doc_metadata: z.unknown().optional(),
  doc_type: z.string().nullish(),
})

/**
 * DocumentRenamePayload
 */
export const zDocumentRenamePayload = z.object({
  name: z.string(),
})

/**
 * SegmentCreatePayload
 */
export const zSegmentCreatePayload = z.object({
  answer: z.string().nullish(),
  attachment_ids: z.array(z.string()).nullish(),
  content: z.string(),
  keywords: z.array(z.string()).nullish(),
})

/**
 * SegmentUpdatePayload
 */
export const zSegmentUpdatePayload = z.object({
  answer: z.string().nullish(),
  attachment_ids: z.array(z.string()).nullish(),
  content: z.string(),
  keywords: z.array(z.string()).nullish(),
  regenerate_child_chunks: z.boolean().optional().default(false),
  summary: z.string().nullish(),
})

/**
 * ChildChunkCreatePayload
 */
export const zChildChunkCreatePayload = z.object({
  content: z.string(),
})

/**
 * ChildChunkUpdatePayload
 */
export const zChildChunkUpdatePayload = z.object({
  content: z.string(),
})

/**
 * ExternalHitTestingPayload
 */
export const zExternalHitTestingPayload = z.object({
  external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
  metadata_filtering_conditions: z.record(z.string(), z.unknown()).nullish(),
  query: z.string(),
})

/**
 * MetadataArgs
 */
export const zMetadataArgs = z.object({
  name: z.string(),
  type: z.enum(['string', 'number', 'time']),
})

/**
 * MetadataUpdatePayload
 */
export const zMetadataUpdatePayload = z.object({
  name: z.string(),
})

export const zDatasetQueryDetail = z.record(z.string(), z.unknown())

export const zRelatedAppList = z.record(z.string(), z.unknown())

/**
 * DocumentRetryPayload
 */
export const zDocumentRetryPayload = z.object({
  document_ids: z.array(z.string()),
})

/**
 * DatasetPermissionEnum
 */
export const zDatasetPermissionEnum = z.enum(['only_me', 'all_team_members', 'partial_members'])

/**
 * DatasetCreatePayload
 */
export const zDatasetCreatePayload = z.object({
  description: z.string().max(400).optional().default(''),
  external_knowledge_api_id: z.string().nullish(),
  external_knowledge_id: z.string().nullish(),
  indexing_technique: z.string().nullish(),
  name: z.string().min(1).max(40),
  permission: zDatasetPermissionEnum.optional(),
  provider: z.string().optional().default('vendor'),
})

/**
 * DatasetUpdatePayload
 */
export const zDatasetUpdatePayload = z.object({
  description: z.string().max(400).nullish(),
  embedding_model: z.string().nullish(),
  embedding_model_provider: z.string().nullish(),
  external_knowledge_api_id: z.string().nullish(),
  external_knowledge_id: z.string().nullish(),
  external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
  icon_info: z.record(z.string(), z.unknown()).nullish(),
  indexing_technique: z.string().nullish(),
  is_multimodal: z.boolean().nullish().default(false),
  name: z.string().min(1).max(40).nullish(),
  partial_member_list: z.array(z.record(z.string(), z.string())).nullish(),
  permission: zDatasetPermissionEnum.optional(),
  retrieval_model: z.record(z.string(), z.unknown()).nullish(),
  summary_index_setting: z.record(z.string(), z.unknown()).nullish(),
})

/**
 * DatasetResponse
 */
export const zDatasetResponse = z.object({
  created_at: z.int().nullish(),
  created_by: z.string().nullish(),
  data_source_type: z.string().nullish(),
  description: z.string().nullish(),
  id: z.string(),
  indexing_technique: z.string().nullish(),
  name: z.string(),
  permission: z.string().nullish(),
})

/**
 * DocumentMetadataResponse
 */
export const zDocumentMetadataResponse = z.object({
  id: z.string(),
  name: z.string(),
  type: z.string(),
  value: z.string().nullish(),
})

/**
 * DocumentResponse
 */
export const zDocumentResponse = z.object({
  archived: z.boolean().nullish(),
  created_at: z.int().nullish(),
  created_by: z.string().nullish(),
  created_from: z.string().nullish(),
  data_source_detail_dict: z.unknown().optional(),
  data_source_info_dict: z.unknown().optional(),
  data_source_type: z.string().nullish(),
  dataset_process_rule_id: z.string().nullish(),
  disabled_at: z.int().nullish(),
  disabled_by: z.string().nullish(),
  display_status: z.string().nullish(),
  doc_form: z.string().nullish(),
  doc_metadata_details: z.array(zDocumentMetadataResponse).optional(),
  enabled: z.boolean().nullish(),
  error: z.string().nullish(),
  hit_count: z.int().nullish(),
  id: z.string(),
  indexing_status: z.string().nullish(),
  name: z.string(),
  need_summary: z.boolean().nullish(),
  position: z.int().nullish(),
  summary_index_status: z.string().nullish(),
  tokens: z.int().nullish(),
  word_count: z.int().nullish(),
})

/**
 * DatasetAndDocumentResponse
 */
export const zDatasetAndDocumentResponse = z.object({
  batch: z.string(),
  dataset: zDatasetResponse,
  documents: z.array(zDocumentResponse),
})

/**
 * RerankingModel
 */
export const zRerankingModel = z.object({
  reranking_model_name: z.string().nullish(),
  reranking_provider_name: z.string().nullish(),
})

/**
 * RetrievalMethod
 */
export const zRetrievalMethod = z.enum([
  'semantic_search',
  'full_text_search',
  'hybrid_search',
  'keyword_search',
])

/**
 * MetadataDetail
 */
export const zMetadataDetail = z.object({
  id: z.string(),
  name: z.string(),
  value: z.unknown().optional(),
})

/**
 * DocumentMetadataOperation
 */
export const zDocumentMetadataOperation = z.object({
  document_id: z.string(),
  metadata_list: z.array(zMetadataDetail),
  partial_update: z.boolean().optional().default(false),
})

/**
 * MetadataOperationData
 *
 * Metadata operation data
 */
export const zMetadataOperationData = z.object({
  operation_data: z.array(zDocumentMetadataOperation),
})

/**
 * HitTestingChildChunk
 */
export const zHitTestingChildChunk = z.object({
  content: z.string().nullish(),
  id: z.string().nullish(),
  position: z.int().nullish(),
  score: z.number().nullish(),
})

/**
 * HitTestingFile
 */
export const zHitTestingFile = z.object({
  extension: z.string().nullish(),
  id: z.string().nullish(),
  mime_type: z.string().nullish(),
  name: z.string().nullish(),
  size: z.int().nullish(),
  source_url: z.string().nullish(),
})

/**
 * FileInfo
 */
export const zFileInfo = z.object({
  file_ids: z.array(z.string()),
})

/**
 * WebsiteInfo
 */
export const zWebsiteInfo = z.object({
  job_id: z.string(),
  only_main_content: z.boolean().optional().default(true),
  provider: z.string(),
  urls: z.array(z.string()),
})

/**
 * PreProcessingRule
 */
export const zPreProcessingRule = z.object({
  enabled: z.boolean(),
  id: z.string(),
})

/**
 * Segmentation
 */
export const zSegmentation = z.object({
  chunk_overlap: z.int().optional().default(0),
  max_tokens: z.int(),
  separator: z.string().optional().default('\n'),
})

/**
 * Rule
 */
export const zRule = z.object({
  parent_mode: z.enum(['full-doc', 'paragraph']).nullish(),
  pre_processing_rules: z.array(zPreProcessingRule).nullish(),
  segmentation: zSegmentation.optional(),
  subchunk_segmentation: zSegmentation.optional(),
})

/**
 * ProcessRule
 */
export const zProcessRule = z.object({
  mode: z.enum(['automatic', 'custom', 'hierarchical']),
  rules: zRule.optional(),
})

/**
 * Condition
 *
 * Condition detail
 */
export const zCondition = z.object({
  comparison_operator: z.enum([
    'contains',
    'not contains',
    'start with',
    'end with',
    'is',
    'is not',
    'empty',
    'not empty',
    'in',
    'not in',
    '=',
    '≠',
    '>',
    '<',
    '≥',
    '≤',
    'before',
    'after',
  ]),
  name: z.string(),
  value: z.unknown().optional(),
})

/**
 * MetadataFilteringCondition
 *
 * Metadata Filtering Condition.
 */
export const zMetadataFilteringCondition = z.object({
  conditions: z.array(zCondition).nullish(),
  logical_operator: z.enum(['and', 'or']).nullish().default('and'),
})

/**
 * WeightKeywordSetting
 */
export const zWeightKeywordSetting = z.object({
  keyword_weight: z.number(),
})

/**
 * WeightVectorSetting
 */
export const zWeightVectorSetting = z.object({
  embedding_model_name: z.string(),
  embedding_provider_name: z.string(),
  vector_weight: z.number(),
})

/**
 * WeightModel
 */
export const zWeightModel = z.object({
  keyword_setting: zWeightKeywordSetting.optional(),
  vector_setting: zWeightVectorSetting.optional(),
  weight_type: z.enum(['semantic_first', 'keyword_first', 'customized']).nullish(),
})

/**
 * RetrievalModel
 */
export const zRetrievalModel = z.object({
  metadata_filtering_conditions: zMetadataFilteringCondition.optional(),
  reranking_enable: z.boolean(),
  reranking_mode: z.string().nullish(),
  reranking_model: zRerankingModel.optional(),
  score_threshold: z.number().nullish(),
  score_threshold_enabled: z.boolean(),
  search_method: zRetrievalMethod,
  top_k: z.int(),
  weights: zWeightModel.optional(),
})

/**
 * HitTestingPayload
 */
export const zHitTestingPayload = z.object({
  attachment_ids: z.array(z.string()).nullish(),
  external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
  query: z.string().max(250),
  retrieval_model: zRetrievalModel.optional(),
})

/**
 * HitTestingDocument
 */
export const zHitTestingDocument = z.object({
  data_source_type: z.string().nullish(),
  doc_metadata: z.unknown().optional(),
  doc_type: z.string().nullish(),
  id: z.string().nullish(),
  name: z.string().nullish(),
})

/**
 * HitTestingSegment
 */
export const zHitTestingSegment = z.object({
  answer: z.string().nullish(),
  completed_at: z.int().nullish(),
  content: z.string().nullish(),
  created_at: z.int().nullish(),
  created_by: z.string().nullish(),
  disabled_at: z.int().nullish(),
  disabled_by: z.string().nullish(),
  document: zHitTestingDocument.optional(),
  document_id: z.string().nullish(),
  enabled: z.boolean().nullish(),
  error: z.string().nullish(),
  hit_count: z.int().nullish(),
  id: z.string().nullish(),
  index_node_hash: z.string().nullish(),
  index_node_id: z.string().nullish(),
  indexing_at: z.int().nullish(),
  keywords: z.array(z.string()).optional(),
  position: z.int().nullish(),
  sign_content: z.string().nullish(),
  status: z.string().nullish(),
  stopped_at: z.int().nullish(),
  tokens: z.int().nullish(),
  word_count: z.int().nullish(),
})

/**
 * HitTestingRecord
 */
export const zHitTestingRecord = z.object({
  child_chunks: z.array(zHitTestingChildChunk).optional(),
  files: z.array(zHitTestingFile).optional(),
  score: z.number().nullish(),
  segment: zHitTestingSegment.optional(),
  summary: z.string().nullish(),
  tsne_position: z.unknown().optional(),
})

/**
 * HitTestingResponse
 */
export const zHitTestingResponse = z.object({
  query: z.string(),
  records: z.array(zHitTestingRecord).optional(),
})

/**
 * NotionIcon
 */
export const zNotionIcon = z.object({
  emoji: z.string().nullish(),
  type: z.string(),
  url: z.string().nullish(),
})

/**
 * NotionPage
 */
export const zNotionPage = z.object({
  page_icon: zNotionIcon.optional(),
  page_id: z.string(),
  page_name: z.string(),
  type: z.string(),
})

/**
 * NotionInfo
 */
export const zNotionInfo = z.object({
  credential_id: z.string(),
  pages: z.array(zNotionPage),
  workspace_id: z.string(),
})

/**
 * InfoList
 */
export const zInfoList = z.object({
  data_source_type: z.enum(['upload_file', 'notion_import', 'website_crawl']),
  file_info_list: zFileInfo.optional(),
  notion_info_list: z.array(zNotionInfo).nullish(),
  website_info_list: zWebsiteInfo.optional(),
})

/**
 * DataSource
 */
export const zDataSource = z.object({
  info_list: zInfoList,
})

/**
 * KnowledgeConfig
 */
export const zKnowledgeConfig = z.object({
  data_source: zDataSource.optional(),
  doc_form: z.string().optional().default('text_model'),
  doc_language: z.string().optional().default('English'),
  duplicate: z.boolean().optional().default(true),
  embedding_model: z.string().nullish(),
  embedding_model_provider: z.string().nullish(),
  indexing_technique: z.enum(['high_quality', 'economy']),
  is_multimodal: z.boolean().optional().default(false),
  name: z.string().nullish(),
  original_document_id: z.string().nullish(),
  process_rule: zProcessRule.optional(),
  retrieval_model: zRetrievalModel.optional(),
  summary_index_setting: z.record(z.string(), z.unknown()).nullish(),
})

export const zGetDatasetsQuery = z.object({
  page: z.string().optional(),
  limit: z.string().optional(),
  ids: z.string().optional(),
  keyword: z.string().optional(),
  tag_ids: z.string().optional(),
  include_all: z.string().optional(),
})

/**
 * Datasets retrieved successfully
 */
export const zGetDatasetsResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsBody = zDatasetCreatePayload

/**
 * Dataset created successfully
 */
export const zPostDatasetsResponse = z.record(z.string(), z.unknown())

/**
 * API base info retrieved successfully
 */
export const zGetDatasetsApiBaseInfoResponse = z.record(z.string(), z.unknown())

/**
 * API keys retrieved successfully
 */
export const zGetDatasetsApiKeysResponse = zApiKeyList

/**
 * API key created successfully
 */
export const zPostDatasetsApiKeysResponse = zApiKeyItem

export const zDeleteDatasetsApiKeysByApiKeyIdPath = z.object({
  api_key_id: z.string(),
})

/**
 * API key deleted successfully
 */
export const zDeleteDatasetsApiKeysByApiKeyIdResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsBatchImportStatusByJobIdPath = z.object({
  job_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsBatchImportStatusByJobIdResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsBatchImportStatusByJobIdBody = zBatchImportPayload

export const zPostDatasetsBatchImportStatusByJobIdPath = z.object({
  job_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsBatchImportStatusByJobIdResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsExternalBody = zExternalDatasetCreatePayload

/**
 * External dataset created successfully
 */
export const zPostDatasetsExternalResponse = zDatasetDetail

export const zGetDatasetsExternalKnowledgeApiQuery = z.object({
  page: z.string().optional(),
  limit: z.string().optional(),
  keyword: z.string().optional(),
})

/**
 * External API templates retrieved successfully
 */
export const zGetDatasetsExternalKnowledgeApiResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsExternalKnowledgeApiBody = zExternalKnowledgeApiPayload

/**
 * Success
 */
export const zPostDatasetsExternalKnowledgeApiResponse = z.record(z.string(), z.unknown())

export const zDeleteDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z.object({
  external_knowledge_api_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z.object({
  external_knowledge_api_id: z.string(),
})

/**
 * External API template retrieved successfully
 */
export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdBody
  = zExternalKnowledgeApiPayload

export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdPath = z.object({
  external_knowledge_api_id: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdUseCheckPath = z.object({
  external_knowledge_api_id: z.string(),
})

/**
 * Usage check completed successfully
 */
export const zGetDatasetsExternalKnowledgeApiByExternalKnowledgeApiIdUseCheckResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostDatasetsIndexingEstimateBody = zIndexingEstimatePayload

/**
 * Indexing estimate calculated successfully
 */
export const zPostDatasetsIndexingEstimateResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsInitBody = zKnowledgeConfig

/**
 * Dataset initialized successfully
 */
export const zPostDatasetsInitResponse = zDatasetAndDocumentResponse

/**
 * Success
 */
export const zGetDatasetsMetadataBuiltInResponse = z.record(z.string(), z.unknown())

/**
 * Success
 */
export const zGetDatasetsNotionIndexingEstimateResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsNotionIndexingEstimateBody = zNotionEstimatePayload

/**
 * Success
 */
export const zPostDatasetsNotionIndexingEstimateResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsProcessRuleQuery = z.object({
  document_id: z.string().optional(),
})

/**
 * Process rules retrieved successfully
 */
export const zGetDatasetsProcessRuleResponse = z.record(z.string(), z.unknown())

/**
 * Retrieval settings retrieved successfully
 */
export const zGetDatasetsRetrievalSettingResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsRetrievalSettingByVectorTypePath = z.object({
  vector_type: z.string(),
})

/**
 * Mock retrieval settings retrieved successfully
 */
export const zGetDatasetsRetrievalSettingByVectorTypeResponse = z.record(z.string(), z.unknown())

export const zDeleteDatasetsByDatasetIdPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdPath = z.object({
  dataset_id: z.string(),
})

/**
 * Dataset retrieved successfully
 */
export const zGetDatasetsByDatasetIdResponse = zDatasetDetail

export const zPatchDatasetsByDatasetIdBody = zDatasetUpdatePayload

export const zPatchDatasetsByDatasetIdPath = z.object({
  dataset_id: z.string(),
})

/**
 * Dataset updated successfully
 */
export const zPatchDatasetsByDatasetIdResponse = zDatasetDetail

export const zPostDatasetsByDatasetIdApiKeysByStatusPath = z.object({
  dataset_id: z.string(),
  status: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdApiKeysByStatusResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdAutoDisableLogsPath = z.object({
  dataset_id: z.string(),
})

/**
 * Auto disable logs retrieved successfully
 */
export const zGetDatasetsByDatasetIdAutoDisableLogsResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimatePath = z.object({
  dataset_id: z.string(),
  batch: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdBatchByBatchIndexingStatusPath = z.object({
  dataset_id: z.string(),
  batch: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdBatchByBatchIndexingStatusResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteDatasetsByDatasetIdDocumentsPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdDocumentsResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdDocumentsPath = z.object({
  dataset_id: z.string(),
})

export const zGetDatasetsByDatasetIdDocumentsQuery = z.object({
  page: z.string().optional(),
  limit: z.string().optional(),
  keyword: z.string().optional(),
  sort: z.string().optional(),
  fetch: z.string().optional(),
  status: z.string().optional(),
})

/**
 * Documents retrieved successfully
 */
export const zGetDatasetsByDatasetIdDocumentsResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdDocumentsBody = zKnowledgeConfig

export const zPostDatasetsByDatasetIdDocumentsPath = z.object({
  dataset_id: z.string(),
})

/**
 * Documents created successfully
 */
export const zPostDatasetsByDatasetIdDocumentsResponse = zDatasetAndDocumentResponse

export const zPostDatasetsByDatasetIdDocumentsDownloadZipBody = zDocumentBatchDownloadZipPayload

export const zPostDatasetsByDatasetIdDocumentsDownloadZipPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdDocumentsDownloadZipResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostDatasetsByDatasetIdDocumentsGenerateSummaryBody = zGenerateSummaryPayload

export const zPostDatasetsByDatasetIdDocumentsGenerateSummaryPath = z.object({
  dataset_id: z.string(),
})

/**
 * Summary generation started successfully
 */
export const zPostDatasetsByDatasetIdDocumentsGenerateSummaryResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostDatasetsByDatasetIdDocumentsMetadataBody = zMetadataOperationData

export const zPostDatasetsByDatasetIdDocumentsMetadataPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdDocumentsMetadataResponse = z.record(z.string(), z.unknown())

export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBatchPath = z.object({
  dataset_id: z.string(),
  action: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBatchResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
  document_id: z.string(),
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdQuery = z.object({
  metadata: z.string().optional(),
})

/**
 * Document retrieved successfully
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdDownloadResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimatePath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Indexing estimate calculated successfully
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingEstimateResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Indexing status retrieved successfully
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdIndexingStatusResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPutDatasetsByDatasetIdDocumentsByDocumentIdMetadataBody
  = zDocumentMetadataUpdatePayload

export const zPutDatasetsByDatasetIdDocumentsByDocumentIdMetadataPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Document metadata updated successfully
 */
export const zPutDatasetsByDatasetIdDocumentsByDocumentIdMetadataResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdNotionSyncPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdNotionSyncResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdPipelineExecutionLogResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingPausePath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingPauseResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingResumePath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingResumeResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
  action: z.string(),
})

/**
 * Processing status updated successfully
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdRenameBody = zDocumentRenamePayload

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdRenamePath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Document renamed successfully
 */
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdRenameResponse = zDocumentResponse

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentBody = zSegmentCreatePayload

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentByActionPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
  action: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentByActionResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportBody
  = zBatchImportPayload

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBatchImportResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
  segment_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdBody
  = zSegmentUpdatePayload

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
  segment_id: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath
  = z.object({
    dataset_id: z.string(),
    document_id: z.string(),
    segment_id: z.string(),
  })

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse
  = z.record(z.string(), z.unknown())

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath
  = z.object({
    dataset_id: z.string(),
    document_id: z.string(),
    segment_id: z.string(),
  })

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse
  = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksBody
  = zChildChunkCreatePayload

export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksPath
  = z.object({
    dataset_id: z.string(),
    document_id: z.string(),
    segment_id: z.string(),
  })

/**
 * Success
 */
export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksResponse
  = z.record(z.string(), z.unknown())

export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
  = z.object({
    dataset_id: z.string(),
    document_id: z.string(),
    segment_id: z.string(),
    child_chunk_id: z.string(),
  })

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse
  = z.record(z.string(), z.unknown())

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdBody
  = zChildChunkUpdatePayload

export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
  = z.object({
    dataset_id: z.string(),
    document_id: z.string(),
    segment_id: z.string(),
    child_chunk_id: z.string(),
  })

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdResponse
  = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Summary status retrieved successfully
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSummaryStatusResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdDocumentsByDocumentIdWebsiteSyncPath = z.object({
  dataset_id: z.string(),
  document_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdWebsiteSyncResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdErrorDocsPath = z.object({
  dataset_id: z.string(),
})

/**
 * Error documents retrieved successfully
 */
export const zGetDatasetsByDatasetIdErrorDocsResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdExternalHitTestingBody = zExternalHitTestingPayload

export const zPostDatasetsByDatasetIdExternalHitTestingPath = z.object({
  dataset_id: z.string(),
})

/**
 * External hit testing completed successfully
 */
export const zPostDatasetsByDatasetIdExternalHitTestingResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdHitTestingBody = zHitTestingPayload

export const zPostDatasetsByDatasetIdHitTestingPath = z.object({
  dataset_id: z.string(),
})

/**
 * Hit testing completed successfully
 */
export const zPostDatasetsByDatasetIdHitTestingResponse = zHitTestingResponse

export const zGetDatasetsByDatasetIdIndexingStatusPath = z.object({
  dataset_id: z.string(),
})

/**
 * Indexing status retrieved successfully
 */
export const zGetDatasetsByDatasetIdIndexingStatusResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdMetadataPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdMetadataResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdMetadataBody = zMetadataArgs

export const zPostDatasetsByDatasetIdMetadataPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdMetadataResponse = z.record(z.string(), z.unknown())

export const zPostDatasetsByDatasetIdMetadataBuiltInByActionPath = z.object({
  dataset_id: z.string(),
  action: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdMetadataBuiltInByActionResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdPath = z.object({
  dataset_id: z.string(),
  metadata_id: z.string(),
})

/**
 * Success
 */
export const zDeleteDatasetsByDatasetIdMetadataByMetadataIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchDatasetsByDatasetIdMetadataByMetadataIdBody = zMetadataUpdatePayload

export const zPatchDatasetsByDatasetIdMetadataByMetadataIdPath = z.object({
  dataset_id: z.string(),
  metadata_id: z.string(),
})

/**
 * Success
 */
export const zPatchDatasetsByDatasetIdMetadataByMetadataIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetDatasetsByDatasetIdNotionSyncPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zGetDatasetsByDatasetIdNotionSyncResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdPermissionPartUsersPath = z.object({
  dataset_id: z.string(),
})

/**
 * Permission users retrieved successfully
 */
export const zGetDatasetsByDatasetIdPermissionPartUsersResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdQueriesPath = z.object({
  dataset_id: z.string(),
})

/**
 * Query history retrieved successfully
 */
export const zGetDatasetsByDatasetIdQueriesResponse = zDatasetQueryDetail

export const zGetDatasetsByDatasetIdRelatedAppsPath = z.object({
  dataset_id: z.string(),
})

/**
 * Related apps retrieved successfully
 */
export const zGetDatasetsByDatasetIdRelatedAppsResponse = zRelatedAppList

export const zPostDatasetsByDatasetIdRetryBody = zDocumentRetryPayload

export const zPostDatasetsByDatasetIdRetryPath = z.object({
  dataset_id: z.string(),
})

/**
 * Success
 */
export const zPostDatasetsByDatasetIdRetryResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByDatasetIdUseCheckPath = z.object({
  dataset_id: z.string(),
})

/**
 * Dataset use status retrieved successfully
 */
export const zGetDatasetsByDatasetIdUseCheckResponse = z.record(z.string(), z.unknown())

export const zGetDatasetsByResourceIdApiKeysPath = z.object({
  resource_id: z.string(),
})

/**
 * API keys retrieved successfully
 */
export const zGetDatasetsByResourceIdApiKeysResponse = zApiKeyList

export const zPostDatasetsByResourceIdApiKeysPath = z.object({
  resource_id: z.string(),
})

/**
 * API key created successfully
 */
export const zPostDatasetsByResourceIdApiKeysResponse = zApiKeyItem

export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdPath = z.object({
  resource_id: z.string(),
  api_key_id: z.string(),
})

/**
 * API key deleted successfully
 */
export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdResponse = z.record(
  z.string(),
  z.unknown(),
)
