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

export type ClientOptions = {
  baseUrl: `${string}://${string}` | (string & {})
}

export type KnowledgeSpaceCreationResponse = {
  createdAt: string
  description?: string
  iconRef?: string
  id: string
  name: string
  revision: number
  slug: string
  tenantId: string
  updatedAt: string
  configurationStatus: 'pending-validation' | 'ready' | 'setup-required' | 'validation-failed'
}

export type ErrorResponse = {
  code?: string
  error: string
}

export type CreateKnowledgeSpace = {
  description?: string
  embeddingProfile?: {
    model: string
    pluginId: string
    provider: string
  }
  iconRef?: string
  idempotencyKey?: string
  name: string
  retrievalProfile?: {
    defaultMode: 'fast' | 'research' | 'deep'
    reasoningModel: {
      model: string
      pluginId: string
      provider: string
    }
    rerank: {
      enabled: boolean
      model?: {
        model: string
        pluginId: string
        provider: string
      }
    }
    scoreThreshold: {
      enabled: boolean
      stage: 'mode-final' | 'rerank'
      value?: number
    }
    topK: number
  }
  slug?: string
}

export type KnowledgeSpace = {
  createdAt: string
  description?: string
  iconRef?: string
  id: string
  name: string
  revision: number
  slug: string
  tenantId: string
  updatedAt: string
}

export type KnowledgeSpaceList = {
  items: Array<KnowledgeSpace>
  nextCursor?: string
}

export type KnowledgeSpaceStats = {
  cache: {
    available: boolean
    entries: number
    totalBytes: number
  }
  commits: {
    failedRetryable: number
    failedTerminal: number
    sampled: number
    truncated: boolean
  }
  generatedAt: string
  knowledgeSpaceId: string
  metrics: {
    available: boolean
    reason?: string
  }
  projections: {
    denseVector: {
      building: number
      failed: number
      ready: number
      stale: number
      total: number
    }
    fts: {
      building: number
      failed: number
      ready: number
      stale: number
      total: number
    }
    graph: {
      building: number
      failed: number
      ready: number
      stale: number
      total: number
    }
    metadata: {
      building: number
      failed: number
      ready: number
      stale: number
      total: number
    }
    projectionVersion: number
  }
  runtime: {
    activeLeaseSampleCount: number
    activeSessionSampleCount: number
    truncated: boolean
  }
  storage: {
    documentCount: number
    rawDocumentBytes: number
  }
  tenantId: string
  window: {
    end: string
    minutes: number
    start: string
  }
}

export type DurableDeletionJob = {
  checkpoint:
    | 'requested'
    | 'quiescing'
    | 'deleting_objects'
    | 'deleting_derived_data'
    | 'deleting_primary_data'
    | 'completed'
  completedAt?: string
  createdAt: string
  error?: {
    code: string
    message: string
    retryable: boolean
  }
  id: string
  knowledgeSpaceId: string
  mode?: 'cascade' | 'keep'
  progress?: {
    completedItems: number
    currentItemKind?: string
    totalItems?: number
  }
  retryAt?: string
  runState:
    | 'dispatch_pending'
    | 'queued'
    | 'running'
    | 'retry_wait'
    | 'completed'
    | 'failed'
    | 'canceled'
  targetId: string
  targetType: 'knowledge_space' | 'source' | 'document' | 'logical_document'
  updatedAt: string
}

export type DurableDeletionAccepted = {
  job: DurableDeletionJob
  statusUrl: string
}

export type DurableBulkDeletionAccepted = {
  items: Array<{
    documentId: string
    job: DurableDeletionJob
    statusUrl: string
  }>
  total: number
}

export type DocumentAsset = {
  createdAt: string
  filename: string
  id: string
  knowledgeSpaceId: string
  metadata?: {
    [key: string]: unknown
  }
  mimeType: string
  objectKey: string
  parserStatus: 'pending' | 'parsed' | 'failed'
  sha256: string
  sizeBytes: number
  sourceId?: string
  updatedAt?: string
  version: number
}

export type DocumentAssetList = {
  items: Array<DocumentAsset>
  nextCursor?: string
}

export type DocumentOutlineNode = {
  childNodeIds?: Array<string>
  children?: Array<{
    [key: string]: unknown
  }>
  endOffset?: number
  endPage?: number
  id: string
  level: number
  metadata: {
    [key: string]: unknown
  }
  sectionPath?: Array<string>
  sourceElementIds?: Array<string>
  sourceNodeIds?: Array<string>
  startOffset?: number
  startPage?: number
  summary?: string
  title: string
  titleLocation?: {
    [key: string]: unknown
  }
  tocSource: string
}

export type DocumentOutline = {
  artifactHash: string
  createdAt: string
  documentAssetId: string
  id: string
  knowledgeSpaceId: string
  metadata: {
    [key: string]: unknown
  }
  nodes: Array<DocumentOutlineNode>
  outlineVersion: string
  parseArtifactId: string
  updatedAt?: string
  version: number
}

export type LogicalDocumentRevision = {
  activatedAt?: string
  contentHash: string
  createdAt: string
  documentAssetId: string
  documentAssetVersion: number
  documentId: string
  knowledgeSpaceId: string
  mimeType: string
  revision: number
  sizeBytes: number
  state: 'candidate' | 'active' | 'superseded' | 'failed'
} | null

export type LogicalDocument = {
  active: LogicalDocumentRevision
  activeRevision?: number
  createdAt: string
  id: string
  knowledgeSpaceId: string
  providerItemId?: string
  rowVersion: number
  sourceId?: string
  status: 'pending' | 'ready' | 'failed' | 'deleting'
  title: string
  updatedAt: string
  userMetadata: {
    [key: string]: unknown
  }
}

export type LogicalDocumentList = {
  items: Array<LogicalDocument>
  nextCursor?: string
}

export type DocumentRevisionList = {
  items: Array<
    LogicalDocumentRevision & {
      [key: string]: unknown
    }
  >
  nextCursor?: string
}

export type DocumentProcessingTask = {
  completedAt?: string
  createdAt: string
  documentId: string
  documentRevision: number
  errorCode?: string
  errorMessage?: string
  id: string
  knowledgeSpaceId: string
  progressPercent: number
  retryAt?: string
  stage:
    | 'queued'
    | 'parsed'
    | 'outline_built'
    | 'nodes_generated'
    | 'projection_built'
    | 'smoke_eval_passed'
    | 'published'
  state:
    | 'dispatch_pending'
    | 'queued'
    | 'running'
    | 'retry_wait'
    | 'succeeded'
    | 'failed'
    | 'canceled'
    | 'superseded'
  updatedAt: string
}

export type DocumentRevisionChunk = {
  createdAt: string
  documentId: string
  documentRevision: number
  enabled: boolean
  id: string
  knowledgeSpaceId: string
  ordinal: number
  parentChunkId?: string
  text: string
  tokenCount: number
  userMetadata: {
    [key: string]: unknown
  }
}

export type DocumentChunkList = {
  items: Array<DocumentRevisionChunk>
  nextCursor?: string
}

export type DocumentChunkStateChangeAccepted = {
  candidateFingerprint?: string
  candidatePublicationId?: string
  chunkId: string
  compilationAttemptId: string
  createdAt: string
  documentId: string
  documentRevision: number
  enabled: boolean
  id: string
  knowledgeSpaceId: string
  state: 'candidate'
  statusUrl: string
}

export type DocumentProcessingTaskList = {
  items: Array<DocumentProcessingTask>
  nextCursor?: string
}

export type DocumentProcessingTaskEvent =
  | {
      data: {
        progressPercent: number
        stage:
          | 'queued'
          | 'parsed'
          | 'outline_built'
          | 'nodes_generated'
          | 'projection_built'
          | 'smoke_eval_passed'
          | 'published'
        state:
          | 'dispatch_pending'
          | 'queued'
          | 'running'
          | 'retry_wait'
          | 'succeeded'
          | 'failed'
          | 'canceled'
          | 'superseded'
        updatedAt: string
      }
      event: 'progress'
    }
  | {
      data: {
        errorCode?: string
        state: 'succeeded' | 'failed' | 'canceled' | 'superseded'
      }
      event: 'terminal'
    }

export type DocumentSettingsHead = {
  activeRevision: number
  profile: {
    activatedAt?: string
    createdAt: string
    revision: number
    settings: {
      chunkOverlap: number
      chunkSize: number
      enableGraph: boolean
      enablePageIndex: boolean
      language?: string
    }
    state: 'active'
  }
  rowVersion: number
  updatedAt: string
}

export type DocumentReindexAccepted = {
  attemptId: string
  compilationAttemptId: string
  settingsRevision: number
  state: 'running'
  statusUrl: string
}

export type DocumentCompilationJob = {
  baseHeadRevision?: number
  candidateFingerprint?: string
  candidatePublicationId?: string
  completedAt?: number
  createdAt: number
  documentAssetId: string
  error?: string
  executionAttempts?: number
  id: string
  knowledgeSpaceId: string
  leaseExpiresAt?: number
  maxExecutionAttempts?: number
  publicationGenerationId?: string
  queueJobId?: string
  retryAt?: number
  runState?:
    | 'dispatch_pending'
    | 'queued'
    | 'running'
    | 'retry_wait'
    | 'succeeded'
    | 'failed'
    | 'canceled'
    | 'superseded'
  stage:
    | 'queued'
    | 'parsed'
    | 'outline_built'
    | 'nodes_generated'
    | 'projection_built'
    | 'smoke_eval_passed'
    | 'published'
    | 'failed'
    | 'canceled'
  tenantId: string
  updatedAt: number
  version: number
}

export type BulkOperationProgress = {
  completedItems: number
  createdAt: string
  failedItemIds: Array<string>
  failedItems: number
  id: string
  knowledgeSpaceId: string
  status: 'running' | 'completed' | 'failed'
  totalItems: number
  type: 'document_upload' | 'document_delete' | 'document_reindex'
  updatedAt: string
}

export type BulkDocumentReindexResult = {
  bulkJobId: string
  items: Array<
    | {
        asset: DocumentAsset
        compilationJob: {
          id: string
          stage: 'queued'
        }
        status: 'queued'
        statusUrl: string
      }
    | {
        documentId: string
        status: 'not_found'
      }
  >
  total: number
}

export type DocumentUploadAccepted = {
  asset: DocumentAsset
  assetStatusUrl?: string
  compilationJob: {
    id: string
    stage: 'queued'
  }
  logicalDocument: {
    id: string
    revision: number
  }
  logicalDocumentId: string
  documentRevision: number
  statusUrl: string
  status?: 'accepted'
}

export type BulkDocumentUploadAccepted = {
  accepted: number
  bulkJobId: string
  excluded: number
  items: Array<
    | DocumentUploadAccepted
    | {
        filename: string
        index: number
        mimeType: string
        reason:
          | 'batch_byte_limit_exceeded'
          | 'document_not_found'
          | 'file_count_limit_exceeded'
          | 'file_too_large'
          | 'invalid_file'
          | 'invalid_target'
          | 'processing_failed'
          | 'quota_exceeded'
          | 'revision_conflict'
          | 'unsupported_mime_type'
        sizeBytes: number
        status: 'excluded'
      }
  >
  total: number
}

export type SourceWorkflowRun = {
  canceledAt?: string
  checkpoint: string
  completedAt?: string
  createdAt: string
  cursor?: string
  executionAttempts: number
  id: string
  knowledgeSpaceId: string
  kind: string
  lastErrorCode?: string
  maxExecutionAttempts: number
  progressCompleted: number
  progressFailed: number
  progressSkipped: number
  progressTotal?: number
  sourceId?: string
  state: string
  updatedAt: string
}

export type Source = {
  connectionId?: string
  createdAt: string
  id: string
  knowledgeSpaceId: string
  metadata: {
    [key: string]: unknown
  }
  name: string
  permissionScope?: Array<string>
  status: 'active' | 'syncing' | 'error' | 'disabled'
  type: 'upload' | 'object-storage' | 'connector' | 'web'
  updatedAt: string
  uri: string
  version?: number
  credentialConfigured?: boolean
}

export type WebsiteCrawlResult = {
  completed?: number
  failed?: number
  imported?: number
  pages: Array<{
    content: string
    description?: string
    sourceUrl: string
    title?: string
  }>
  replaced?: number
  skipped?: number
  status?: string
  total?: number
}

export type OnlineDocumentPages = {
  nextCursor?: string
  workspaces: Array<{
    pages: Array<{
      lastEditedTime?: string
      pageId: string
      pageName: string
      parentId?: string
      type: string
    }>
    total?: number
    workspaceId?: string
    workspaceName?: string
  }>
}

export type SourceImportResult = {
  documents: Array<{
    documentAssetId: string
    filename: string
  }>
  failed: Array<{
    code: string
    error: string
    filename: string
  }>
  skipped: Array<string>
}

export type SourceCredentialTest = {
  code?: string
  error?: string
  valid: boolean
}

export type OnlineDriveFiles = {
  buckets: Array<{
    bucket?: string
    continuationToken?: string
    files: Array<{
      id: string
      name: string
      size?: number
      type: string
    }>
    isTruncated?: boolean
  }>
}

export type ConsoleProxyError = {
  code: string
  message: string
  status: number
}

export type ListKnowledgeSpacesData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path?: never
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces'
}

export type ListKnowledgeSpacesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  502: ConsoleProxyError
}

export type ListKnowledgeSpacesError = ListKnowledgeSpacesErrors[keyof ListKnowledgeSpacesErrors]

export type ListKnowledgeSpacesResponses = {
  200: KnowledgeSpaceList
}

export type ListKnowledgeSpacesResponse =
  ListKnowledgeSpacesResponses[keyof ListKnowledgeSpacesResponses]

export type CreateKnowledgeSpaceData = {
  body: CreateKnowledgeSpace
  headers?: {
    'x-trace-id'?: string
  }
  path?: never
  query?: never
  url: '/knowledge-fs/knowledge-spaces'
}

export type CreateKnowledgeSpaceErrors = {
  400:
    | {
        code: 'RETRIEVAL_PROFILE_SCORE_THRESHOLD_REQUIRES_RERANK'
        error: 'Fast/Deep mode-final score threshold requires the knowledge-space reranker to be enabled'
        mode: 'fast' | 'research' | 'deep'
      }
    | ErrorResponse
  403: ConsoleProxyError
  409: ErrorResponse
  422: ErrorResponse
  429: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type CreateKnowledgeSpaceError = CreateKnowledgeSpaceErrors[keyof CreateKnowledgeSpaceErrors]

export type CreateKnowledgeSpaceResponses = {
  201: KnowledgeSpaceCreationResponse
}

export type CreateKnowledgeSpaceResponse =
  CreateKnowledgeSpaceResponses[keyof CreateKnowledgeSpaceResponses]

export type DeleteKnowledgeSpacesByIdData = {
  body: {
    challenge: string
    expectedRevision: number
  }
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}'
}

export type DeleteKnowledgeSpacesByIdErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdError =
  DeleteKnowledgeSpacesByIdErrors[keyof DeleteKnowledgeSpacesByIdErrors]

export type DeleteKnowledgeSpacesByIdResponses = {
  202: DurableDeletionAccepted
}

export type DeleteKnowledgeSpacesByIdResponse =
  DeleteKnowledgeSpacesByIdResponses[keyof DeleteKnowledgeSpacesByIdResponses]

export type GetKnowledgeSpacesByIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}'
}

export type GetKnowledgeSpacesByIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdError =
  GetKnowledgeSpacesByIdErrors[keyof GetKnowledgeSpacesByIdErrors]

export type GetKnowledgeSpacesByIdResponses = {
  200: KnowledgeSpace
}

export type GetKnowledgeSpacesByIdResponse =
  GetKnowledgeSpacesByIdResponses[keyof GetKnowledgeSpacesByIdResponses]

export type PatchKnowledgeSpacesByIdData = {
  body: {
    description?: string
    expectedRevision: number
    iconRef?: string | null
    name?: string
    slug?: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}'
}

export type PatchKnowledgeSpacesByIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PatchKnowledgeSpacesByIdError =
  PatchKnowledgeSpacesByIdErrors[keyof PatchKnowledgeSpacesByIdErrors]

export type PatchKnowledgeSpacesByIdResponses = {
  200: KnowledgeSpace
}

export type PatchKnowledgeSpacesByIdResponse =
  PatchKnowledgeSpacesByIdResponses[keyof PatchKnowledgeSpacesByIdResponses]

export type GetKnowledgeSpacesByIdStatsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    windowMinutes?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/stats'
}

export type GetKnowledgeSpacesByIdStatsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdStatsError =
  GetKnowledgeSpacesByIdStatsErrors[keyof GetKnowledgeSpacesByIdStatsErrors]

export type GetKnowledgeSpacesByIdStatsResponses = {
  200: KnowledgeSpaceStats
}

export type GetKnowledgeSpacesByIdStatsResponse =
  GetKnowledgeSpacesByIdStatsResponses[keyof GetKnowledgeSpacesByIdStatsResponses]

export type GetKnowledgeSpacesByIdAccessPolicyData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/access-policy'
}

export type GetKnowledgeSpacesByIdAccessPolicyErrors = {
  400: ErrorResponse & {
    [key: string]: unknown
  }
  403: ConsoleProxyError
  404: ErrorResponse & {
    [key: string]: unknown
  }
  409: ErrorResponse & {
    [key: string]: unknown
  }
  429: ErrorResponse & {
    [key: string]: unknown
  }
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdAccessPolicyError =
  GetKnowledgeSpacesByIdAccessPolicyErrors[keyof GetKnowledgeSpacesByIdAccessPolicyErrors]

export type GetKnowledgeSpacesByIdAccessPolicyResponses = {
  200: {
    id: string
    ownerSubjectId: string
    partialMemberSubjectIds: Array<string>
    revision: number
    visibility: 'only_me' | 'all_members' | 'partial_members'
  }
}

export type GetKnowledgeSpacesByIdAccessPolicyResponse =
  GetKnowledgeSpacesByIdAccessPolicyResponses[keyof GetKnowledgeSpacesByIdAccessPolicyResponses]

export type PatchKnowledgeSpacesByIdAccessPolicyData = {
  body: {
    expectedRevision: number
    partialMemberSubjectIds?: Array<string>
    visibility: 'only_me' | 'all_members' | 'partial_members'
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/access-policy'
}

export type PatchKnowledgeSpacesByIdAccessPolicyErrors = {
  400: ErrorResponse & {
    [key: string]: unknown
  }
  403: ConsoleProxyError
  404: ErrorResponse & {
    [key: string]: unknown
  }
  409: ErrorResponse & {
    [key: string]: unknown
  }
  429: ErrorResponse & {
    [key: string]: unknown
  }
  502: ConsoleProxyError
}

export type PatchKnowledgeSpacesByIdAccessPolicyError =
  PatchKnowledgeSpacesByIdAccessPolicyErrors[keyof PatchKnowledgeSpacesByIdAccessPolicyErrors]

export type PatchKnowledgeSpacesByIdAccessPolicyResponses = {
  200: {
    id: string
    ownerSubjectId: string
    partialMemberSubjectIds: Array<string>
    revision: number
    visibility: 'only_me' | 'all_members' | 'partial_members'
  }
}

export type PatchKnowledgeSpacesByIdAccessPolicyResponse =
  PatchKnowledgeSpacesByIdAccessPolicyResponses[keyof PatchKnowledgeSpacesByIdAccessPolicyResponses]

export type GetSourceProvidersData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path?: never
  query?: never
  url: '/knowledge-fs/source-providers'
}

export type GetSourceProvidersErrors = {
  403: ConsoleProxyError
  502: ConsoleProxyError
}

export type GetSourceProvidersError = GetSourceProvidersErrors[keyof GetSourceProvidersErrors]

export type GetSourceProvidersResponses = {
  200: {
    items: Array<{
      authKinds: Array<'api-key' | 'endpoint' | 'oauth2'>
      available: boolean
      capabilities: Array<'website-crawl' | 'online-document' | 'online-drive'>
      configuration: Array<{
        description?: string
        format?: 'password' | 'uri'
        name: string
        required: boolean
        secret: boolean
        type: 'boolean' | 'integer' | 'string'
      }>
      displayName: string
      id: string
      unavailableReason?: string
    }>
  }
}

export type GetSourceProvidersResponse =
  GetSourceProvidersResponses[keyof GetSourceProvidersResponses]

export type GetKnowledgeSpacesByIdSourceConnectionsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections'
}

export type GetKnowledgeSpacesByIdSourceConnectionsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceConnectionsError =
  GetKnowledgeSpacesByIdSourceConnectionsErrors[keyof GetKnowledgeSpacesByIdSourceConnectionsErrors]

export type GetKnowledgeSpacesByIdSourceConnectionsResponses = {
  200: {
    items: Array<{
      authKind: 'api-key' | 'endpoint' | 'oauth2'
      configuration: {
        [key: string]: boolean | number | string
      }
      createdAt: string
      errorCode?: string
      expiresAt?: string
      id: string
      knowledgeSpaceId: string
      name: string
      providerId: string
      scopes: Array<string>
      status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
      updatedAt: string
      version: number
    }>
    nextCursor?: string
  }
}

export type GetKnowledgeSpacesByIdSourceConnectionsResponse =
  GetKnowledgeSpacesByIdSourceConnectionsResponses[keyof GetKnowledgeSpacesByIdSourceConnectionsResponses]

export type PostKnowledgeSpacesByIdSourceConnectionsData = {
  body: {
    authKind: 'api-key' | 'endpoint'
    configuration?: {
      [key: string]: boolean | number | string
    }
    credentials: {
      [key: string]: unknown
    }
    name: string
    providerId: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections'
}

export type PostKnowledgeSpacesByIdSourceConnectionsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdSourceConnectionsError =
  PostKnowledgeSpacesByIdSourceConnectionsErrors[keyof PostKnowledgeSpacesByIdSourceConnectionsErrors]

export type PostKnowledgeSpacesByIdSourceConnectionsResponses = {
  201: {
    authKind: 'api-key' | 'endpoint' | 'oauth2'
    configuration: {
      [key: string]: boolean | number | string
    }
    createdAt: string
    errorCode?: string
    expiresAt?: string
    id: string
    knowledgeSpaceId: string
    name: string
    providerId: string
    scopes: Array<string>
    status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
    updatedAt: string
    version: number
  }
}

export type PostKnowledgeSpacesByIdSourceConnectionsResponse =
  PostKnowledgeSpacesByIdSourceConnectionsResponses[keyof PostKnowledgeSpacesByIdSourceConnectionsResponses]

export type PostKnowledgeSpacesByIdSourceConnectionsOauthData = {
  body: {
    configuration?: {
      [key: string]: boolean | number | string
    }
    name: string
    providerId: string
    redirectUri: string
    scopes?: Array<string>
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections/oauth'
}

export type PostKnowledgeSpacesByIdSourceConnectionsOauthErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdSourceConnectionsOauthError =
  PostKnowledgeSpacesByIdSourceConnectionsOauthErrors[keyof PostKnowledgeSpacesByIdSourceConnectionsOauthErrors]

export type PostKnowledgeSpacesByIdSourceConnectionsOauthResponses = {
  201: {
    authorizationUrl: string
    connection: {
      authKind: 'api-key' | 'endpoint' | 'oauth2'
      configuration: {
        [key: string]: boolean | number | string
      }
      createdAt: string
      errorCode?: string
      expiresAt?: string
      id: string
      knowledgeSpaceId: string
      name: string
      providerId: string
      scopes: Array<string>
      status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
      updatedAt: string
      version: number
    }
  }
}

export type PostKnowledgeSpacesByIdSourceConnectionsOauthResponse =
  PostKnowledgeSpacesByIdSourceConnectionsOauthResponses[keyof PostKnowledgeSpacesByIdSourceConnectionsOauthResponses]

export type PostSourceOauthCallbackData = {
  body: {
    code: string
    state: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path?: never
  query?: never
  url: '/knowledge-fs/source-oauth/callback'
}

export type PostSourceOauthCallbackErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  409: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
  503: ErrorResponse
}

export type PostSourceOauthCallbackError =
  PostSourceOauthCallbackErrors[keyof PostSourceOauthCallbackErrors]

export type PostSourceOauthCallbackResponses = {
  200: {
    authKind: 'api-key' | 'endpoint' | 'oauth2'
    configuration: {
      [key: string]: boolean | number | string
    }
    createdAt: string
    errorCode?: string
    expiresAt?: string
    id: string
    knowledgeSpaceId: string
    name: string
    providerId: string
    scopes: Array<string>
    status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
    updatedAt: string
    version: number
  }
}

export type PostSourceOauthCallbackResponse =
  PostSourceOauthCallbackResponses[keyof PostSourceOauthCallbackResponses]

export type DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    connectionId: string
  }
  query: {
    expectedVersion: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections/{connectionId}'
}

export type DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdError =
  DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors[keyof DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors]

export type DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses = {
  200: {
    authKind: 'api-key' | 'endpoint' | 'oauth2'
    configuration: {
      [key: string]: boolean | number | string
    }
    createdAt: string
    errorCode?: string
    expiresAt?: string
    id: string
    knowledgeSpaceId: string
    name: string
    providerId: string
    scopes: Array<string>
    status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
    updatedAt: string
    version: number
  }
}

export type DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponse =
  DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses[keyof DeleteKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses]

export type GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    connectionId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections/{connectionId}'
}

export type GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdError =
  GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors[keyof GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdErrors]

export type GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses = {
  200: {
    authKind: 'api-key' | 'endpoint' | 'oauth2'
    configuration: {
      [key: string]: boolean | number | string
    }
    createdAt: string
    errorCode?: string
    expiresAt?: string
    id: string
    knowledgeSpaceId: string
    name: string
    providerId: string
    scopes: Array<string>
    status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
    updatedAt: string
    version: number
  }
}

export type GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponse =
  GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses[keyof GetKnowledgeSpacesByIdSourceConnectionsByConnectionIdResponses]

export type PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshData = {
  body: {
    expectedVersion: number
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    connectionId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-connections/{connectionId}/refresh'
}

export type PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshError =
  PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshErrors[keyof PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshErrors]

export type PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshResponses = {
  200: {
    authKind: 'api-key' | 'endpoint' | 'oauth2'
    configuration: {
      [key: string]: boolean | number | string
    }
    createdAt: string
    errorCode?: string
    expiresAt?: string
    id: string
    knowledgeSpaceId: string
    name: string
    providerId: string
    scopes: Array<string>
    status: 'provisioning' | 'active' | 'expired' | 'error' | 'revoked'
    updatedAt: string
    version: number
  }
}

export type PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshResponse =
  PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshResponses[keyof PostKnowledgeSpacesByIdSourceConnectionsByConnectionIdRefreshResponses]

export type GetKnowledgeSpacesByIdSourcesData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/sources'
}

export type GetKnowledgeSpacesByIdSourcesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
  503: {
    code: 'CANDIDATE_VISIBILITY_SCAN_BUDGET_EXCEEDED'
    error: 'Candidate visibility scan budget exceeded'
  }
}

export type GetKnowledgeSpacesByIdSourcesError =
  GetKnowledgeSpacesByIdSourcesErrors[keyof GetKnowledgeSpacesByIdSourcesErrors]

export type GetKnowledgeSpacesByIdSourcesResponses = {
  200: {
    items: Array<Source>
    nextCursor?: string
  }
}

export type GetKnowledgeSpacesByIdSourcesResponse =
  GetKnowledgeSpacesByIdSourcesResponses[keyof GetKnowledgeSpacesByIdSourcesResponses]

export type PostKnowledgeSpacesByIdSourcesData = {
  body: {
    connectionId?: string
    credentials?: {
      [key: string]: unknown
    }
    metadata?: {
      [key: string]: unknown
    }
    name: string
    permissionScope?: Array<string>
    status?: 'active' | 'syncing' | 'error' | 'disabled'
    type: 'upload' | 'object-storage' | 'connector' | 'web'
    uri: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources'
}

export type PostKnowledgeSpacesByIdSourcesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  429: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdSourcesError =
  PostKnowledgeSpacesByIdSourcesErrors[keyof PostKnowledgeSpacesByIdSourcesErrors]

export type PostKnowledgeSpacesByIdSourcesResponses = {
  201: Source
}

export type PostKnowledgeSpacesByIdSourcesResponse =
  PostKnowledgeSpacesByIdSourcesResponses[keyof PostKnowledgeSpacesByIdSourcesResponses]

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdData = {
  body: {
    expectedRevision: number
  }
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: {
    documents?: 'cascade' | 'keep'
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}'
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdError =
  DeleteKnowledgeSpacesByIdSourcesBySourceIdErrors[keyof DeleteKnowledgeSpacesByIdSourcesBySourceIdErrors]

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdResponses = {
  202: DurableDeletionAccepted
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdResponse =
  DeleteKnowledgeSpacesByIdSourcesBySourceIdResponses[keyof DeleteKnowledgeSpacesByIdSourcesBySourceIdResponses]

export type GetKnowledgeSpacesByIdSourcesBySourceIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}'
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdError =
  GetKnowledgeSpacesByIdSourcesBySourceIdErrors[keyof GetKnowledgeSpacesByIdSourcesBySourceIdErrors]

export type GetKnowledgeSpacesByIdSourcesBySourceIdResponses = {
  200: Source
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdResponse =
  GetKnowledgeSpacesByIdSourcesBySourceIdResponses[keyof GetKnowledgeSpacesByIdSourcesBySourceIdResponses]

export type PatchKnowledgeSpacesByIdSourcesBySourceIdData = {
  body: {
    expectedVersion?: number
    metadata?: {
      [key: string]: unknown
    }
    name?: string
    status?: 'active' | 'syncing' | 'error' | 'disabled'
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}'
}

export type PatchKnowledgeSpacesByIdSourcesBySourceIdErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PatchKnowledgeSpacesByIdSourcesBySourceIdError =
  PatchKnowledgeSpacesByIdSourcesBySourceIdErrors[keyof PatchKnowledgeSpacesByIdSourcesBySourceIdErrors]

export type PatchKnowledgeSpacesByIdSourcesBySourceIdResponses = {
  200: Source
}

export type PatchKnowledgeSpacesByIdSourcesBySourceIdResponse =
  PatchKnowledgeSpacesByIdSourcesBySourceIdResponses[keyof PatchKnowledgeSpacesByIdSourcesBySourceIdResponses]

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query: {
    expectedVersion: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/credentials'
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsError =
  DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors[keyof DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors]

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses = {
  200: Source
}

export type DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponse =
  DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses[keyof DeleteKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses]

export type PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsData = {
  body: {
    credentials: {
      [key: string]: unknown
    }
    expectedVersion: number
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/credentials'
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsError =
  PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors[keyof PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsErrors]

export type PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses = {
  200: Source
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponse =
  PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses[keyof PutKnowledgeSpacesByIdSourcesBySourceIdCredentialsResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdSyncData = {
  body?: never
  headers: {
    'Idempotency-Key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/sync'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdSyncErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdSyncError =
  PostKnowledgeSpacesByIdSourcesBySourceIdSyncErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdSyncErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdSyncResponses = {
  202: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdSyncResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdSyncResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdSyncResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewData = {
  body?: never
  headers: {
    'Idempotency-Key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/crawl-preview'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewError =
  PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewResponses = {
  202: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdCrawlPreviewResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsData = {
  body:
    | {
        items: Array<{
          etag?: string
          lastEditedTime?: string
          name?: string
          pageId: string
          providerItemId: string
          type: string
          workspaceId: string
        }>
        kind: 'online-document-import'
      }
    | {
        items: Array<{
          bucket?: string
          etag?: string
          id: string
          mimeType?: string
          name: string
          providerItemId: string
        }>
        kind: 'online-drive-import'
      }
  headers: {
    'Idempotency-Key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/workflow-imports'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsError =
  PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsResponses = {
  202: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdWorkflowImportsResponses]

export type GetKnowledgeSpacesByIdSourcesBySourceIdPagesData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/pages'
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdPagesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdPagesError =
  GetKnowledgeSpacesByIdSourcesBySourceIdPagesErrors[keyof GetKnowledgeSpacesByIdSourcesBySourceIdPagesErrors]

export type GetKnowledgeSpacesByIdSourcesBySourceIdPagesResponses = {
  200: OnlineDocumentPages
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdPagesResponse =
  GetKnowledgeSpacesByIdSourcesBySourceIdPagesResponses[keyof GetKnowledgeSpacesByIdSourcesBySourceIdPagesResponses]

export type GetKnowledgeSpacesByIdSourcesBySourceIdFilesData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: {
    bucket?: string
    continuationToken?: string
    maxKeys?: number
    prefix?: string
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/files'
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdFilesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdFilesError =
  GetKnowledgeSpacesByIdSourcesBySourceIdFilesErrors[keyof GetKnowledgeSpacesByIdSourcesBySourceIdFilesErrors]

export type GetKnowledgeSpacesByIdSourcesBySourceIdFilesResponses = {
  200: OnlineDriveFiles
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdFilesResponse =
  GetKnowledgeSpacesByIdSourcesBySourceIdFilesResponses[keyof GetKnowledgeSpacesByIdSourcesBySourceIdFilesResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/crawl'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlError =
  PostKnowledgeSpacesByIdSourcesBySourceIdCrawlErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdCrawlErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlResponses = {
  200: WebsiteCrawlResult
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdCrawlResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdCrawlResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdCrawlResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportData = {
  body: {
    pages: Array<{
      lastEditedTime?: string
      name?: string
      pageId: string
      type: string
      workspaceId: string
    }>
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/import'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportError =
  PostKnowledgeSpacesByIdSourcesBySourceIdImportErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdImportErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportResponses = {
  200: SourceImportResult
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdImportResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdImportResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdTestData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/test'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdTestErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdTestError =
  PostKnowledgeSpacesByIdSourcesBySourceIdTestErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdTestErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdTestResponses = {
  200: SourceCredentialTest
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdTestResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdTestResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdTestResponses]

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesData = {
  body: {
    files: Array<{
      bucket?: string
      id: string
      mimeType?: string
      name: string
    }>
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/import-files'
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  501: ErrorResponse
  502: ErrorResponse | ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesError =
  PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesErrors[keyof PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesErrors]

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesResponses = {
  200: SourceImportResult
}

export type PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesResponse =
  PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesResponses[keyof PostKnowledgeSpacesByIdSourcesBySourceIdImportFilesResponses]

export type PostKnowledgeSpacesByIdSourcesBulkData = {
  body: {
    action: 'sync' | 'disable' | 'remove'
    sourceIds: Array<string>
  }
  headers: {
    'Idempotency-Key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/bulk'
}

export type PostKnowledgeSpacesByIdSourcesBulkErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourcesBulkError =
  PostKnowledgeSpacesByIdSourcesBulkErrors[keyof PostKnowledgeSpacesByIdSourcesBulkErrors]

export type PostKnowledgeSpacesByIdSourcesBulkResponses = {
  202: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourcesBulkResponse =
  PostKnowledgeSpacesByIdSourcesBulkResponses[keyof PostKnowledgeSpacesByIdSourcesBulkResponses]

export type GetKnowledgeSpacesByIdSourceWorkflowsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
    sourceId?: string
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows'
}

export type GetKnowledgeSpacesByIdSourceWorkflowsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceWorkflowsError =
  GetKnowledgeSpacesByIdSourceWorkflowsErrors[keyof GetKnowledgeSpacesByIdSourceWorkflowsErrors]

export type GetKnowledgeSpacesByIdSourceWorkflowsResponses = {
  200: {
    items: Array<SourceWorkflowRun>
    nextCursor?: string
  }
}

export type GetKnowledgeSpacesByIdSourceWorkflowsResponse =
  GetKnowledgeSpacesByIdSourceWorkflowsResponses[keyof GetKnowledgeSpacesByIdSourceWorkflowsResponses]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}'
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdError =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdErrors[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdErrors]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdResponses = {
  200: SourceWorkflowRun
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdResponse =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdResponses[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdResponses]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}/bulk-items'
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsError =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsErrors[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsErrors]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsResponses = {
  200: {
    items: Array<{
      action: 'sync' | 'disable' | 'remove'
      errorCode?: string
      id: string
      reason?: string
      sourceId: string
      status: 'eligible' | 'running' | 'skipped' | 'failed' | 'completed'
      updatedAt: string
    }>
    nextCursor?: string
  }
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsResponse =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsResponses[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdBulkItemsResponses]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}/pages'
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesError =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesErrors[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesErrors]

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesResponses = {
  200: {
    items: Array<{
      description?: string
      etag?: string
      pageId: string
      sourceUrl: string
      title?: string
    }>
    nextCursor?: string
  }
}

export type GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesResponse =
  GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesResponses[keyof GetKnowledgeSpacesByIdSourceWorkflowsByRunIdPagesResponses]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelData = {
  body: {
    reason?: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}/cancel'
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelError =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelErrors[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelErrors]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelResponses = {
  200: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelResponse =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelResponses[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdCancelResponses]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}/retry'
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryError =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryErrors[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryErrors]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryResponses = {
  200: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryResponse =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryResponses[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdRetryResponses]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionData = {
  body: {
    pageIds: Array<string>
  }
  headers: {
    'Idempotency-Key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
    runId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/source-workflows/{runId}/selection'
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionError =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionErrors[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionErrors]

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionResponses = {
  202: SourceWorkflowRun
}

export type PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionResponse =
  PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionResponses[keyof PostKnowledgeSpacesByIdSourceWorkflowsByRunIdSelectionResponses]

export type GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/sync-policy'
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyError =
  GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors[keyof GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors]

export type GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses = {
  200: {
    createdAt: string
    customIntervalSeconds?: number
    enabled: boolean
    expectedSourceVersion: number
    id: string
    knowledgeSpaceId: string
    mode: 'provider' | 'manual' | 'interval' | 'custom'
    nextRunAt?: string
    revision: number
    sourceId: string
    updatedAt: string
  }
}

export type GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponse =
  GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses[keyof GetKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses]

export type PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyData = {
  body: {
    customIntervalSeconds?: number
    enabled: boolean
    expectedRevision: number
    expectedSourceVersion: number
    mode: 'provider' | 'manual' | 'interval' | 'custom'
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
    sourceId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/sources/{sourceId}/sync-policy'
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyError =
  PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors[keyof PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyErrors]

export type PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses = {
  200: {
    createdAt: string
    customIntervalSeconds?: number
    enabled: boolean
    expectedSourceVersion: number
    id: string
    knowledgeSpaceId: string
    mode: 'provider' | 'manual' | 'interval' | 'custom'
    nextRunAt?: string
    revision: number
    sourceId: string
    updatedAt: string
  }
}

export type PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponse =
  PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses[keyof PutKnowledgeSpacesByIdSourcesBySourceIdSyncPolicyResponses]

export type GetKnowledgeSpacesByIdDocumentsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/documents'
}

export type GetKnowledgeSpacesByIdDocumentsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
  503: {
    code: 'CANDIDATE_VISIBILITY_SCAN_BUDGET_EXCEEDED'
    error: 'Candidate visibility scan budget exceeded'
  }
}

export type GetKnowledgeSpacesByIdDocumentsError =
  GetKnowledgeSpacesByIdDocumentsErrors[keyof GetKnowledgeSpacesByIdDocumentsErrors]

export type GetKnowledgeSpacesByIdDocumentsResponses = {
  200: DocumentAssetList
}

export type GetKnowledgeSpacesByIdDocumentsResponse =
  GetKnowledgeSpacesByIdDocumentsResponses[keyof GetKnowledgeSpacesByIdDocumentsResponses]

export type PostKnowledgeSpacesByIdDocumentsData = {
  body: {
    documentId?: string
    expectedActiveRevision?: number | 'null'
    expectedDocumentRowVersion?: number | null
    file: Blob | File
    sourceId?: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents'
}

export type PostKnowledgeSpacesByIdDocumentsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  413: ErrorResponse
  429: ErrorResponse
  500: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdDocumentsError =
  PostKnowledgeSpacesByIdDocumentsErrors[keyof PostKnowledgeSpacesByIdDocumentsErrors]

export type PostKnowledgeSpacesByIdDocumentsResponses = {
  201: DocumentAsset
  202: DocumentUploadAccepted
}

export type PostKnowledgeSpacesByIdDocumentsResponse =
  PostKnowledgeSpacesByIdDocumentsResponses[keyof PostKnowledgeSpacesByIdDocumentsResponses]

export type DeleteKnowledgeSpacesByIdDocumentsBulkData = {
  body: {
    documents: Array<{
      documentId: string
      expectedRevision: number
    }>
  }
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/bulk'
}

export type DeleteKnowledgeSpacesByIdDocumentsBulkErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdDocumentsBulkError =
  DeleteKnowledgeSpacesByIdDocumentsBulkErrors[keyof DeleteKnowledgeSpacesByIdDocumentsBulkErrors]

export type DeleteKnowledgeSpacesByIdDocumentsBulkResponses = {
  202: DurableBulkDeletionAccepted
}

export type DeleteKnowledgeSpacesByIdDocumentsBulkResponse =
  DeleteKnowledgeSpacesByIdDocumentsBulkResponses[keyof DeleteKnowledgeSpacesByIdDocumentsBulkResponses]

export type PostKnowledgeSpacesByIdDocumentsBulkData = {
  body: {
    files: Array<Blob | File>
    targets?: string
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/bulk'
}

export type PostKnowledgeSpacesByIdDocumentsBulkErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  413: ErrorResponse
  429: ErrorResponse
  500: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdDocumentsBulkError =
  PostKnowledgeSpacesByIdDocumentsBulkErrors[keyof PostKnowledgeSpacesByIdDocumentsBulkErrors]

export type PostKnowledgeSpacesByIdDocumentsBulkResponses = {
  202: BulkDocumentUploadAccepted
}

export type PostKnowledgeSpacesByIdDocumentsBulkResponse =
  PostKnowledgeSpacesByIdDocumentsBulkResponses[keyof PostKnowledgeSpacesByIdDocumentsBulkResponses]

export type PostKnowledgeSpacesByIdDocumentsBulkReindexData = {
  body: {
    all?: boolean
    documentIds?: Array<string>
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/bulk/reindex'
}

export type PostKnowledgeSpacesByIdDocumentsBulkReindexErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  413: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdDocumentsBulkReindexError =
  PostKnowledgeSpacesByIdDocumentsBulkReindexErrors[keyof PostKnowledgeSpacesByIdDocumentsBulkReindexErrors]

export type PostKnowledgeSpacesByIdDocumentsBulkReindexResponses = {
  202: BulkDocumentReindexResult
}

export type PostKnowledgeSpacesByIdDocumentsBulkReindexResponse =
  PostKnowledgeSpacesByIdDocumentsBulkReindexResponses[keyof PostKnowledgeSpacesByIdDocumentsBulkReindexResponses]

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdData = {
  body: {
    expectedRevision: number
  }
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}'
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdError =
  DeleteKnowledgeSpacesByIdDocumentsByDocumentIdErrors[keyof DeleteKnowledgeSpacesByIdDocumentsByDocumentIdErrors]

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdResponses = {
  202: DurableDeletionAccepted
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdResponse =
  DeleteKnowledgeSpacesByIdDocumentsByDocumentIdResponses[keyof DeleteKnowledgeSpacesByIdDocumentsByDocumentIdResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdResponses = {
  200: DocumentAsset
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdResponses]

export type GetKnowledgeSpacesByIdLogicalDocumentsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/logical-documents'
}

export type GetKnowledgeSpacesByIdLogicalDocumentsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdLogicalDocumentsError =
  GetKnowledgeSpacesByIdLogicalDocumentsErrors[keyof GetKnowledgeSpacesByIdLogicalDocumentsErrors]

export type GetKnowledgeSpacesByIdLogicalDocumentsResponses = {
  200: LogicalDocumentList
}

export type GetKnowledgeSpacesByIdLogicalDocumentsResponse =
  GetKnowledgeSpacesByIdLogicalDocumentsResponses[keyof GetKnowledgeSpacesByIdLogicalDocumentsResponses]

export type DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdData = {
  body: {
    expectedRevision: number
  }
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/logical-documents/{documentId}'
}

export type DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdError =
  DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors[keyof DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors]

export type DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses = {
  202: DurableDeletionAccepted
}

export type DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponse =
  DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses[keyof DeleteKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses]

export type GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/logical-documents/{documentId}'
}

export type GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdError =
  GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors[keyof GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdErrors]

export type GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses = {
  200: LogicalDocument
}

export type GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponse =
  GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses[keyof GetKnowledgeSpacesByIdLogicalDocumentsByDocumentIdResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/outline'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineResponses = {
  200: DocumentOutline
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdOutlineResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/revisions'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsResponses = {
  200: DocumentRevisionList
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsResponses]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackData = {
  body: {
    expectedActiveRevision: number
    expectedRowVersion: number
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    revision: number
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/revisions/{revision}/rollback'
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackError =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackErrors[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackErrors]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackResponses = {
  202: DocumentProcessingTask
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackResponse =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackResponses[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionRollbackResponses]

export type PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataData = {
  body: {
    expectedRowVersion: number
    patch: {
      [key: string]: unknown
    }
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/metadata'
}

export type PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataError =
  PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataErrors[keyof PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataErrors]

export type PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataResponses = {
  200: LogicalDocument
}

export type PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataResponse =
  PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataResponses[keyof PatchKnowledgeSpacesByIdDocumentsByDocumentIdMetadataResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    revision: number
  }
  query?: {
    cursor?: string
    limit?: number
    query?: string
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/revisions/{revision}/chunks'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksResponses = {
  200: DocumentChunkList
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    revision: number
    chunkId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/revisions/{revision}/chunks/{chunkId}'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponses =
  {
    200: DocumentRevisionChunk
  }

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponses]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateData =
  {
    body: {
      enabled: boolean
    }
    headers?: {
      'x-trace-id'?: string
    }
    path: {
      documentId: string
      id: string
      revision: number
      chunkId: string
    }
    query?: never
    url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/revisions/{revision}/chunks/{chunkId}/state'
  }

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateErrors =
  {
    400: ErrorResponse
    403: ConsoleProxyError
    404: ErrorResponse
    502: ConsoleProxyError
    503: ErrorResponse
  }

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateError =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateErrors[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateErrors]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateResponses =
  {
    202: DocumentChunkStateChangeAccepted
  }

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateResponse =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateResponses[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdStateResponses]

export type GetKnowledgeSpacesByIdProcessingTasksData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/processing-tasks'
}

export type GetKnowledgeSpacesByIdProcessingTasksErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdProcessingTasksError =
  GetKnowledgeSpacesByIdProcessingTasksErrors[keyof GetKnowledgeSpacesByIdProcessingTasksErrors]

export type GetKnowledgeSpacesByIdProcessingTasksResponses = {
  200: DocumentProcessingTaskList
}

export type GetKnowledgeSpacesByIdProcessingTasksResponse =
  GetKnowledgeSpacesByIdProcessingTasksResponses[keyof GetKnowledgeSpacesByIdProcessingTasksResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: {
    cursor?: string
    limit?: number
  }
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/processing-tasks'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksErrors = {
  400: ErrorResponse
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksResponses = {
  200: DocumentProcessingTaskList
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksResponses]

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    taskId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/processing-tasks/{taskId}'
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdError =
  DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors[keyof DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors]

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses = {
  200: DocumentProcessingTask
}

export type DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponse =
  DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses[keyof DeleteKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    taskId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/processing-tasks/{taskId}'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses = {
  200: DocumentProcessingTask
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsData = {
  body?: never
  headers?: {
    'last-event-id'?: string
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    taskId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/processing-tasks/{taskId}/events'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsResponses = {
  200: DocumentProcessingTaskEvent
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdEventsResponses]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
    taskId: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/processing-tasks/{taskId}/retry'
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryError =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryErrors[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryErrors]

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryResponses = {
  200: DocumentProcessingTask
}

export type PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryResponse =
  PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryResponses[keyof PostKnowledgeSpacesByIdDocumentsByDocumentIdProcessingTasksByTaskIdRetryResponses]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/settings'
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsError =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors]

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses = {
  200: DocumentSettingsHead
}

export type GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponse =
  GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses[keyof GetKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses]

export type PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsData = {
  body: {
    expectedSettingsHeadRevision: number | null
    settings: {
      chunkOverlap: number
      chunkSize: number
      enableGraph: boolean
      enablePageIndex: boolean
      language?: string
    }
  }
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    documentId: string
    id: string
  }
  query?: never
  url: '/knowledge-fs/knowledge-spaces/{id}/documents/{documentId}/settings'
}

export type PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsError =
  PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors[keyof PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsErrors]

export type PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses = {
  202: DocumentReindexAccepted
}

export type PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponse =
  PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses[keyof PutKnowledgeSpacesByIdDocumentsByDocumentIdSettingsResponses]

export type DeleteJobsByIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/jobs/{id}'
}

export type DeleteJobsByIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type DeleteJobsByIdError = DeleteJobsByIdErrors[keyof DeleteJobsByIdErrors]

export type DeleteJobsByIdResponses = {
  200: DocumentCompilationJob
}

export type DeleteJobsByIdResponse = DeleteJobsByIdResponses[keyof DeleteJobsByIdResponses]

export type GetJobsByIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/jobs/{id}'
}

export type GetJobsByIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type GetJobsByIdError = GetJobsByIdErrors[keyof GetJobsByIdErrors]

export type GetJobsByIdResponses = {
  200: DocumentCompilationJob
}

export type GetJobsByIdResponse = GetJobsByIdResponses[keyof GetJobsByIdResponses]

export type PostJobsByIdRetryData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/jobs/{id}/retry'
}

export type PostJobsByIdRetryErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostJobsByIdRetryError = PostJobsByIdRetryErrors[keyof PostJobsByIdRetryErrors]

export type PostJobsByIdRetryResponses = {
  200: DocumentCompilationJob
}

export type PostJobsByIdRetryResponse = PostJobsByIdRetryResponses[keyof PostJobsByIdRetryResponses]

export type GetDeletionJobsByJobIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    jobId: string
  }
  query?: never
  url: '/knowledge-fs/deletion-jobs/{jobId}'
}

export type GetDeletionJobsByJobIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
}

export type GetDeletionJobsByJobIdError =
  GetDeletionJobsByJobIdErrors[keyof GetDeletionJobsByJobIdErrors]

export type GetDeletionJobsByJobIdResponses = {
  200: DurableDeletionJob
}

export type GetDeletionJobsByJobIdResponse =
  GetDeletionJobsByJobIdResponses[keyof GetDeletionJobsByJobIdResponses]

export type PostDeletionJobsByJobIdRetryData = {
  body?: never
  headers: {
    'idempotency-key': string
    'x-trace-id'?: string
  }
  path: {
    jobId: string
  }
  query?: never
  url: '/knowledge-fs/deletion-jobs/{jobId}/retry'
}

export type PostDeletionJobsByJobIdRetryErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  409: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type PostDeletionJobsByJobIdRetryError =
  PostDeletionJobsByJobIdRetryErrors[keyof PostDeletionJobsByJobIdRetryErrors]

export type PostDeletionJobsByJobIdRetryResponses = {
  202: DurableDeletionAccepted
}

export type PostDeletionJobsByJobIdRetryResponse =
  PostDeletionJobsByJobIdRetryResponses[keyof PostDeletionJobsByJobIdRetryResponses]

export type GetBulkJobsByIdData = {
  body?: never
  headers?: {
    'x-trace-id'?: string
  }
  path: {
    id: string
  }
  query?: never
  url: '/knowledge-fs/bulk-jobs/{id}'
}

export type GetBulkJobsByIdErrors = {
  403: ConsoleProxyError
  404: ErrorResponse
  502: ConsoleProxyError
  503: ErrorResponse
}

export type GetBulkJobsByIdError = GetBulkJobsByIdErrors[keyof GetBulkJobsByIdErrors]

export type GetBulkJobsByIdResponses = {
  200: BulkOperationProgress
}

export type GetBulkJobsByIdResponse = GetBulkJobsByIdResponses[keyof GetBulkJobsByIdResponses]
