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

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

export type WorkflowRunPaginationResponse = {
  data: Array<WorkflowRunForListResponse>
  has_more: boolean
  limit: number
}

export type SimpleResultResponse = {
  result: string
}

export type WorkflowRunDetailResponse = {
  created_at?: number | null
  created_by_account?: SimpleAccountResponse | null
  created_by_end_user?: SimpleEndUser | null
  created_by_role?: string | null
  elapsed_time?: number | null
  error?: string | null
  exceptions_count?: number | null
  finished_at?: number | null
  graph: unknown
  id: string
  inputs: unknown
  outputs: unknown
  status?: string | null
  total_steps?: number | null
  total_tokens?: number | null
  version?: string | null
}

export type WorkflowRunNodeExecutionListResponse = {
  data: Array<WorkflowRunNodeExecutionResponse>
}

export type SnippetWorkflowPaginationResponse = {
  has_more: boolean
  items: Array<SnippetWorkflowResponse>
  limit: number
  page: number
}

export type DefaultBlockConfigsResponse = Array<{
  [key: string]: unknown
}>

export type SnippetWorkflowResponse = {
  conversation_variables: Array<WorkflowConversationVariableResponse>
  created_at: number
  created_by?: SimpleAccountResponse | null
  environment_variables: Array<WorkflowEnvironmentVariableResponse>
  features: {
    [key: string]: unknown
  }
  graph: {
    [key: string]: unknown
  }
  hash: string
  id: string
  input_fields?: Array<{
    [key: string]: unknown
  }>
  marked_comment: string
  marked_name: string
  rag_pipeline_variables: Array<PipelineVariableResponse>
  tool_published: boolean
  updated_at: number
  updated_by?: SimpleAccountResponse | null
  version: string
}

export type SnippetDraftSyncPayload = {
  conversation_variables?: Array<{
    [key: string]: unknown
  }> | null
  graph: {
    [key: string]: unknown
  }
  hash?: string | null
  input_fields?: Array<{
    [key: string]: unknown
  }> | null
}

export type WorkflowRestoreResponse = {
  hash: string
  result: string
  updated_at: number
}

export type SnippetDraftConfigResponse = {
  parallel_depth_limit: number
}

export type WorkflowDraftVariableList = {
  items?: Array<WorkflowDraftVariable>
}

export type EnvironmentVariableListResponse = {
  items: Array<EnvironmentVariableItemResponse>
}

export type SnippetIterationNodeRunPayload = {
  inputs?: {
    [key: string]: unknown
  } | null
}

export type GeneratedAppResponse = JsonValue

export type SnippetLoopNodeRunPayload = {
  inputs?: {
    [key: string]: unknown
  } | null
}

export type WorkflowAgentComposerResponse = {
  active_config_snapshot?: AgentConfigSnapshotSummaryResponse | null
  agent?: AgentComposerAgentResponse | null
  agent_soul: AgentSoulConfig
  app_id?: string | null
  backing_app_id?: string | null
  binding?: AgentComposerBindingResponse | null
  chat_endpoint?: string | null
  debug_conversation_has_messages?: boolean
  debug_conversation_id?: string | null
  debug_conversation_message_count?: number
  effective_declared_outputs?: Array<DeclaredOutputConfig>
  hidden_app_backed?: boolean
  impact_summary?: AgentComposerImpactResponse | null
  node_id?: string | null
  node_job: WorkflowNodeJobConfig
  save_options: Array<ComposerSaveStrategy>
  soul_lock: AgentComposerSoulLockResponse
  validation?: ComposerValidationFindingsResponse | null
  variant: 'workflow'
  workflow_id?: string | null
}

export type ComposerSavePayload = {
  agent_soul?: AgentSoulConfig | null
  binding?: ComposerBindingPayload | null
  client_revision_id?: string | null
  description?: string | null
  icon?: string | null
  icon_background?: string | null
  icon_type?: AgentIconType | null
  idempotency_key?: string | null
  new_agent_name?: string | null
  node_job?: WorkflowNodeJobConfig | null
  role?: string | null
  save_strategy: ComposerSaveStrategy
  soul_lock?: ComposerSoulLockPayload
  variant: ComposerVariant
  version_note?: string | null
}

export type AgentComposerCandidatesResponse = {
  allowed_node_job_candidates?: AgentComposerNodeJobCandidatesResponse
  allowed_soul_candidates?: AgentComposerSoulCandidatesResponse
  capabilities?: ComposerCandidateCapabilities
  truncated?: boolean
  variant: ComposerVariant
}

export type WorkflowComposerCopyFromRosterPayload = {
  idempotency_key?: string | null
  source_agent_id: string
  source_snapshot_id?: string | null
}

export type AgentComposerImpactResponse = {
  bindings?: Array<AgentComposerImpactBindingResponse>
  current_snapshot_id?: string | null
  workflow_node_count: number
}

export type AgentComposerValidateResponse = {
  errors?: Array<string>
  knowledge_retrieval_placeholder?: Array<ComposerKnowledgePlaceholderResponse>
  result: 'success'
  warnings?: Array<ComposerValidationWarningResponse>
}

export type WorkflowRunNodeExecutionResponse = {
  created_at?: number | null
  created_by_account?: SimpleAccountResponse | null
  created_by_end_user?: SimpleEndUser | null
  created_by_role?: string | null
  elapsed_time?: number | null
  error?: string | null
  execution_metadata?: unknown
  extras?: unknown
  finished_at?: number | null
  id: string
  index?: number | null
  inputs?: unknown
  inputs_truncated?: boolean | null
  node_id?: string | null
  node_type?: string | null
  outputs?: unknown
  outputs_truncated?: boolean | null
  predecessor_node_id?: string | null
  process_data?: unknown
  process_data_truncated?: boolean | null
  retry_index?: number | null
  status?: string | null
  title?: string | null
}

export type SnippetDraftNodeRunPayload = {
  files?: Array<{
    [key: string]: unknown
  }> | null
  inputs: {
    [key: string]: unknown
  }
  query?: string
}

export type SnippetDraftRunPayload = {
  files?: Array<{
    [key: string]: unknown
  }> | null
  inputs: {
    [key: string]: unknown
  }
}

export type WorkflowDraftVariableListWithoutValue = {
  items?: Array<WorkflowDraftVariableWithoutValue>
  total?: number
}

export type WorkflowDraftVariable = {
  description?: string
  edited?: boolean
  full_content?: {
    [key: string]: unknown
  }
  id?: string
  is_truncated?: boolean
  name?: string
  selector?: Array<string>
  type?: string
  value?:
    | string
    | number
    | number
    | boolean
    | {
        [key: string]: unknown
      }
    | Array<unknown>
    | null
  value_type?: string
  visible?: boolean
}

export type WorkflowDraftVariableUpdatePayload = {
  name?: string | null
  value?: unknown | null
}

export type PublishWorkflowPayload = {
  knowledge_base_setting?: {
    [key: string]: unknown
  } | null
  marked_comment?: string | null
  marked_name?: string | null
}

export type WorkflowPublishResponse = {
  created_at: number
  result: string
}

export type WorkflowUpdatePayload = {
  marked_comment?: string | null
  marked_name?: string | null
}

export type WorkflowRunForListResponse = {
  created_at?: number | null
  created_by_account?: SimpleAccountResponse | null
  elapsed_time?: number | null
  exceptions_count?: number | null
  finished_at?: number | null
  id: string
  retry_index?: number | null
  status?: string | null
  total_steps?: number | null
  total_tokens?: number | null
  version?: string | null
}

export type SimpleAccountResponse = {
  email: string
  id: string
  name: string
}

export type SimpleEndUser = {
  id: string
  is_anonymous: boolean
  session_id?: string | null
  type: string
}

export type WorkflowConversationVariableResponse = {
  description: string
  id: string
  name: string
  value: unknown
  value_type: string
}

export type WorkflowEnvironmentVariableResponse = {
  description: string
  id: string
  name: string
  value: unknown
  value_type: string
}

export type PipelineVariableResponse = {
  allowed_file_extensions?: Array<string> | null
  allowed_file_types?: Array<string> | null
  allowed_file_upload_methods?: Array<string> | null
  belong_to_node_id: string
  default_value?: unknown
  label: string
  max_length?: number | null
  options?: Array<string> | null
  placeholder?: string | null
  required: boolean
  tooltips?: string | null
  type: string
  unit?: string | null
  variable: string
}

export type EnvironmentVariableItemResponse = {
  description?: string | null
  editable: boolean
  edited: boolean
  id: string
  name: string
  selector: Array<string>
  type: string
  value: unknown
  value_type: string
  visible: boolean
}

export type JsonValue =
  | string
  | number
  | number
  | boolean
  | {
      [key: string]: unknown
    }
  | Array<unknown>
  | null

export type AgentConfigSnapshotSummaryResponse = {
  agent_id?: string | null
  created_at?: number | null
  created_by?: string | null
  display_version?: number | null
  id: string
  snapshot_version?: number | null
  summary?: string | null
  version: number
  version_note?: string | null
}

export type AgentComposerAgentResponse = {
  active_config_snapshot_id?: string | null
  app_id?: string | null
  backing_app_id?: string | null
  description: string
  hidden_app_backed?: boolean
  icon?: string | null
  icon_background?: string | null
  icon_type?: string | null
  id: string
  name: string
  role?: string | null
  scope: AgentScope
  source?: AgentSource | null
  status: AgentStatus
}

export type AgentSoulConfig = {
  app_features?: AgentSoulAppFeaturesConfig
  app_variables?: Array<AppVariableConfig>
  config_files?: Array<AgentConfigFileRefConfig>
  config_note?: string
  config_skills?: Array<AgentConfigSkillRefConfig>
  env?: AgentSoulEnvConfig
  files?: AgentSoulFilesConfig
  human?: AgentSoulHumanConfig
  knowledge?: AgentSoulKnowledgeConfig
  memory?: AgentSoulMemoryConfig
  misc_legacy?: AgentSoulAppFeaturesConfig
  model?: AgentSoulModelConfig | null
  prompt?: AgentSoulPromptConfig
  sandbox?: AgentSoulSandboxConfig
  schema_version?: number
  tools?: AgentSoulToolsConfig
}

export type AgentComposerBindingResponse = {
  agent_id?: string | null
  binding_type: WorkflowAgentBindingType
  current_snapshot_id?: string | null
  id: string
  node_id: string
  workflow_id: string
}

export type DeclaredOutputConfig = {
  array_item?: DeclaredArrayItem | null
  check?: DeclaredOutputCheckConfig | null
  children?: Array<{
    array_item?: {
      children?: Array<{
        [key: string]: unknown
      }>
      description?: string | null
      type?: 'array' | 'boolean' | 'file' | 'number' | 'object' | 'string'
      [key: string]: unknown
    } | null
    children?: Array<{
      [key: string]: unknown
    }>
    description?: string | null
    file?: {
      [key: string]: unknown
    } | null
    name: string
    required?: boolean
    type: 'array' | 'boolean' | 'file' | 'number' | 'object' | 'string'
  }>
  description?: string | null
  failure_strategy?: DeclaredOutputFailureStrategy
  file?: DeclaredOutputFileConfig | null
  id?: string | null
  name: string
  required?: boolean
  type: DeclaredOutputType
}

export type WorkflowNodeJobConfig = {
  declared_outputs?: Array<DeclaredOutputConfig>
  human_contacts?: Array<AgentHumanContactConfig>
  metadata?: WorkflowNodeJobMetadata
  mode?: WorkflowNodeJobMode
  previous_node_output_refs?: Array<WorkflowPreviousNodeOutputRef>
  schema_version?: number
  workflow_prompt?: string
}

export type ComposerSaveStrategy =
  | 'node_job_only'
  | 'save_as_new_agent'
  | 'save_as_new_version'
  | 'save_to_current_version'
  | 'save_to_roster'

export type AgentComposerSoulLockResponse = {
  can_unlock?: boolean
  locked: boolean
  reason?: string | null
}

export type ComposerValidationFindingsResponse = {
  knowledge_retrieval_placeholder?: Array<ComposerKnowledgePlaceholderResponse>
  warnings?: Array<ComposerValidationWarningResponse>
}

export type ComposerBindingPayload = {
  agent_id?: string | null
  binding_type: 'inline_agent' | 'roster_agent'
  current_snapshot_id?: string | null
}

export type AgentIconType = 'emoji' | 'image' | 'link'

export type ComposerSoulLockPayload = {
  locked?: boolean
  unlocked_from_version_id?: string | null
}

export type ComposerVariant = 'agent_app' | 'workflow'

export type AgentComposerNodeJobCandidatesResponse = {
  declare_output_types?: Array<DeclaredOutputType>
  human_contacts?: Array<AgentHumanContactConfig>
  previous_node_outputs?: Array<WorkflowPreviousNodeOutputRef>
}

export type AgentComposerSoulCandidatesResponse = {
  cli_tools?: Array<AgentCliToolConfig>
  dify_tools?: Array<AgentComposerDifyToolCandidateResponse>
  human_contacts?: Array<AgentHumanContactConfig>
  knowledge_sets?: Array<AgentComposerKnowledgeSetCandidateResponse>
}

export type ComposerCandidateCapabilities = {
  human_roster_available?: boolean
}

export type AgentComposerImpactBindingResponse = {
  app_id: string
  node_id: string
  workflow_id: string
}

export type ComposerKnowledgePlaceholderResponse = {
  id: string
  placeholder_name: string
}

export type ComposerValidationWarningResponse = {
  code: string
  id?: string | null
  kind?: string | null
  message?: string | null
  surface?: string | null
}

export type WorkflowDraftVariableWithoutValue = {
  description?: string
  edited?: boolean
  id?: string
  is_truncated?: boolean
  name?: string
  selector?: Array<string>
  type?: string
  value_type?: string
  visible?: boolean
}

export type AgentScope = 'roster' | 'workflow_only'

export type AgentSource = 'agent_app' | 'imported' | 'roster' | 'system' | 'workflow'

export type AgentStatus = 'active' | 'archived'

export type AgentSoulAppFeaturesConfig = {
  file_upload?: AgentFileUploadFeatureConfig
  opening_statement?: string | null
  retriever_resource?: AgentFeatureToggleConfig | null
  sensitive_word_avoidance?: AgentSensitiveWordAvoidanceFeatureConfig | null
  speech_to_text?: AgentFeatureToggleConfig | null
  suggested_questions?: Array<string> | null
  suggested_questions_after_answer?: AgentSuggestedQuestionsAfterAnswerFeatureConfig | null
  text_to_speech?: AgentTextToSpeechFeatureConfig | null
  [key: string]: unknown
}

export type AppVariableConfig = {
  default?: unknown
  name: string
  required?: boolean
  type: string
}

export type AgentConfigFileRefConfig = {
  file_id?: string
  file_kind: 'tool_file' | 'upload_file'
  hash?: string | null
  is_missing?: boolean
  mime_type?: string | null
  name: string
  size?: number | null
}

export type AgentConfigSkillRefConfig = {
  description?: string
  file_id?: string
  file_kind?: 'tool_file'
  hash?: string | null
  is_missing?: boolean
  mime_type?: string | null
  name: string
  size?: number | null
}

export type AgentSoulEnvConfig = {
  secret_refs?: Array<AgentSecretRefConfig>
  variables?: Array<AgentEnvVariableConfig>
}

export type AgentSoulFilesConfig = {
  files?: Array<AgentFileRefConfig>
  skills?: Array<AgentSkillRefConfig>
}

export type AgentSoulHumanConfig = {
  contacts?: Array<AgentHumanContactConfig>
  tools?: Array<AgentHumanToolConfig>
}

export type AgentSoulKnowledgeConfig = {
  sets?: Array<AgentKnowledgeSetConfig>
}

export type AgentSoulMemoryConfig = {
  artifacts?: Array<AgentMemoryArtifactConfig>
  budget?: string | null
  scope?: string | null
}

export type AgentSoulModelConfig = {
  credential_ref?: AgentSoulModelCredentialRef | null
  model: string
  model_provider: string
  model_settings?: AgentSoulModelSettings
  plugin_id: string
}

export type AgentSoulPromptConfig = {
  system_prompt?: string
}

export type AgentSoulSandboxConfig = {
  config?: AgentSandboxProviderConfig
  provider?: string | null
}

export type AgentSoulToolsConfig = {
  cli_tools?: Array<AgentCliToolConfig>
  dify_tools?: Array<AgentSoulDifyToolConfig>
}

export type WorkflowAgentBindingType = 'inline_agent' | 'roster_agent'

export type DeclaredArrayItem = {
  children?: Array<{
    array_item?: {
      children?: Array<{
        [key: string]: unknown
      }>
      description?: string | null
      type?: 'array' | 'boolean' | 'file' | 'number' | 'object' | 'string'
      [key: string]: unknown
    } | null
    children?: Array<{
      [key: string]: unknown
    }>
    description?: string | null
    file?: {
      [key: string]: unknown
    } | null
    name: string
    required?: boolean
    type: 'array' | 'boolean' | 'file' | 'number' | 'object' | 'string'
  }>
  description?: string | null
  type: DeclaredOutputType
}

export type DeclaredOutputCheckConfig = {
  benchmark_file_ref?: AgentFileRefConfig | null
  enabled?: boolean
  model_ref?: AgentSoulModelConfig | null
  prompt?: string | null
}

export type DeclaredOutputFailureStrategy = {
  default_value?: unknown
  on_failure?: OutputErrorStrategy
  retry?: DeclaredOutputRetryConfig
}

export type DeclaredOutputFileConfig = {
  extensions?: Array<string>
  mime_types?: Array<string>
}

export type DeclaredOutputType = 'array' | 'boolean' | 'file' | 'number' | 'object' | 'string'

export type AgentHumanContactConfig = {
  channel?: string | null
  contact_id?: string | null
  contact_method?: string | null
  email?: string | null
  human_id?: string | null
  id?: string | null
  method?: string | null
  name?: string | null
  tenant_id?: string | null
  [key: string]: unknown
}

export type WorkflowNodeJobMetadata = {
  agent_soul?: {
    [key: string]: unknown
  } | null
  file_refs?: Array<AgentFileRefConfig> | null
}

export type WorkflowNodeJobMode = 'let_agent_figure_it_out' | 'tell_agent_what_to_do'

export type WorkflowPreviousNodeOutputRef = {
  key?: string | null
  name?: string | null
  node_id?: string | null
  output?: string | null
  selector?: Array<string | number | number | boolean | null> | null
  value_selector?: Array<string | number | number | boolean | null> | null
  variable?: string | null
  variable_selector?: Array<string | number | number | boolean | null> | null
  [key: string]: unknown
}

export type AgentCliToolConfig = {
  approved?: boolean
  authorization_status?: AgentCliToolAuthorizationStatus | null
  command?: string | null
  dangerous?: boolean
  dangerous_accepted?: boolean
  dangerous_acknowledged?: boolean
  dangerous_command?: boolean
  description?: string | null
  enabled?: boolean
  env?: AgentCliToolEnvConfig
  id?: string | null
  inferred_from?: string | null
  install?: string | null
  install_command?: string | null
  install_commands?: Array<string>
  invoke_metadata?: {
    [key: string]: unknown
  }
  label?: string | null
  name?: string | null
  permission?: AgentPermissionConfig | null
  pre_authorized?: boolean | null
  requires_confirmation?: boolean
  risk_accepted?: boolean
  risk_level?: AgentCliToolRiskLevel | null
  setup_command?: string | null
  tool_name?: string | null
  [key: string]: unknown
}

export type AgentComposerDifyToolCandidateResponse = {
  description?: string | null
  granularity?: string | null
  id?: string | null
  name?: string | null
  plugin_id?: string | null
  provider?: string | null
  provider_id?: string | null
  tools_count?: number | null
}

export type AgentComposerKnowledgeSetCandidateResponse = {
  datasets?: Array<AgentComposerKnowledgeDatasetCandidateResponse>
  description?: string | null
  id: string
  missing_dataset_ids?: Array<string>
  name: string
}

export type AgentFileUploadFeatureConfig = {
  allowed_file_extensions?: Array<string>
  allowed_file_types?: Array<FileType>
  allowed_file_upload_methods?: Array<FileTransferMethod>
  enabled?: boolean
  image?: AgentFileUploadImageFeatureConfig
  number_limits?: number
  [key: string]: unknown
}

export type AgentFeatureToggleConfig = {
  enabled?: boolean
  [key: string]: unknown
}

export type AgentSensitiveWordAvoidanceFeatureConfig = {
  config?: AgentModerationProviderConfig | null
  enabled?: boolean
  type?: string | null
  [key: string]: unknown
}

export type AgentSuggestedQuestionsAfterAnswerFeatureConfig = {
  enabled?: boolean
  model?: AgentSuggestedQuestionsAfterAnswerModelConfig | null
  prompt?: string | null
  [key: string]: unknown
}

export type AgentTextToSpeechFeatureConfig = {
  autoPlay?: string | null
  enabled?: boolean
  language?: string | null
  voice?: string | null
  [key: string]: unknown
}

export type AgentSecretRefConfig = {
  credential_id?: string | null
  env_name?: string | null
  id?: string | null
  key?: string | null
  name?: string | null
  permission?: AgentPermissionConfig | null
  permission_status?: string | null
  provider?: string | null
  provider_credential_id?: string | null
  ref?: string | null
  type?: string | null
  value?: string | null
  variable?: string | null
  [key: string]: unknown
}

export type AgentEnvVariableConfig = {
  default?:
    | string
    | number
    | number
    | boolean
    | Array<string>
    | Array<number>
    | Array<number>
    | Array<boolean>
    | null
  env_name?: string | null
  key?: string | null
  name?: string | null
  required?: boolean
  type?: string | null
  value?:
    | string
    | number
    | number
    | boolean
    | Array<string>
    | Array<number>
    | Array<number>
    | Array<boolean>
    | null
  variable?: string | null
  [key: string]: unknown
}

export type AgentFileRefConfig = {
  drive_key?: string | null
  file_id?: string | null
  id?: string | null
  name?: string | null
  reference?: string | null
  remote_url?: string | null
  tenant_id?: string | null
  transfer_method?: string | null
  type?: string | null
  upload_file_id?: string | null
  url?: string | null
  [key: string]: unknown
}

export type AgentSkillRefConfig = {
  description?: string | null
  file_id?: string | null
  full_archive_file_id?: string | null
  full_archive_key?: string | null
  id?: string | null
  manifest_files?: Array<string> | null
  name?: string | null
  path?: string | null
  skill_md_file_id?: string | null
  skill_md_key?: string | null
  [key: string]: unknown
}

export type AgentHumanToolConfig = {
  description?: string | null
  enabled?: boolean
  name?: string | null
  [key: string]: unknown
}

export type AgentKnowledgeSetConfig = {
  datasets: Array<AgentKnowledgeDatasetConfig>
  description?: string | null
  id: string
  metadata_filtering?: AgentKnowledgeMetadataFilteringConfig
  name: string
  query: AgentKnowledgeQueryConfig
  retrieval: AgentKnowledgeRetrievalConfig
}

export type AgentMemoryArtifactConfig = {
  id?: string | null
  name?: string | null
  type?: string | null
  url?: string | null
  [key: string]: unknown
}

export type AgentSoulModelCredentialRef = {
  id?: string | null
  provider?: string | null
  type: string
}

export type AgentSoulModelSettings = {
  frequency_penalty?: number | null
  max_tokens?: number | null
  presence_penalty?: number | null
  response_format?: AgentModelResponseFormatConfig | null
  stop?: Array<string> | null
  temperature?: number | null
  top_p?: number | null
}

export type AgentSandboxProviderConfig = {
  cpu?: number | null
  env?: Array<AgentEnvVariableConfig>
  image?: string | null
  working_dir?: string | null
  [key: string]: unknown
}

export type AgentSoulDifyToolConfig = {
  credential_ref?: AgentSoulDifyToolCredentialRef | null
  credential_type?: 'api-key' | 'oauth2' | 'unauthorized'
  description?: string | null
  enabled?: boolean
  name?: string | null
  plugin_id?: string | null
  provider?: string | null
  provider_id?: string | null
  provider_type: ToolProviderType
  runtime_parameters?: {
    [key: string]:
      | string
      | number
      | number
      | boolean
      | Array<string>
      | Array<number>
      | Array<number>
      | Array<boolean>
      | null
  }
  tool_name?: string | null
}

export type OutputErrorStrategy = 'default_value' | 'fail_branch' | 'stop'

export type DeclaredOutputRetryConfig = {
  enabled?: boolean
  max_retries?: number
  retry_interval_ms?: number
}

export type AgentCliToolAuthorizationStatus =
  | 'allowed'
  | 'authorized'
  | 'denied'
  | 'forbidden'
  | 'not_required'
  | 'pending'
  | 'pre_authorized'
  | 'unauthorized'

export type AgentCliToolEnvConfig = {
  secret_refs?: Array<AgentSecretRefConfig>
  variables?: Array<AgentEnvVariableConfig>
}

export type AgentPermissionConfig = {
  allowed?: boolean | null
  state?: string | null
  status?: string | null
}

export type AgentCliToolRiskLevel = 'dangerous' | 'safe' | 'unknown'

export type AgentComposerKnowledgeDatasetCandidateResponse = {
  description?: string | null
  id?: string | null
  missing?: boolean
  name?: string | null
}

export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video'

export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file'

export type AgentFileUploadImageFeatureConfig = {
  enabled?: boolean
  [key: string]: unknown
}

export type AgentModerationProviderConfig = {
  api_based_extension_id?: string | null
  inputs_config?: AgentModerationIoConfig | null
  keywords?: string | null
  outputs_config?: AgentModerationIoConfig | null
  [key: string]: unknown
}

export type AgentSuggestedQuestionsAfterAnswerModelConfig = {
  completion_params?: {
    [key: string]: unknown
  } | null
  mode?: string | null
  name: string
  provider: string
  [key: string]: unknown
}

export type AgentKnowledgeDatasetConfig = {
  description?: string | null
  id?: string | null
  name?: string | null
}

export type AgentKnowledgeMetadataFilteringConfig = {
  conditions?: AgentKnowledgeMetadataConditions | null
  mode?: 'automatic' | 'disabled' | 'manual'
  model_config?: AgentKnowledgeModelConfig | null
}

export type AgentKnowledgeQueryConfig = {
  mode: AgentKnowledgeQueryMode
  value?: string | null
}

export type AgentKnowledgeRetrievalConfig = {
  mode: 'multiple' | 'single'
  model?: AgentKnowledgeModelConfig | null
  reranking_enable?: boolean
  reranking_mode?: string
  reranking_model?: AgentKnowledgeRerankingModelConfig | null
  score_threshold?: number | null
  top_k?: number | null
  weights?: AgentKnowledgeWeightedScoreConfig | null
}

export type AgentModelResponseFormatConfig = {
  type?: string | null
  [key: string]: unknown
}

export type AgentSoulDifyToolCredentialRef = {
  id?: string | null
  provider?: string | null
  type?: 'provider' | 'tool'
}

export type ToolProviderType =
  | 'api'
  | 'app'
  | 'builtin'
  | 'dataset-retrieval'
  | 'mcp'
  | 'plugin'
  | 'workflow'

export type AgentModerationIoConfig = {
  enabled?: boolean
  preset_response?: string | null
  [key: string]: unknown
}

export type AgentKnowledgeMetadataConditions = {
  conditions?: Array<AgentKnowledgeMetadataCondition>
  logical_operator?: 'and' | 'or'
}

export type AgentKnowledgeModelConfig = {
  completion_params?: {
    [key: string]: unknown
  }
  mode: string
  name: string
  provider: string
}

export type AgentKnowledgeQueryMode = 'generated_query' | 'user_query'

export type AgentKnowledgeRerankingModelConfig = {
  model: string
  provider: string
}

export type AgentKnowledgeWeightedScoreConfig = {
  keyword_setting?: {
    [key: string]: unknown
  } | null
  vector_setting?: {
    [key: string]: unknown
  } | null
  weight_type?: string | null
  [key: string]: unknown
}

export type AgentKnowledgeMetadataCondition = {
  comparison_operator:
    | '<'
    | '='
    | '>'
    | 'after'
    | 'before'
    | 'contains'
    | 'empty'
    | 'end with'
    | 'in'
    | 'is'
    | 'is not'
    | 'not contains'
    | 'not empty'
    | 'not in'
    | 'start with'
    | '≠'
    | '≤'
    | '≥'
  name: string
  value?: string | Array<string> | number | null
}

export type GetSnippetsBySnippetIdWorkflowRunsData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: {
    last_id?: string
    limit?: number
  }
  url: '/snippets/{snippet_id}/workflow-runs'
}

export type GetSnippetsBySnippetIdWorkflowRunsResponses = {
  200: WorkflowRunPaginationResponse
}

export type GetSnippetsBySnippetIdWorkflowRunsResponse =
  GetSnippetsBySnippetIdWorkflowRunsResponses[keyof GetSnippetsBySnippetIdWorkflowRunsResponses]

export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopData = {
  body?: never
  path: {
    snippet_id: string
    task_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflow-runs/tasks/{task_id}/stop'
}

export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopErrors = {
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponses = {
  200: SimpleResultResponse
}

export type PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponse =
  PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponses[keyof PostSnippetsBySnippetIdWorkflowRunsTasksByTaskIdStopResponses]

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdData = {
  body?: never
  path: {
    run_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflow-runs/{run_id}'
}

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdResponses = {
  200: WorkflowRunDetailResponse
}

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdResponse =
  GetSnippetsBySnippetIdWorkflowRunsByRunIdResponses[keyof GetSnippetsBySnippetIdWorkflowRunsByRunIdResponses]

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdNodeExecutionsData = {
  body?: never
  path: {
    run_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflow-runs/{run_id}/node-executions'
}

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdNodeExecutionsResponses = {
  200: WorkflowRunNodeExecutionListResponse
}

export type GetSnippetsBySnippetIdWorkflowRunsByRunIdNodeExecutionsResponse =
  GetSnippetsBySnippetIdWorkflowRunsByRunIdNodeExecutionsResponses[keyof GetSnippetsBySnippetIdWorkflowRunsByRunIdNodeExecutionsResponses]

export type GetSnippetsBySnippetIdWorkflowsData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: {
    limit?: number
    page?: number
  }
  url: '/snippets/{snippet_id}/workflows'
}

export type GetSnippetsBySnippetIdWorkflowsResponses = {
  200: SnippetWorkflowPaginationResponse
}

export type GetSnippetsBySnippetIdWorkflowsResponse =
  GetSnippetsBySnippetIdWorkflowsResponses[keyof GetSnippetsBySnippetIdWorkflowsResponses]

export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/default-workflow-block-configs'
}

export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponses = {
  200: DefaultBlockConfigsResponse
}

export type GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponse =
  GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponses[keyof GetSnippetsBySnippetIdWorkflowsDefaultWorkflowBlockConfigsResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft'
}

export type GetSnippetsBySnippetIdWorkflowsDraftErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowsDraftResponses = {
  200: SnippetWorkflowResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftResponse =
  GetSnippetsBySnippetIdWorkflowsDraftResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftData = {
  body: SnippetDraftSyncPayload
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft'
}

export type PostSnippetsBySnippetIdWorkflowsDraftErrors = {
  400: unknown
}

export type PostSnippetsBySnippetIdWorkflowsDraftResponses = {
  200: WorkflowRestoreResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftResponse =
  PostSnippetsBySnippetIdWorkflowsDraftResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftConfigData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/config'
}

export type GetSnippetsBySnippetIdWorkflowsDraftConfigResponses = {
  200: SnippetDraftConfigResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftConfigResponse =
  GetSnippetsBySnippetIdWorkflowsDraftConfigResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftConfigResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftConversationVariablesData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/conversation-variables'
}

export type GetSnippetsBySnippetIdWorkflowsDraftConversationVariablesResponses = {
  200: WorkflowDraftVariableList
}

export type GetSnippetsBySnippetIdWorkflowsDraftConversationVariablesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftConversationVariablesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftConversationVariablesResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/environment-variables'
}

export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponses = {
  200: EnvironmentVariableListResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftEnvironmentVariablesResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunData = {
  body: SnippetIterationNodeRunPayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/iteration/nodes/{node_id}/run'
}

export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunErrors = {
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponses = {
  200: GeneratedAppResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponse =
  PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftIterationNodesByNodeIdRunResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunData = {
  body: SnippetLoopNodeRunPayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/loop/nodes/{node_id}/run'
}

export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunErrors = {
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponses = {
  200: GeneratedAppResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponse =
  PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftLoopNodesByNodeIdRunResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerData = {
  body?: never
  path: {
    node_id: string
    snippet_id: string
  }
  query?: {
    snapshot_id?: string
  }
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer'
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses = {
  200: WorkflowAgentComposerResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponse =
  GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses]

export type PutSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerData = {
  body: ComposerSavePayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer'
}

export type PutSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses = {
  200: WorkflowAgentComposerResponse
}

export type PutSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponse =
  PutSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses[keyof PutSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesData = {
  body?: never
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/candidates'
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponses = {
  200: AgentComposerCandidatesResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCopyFromRosterData = {
  body: WorkflowComposerCopyFromRosterPayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/copy-from-roster'
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCopyFromRosterResponses =
  {
    200: WorkflowAgentComposerResponse
  }

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCopyFromRosterResponse =
  PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCopyFromRosterResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerCopyFromRosterResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerImpactData = {
  body: ComposerSavePayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/impact'
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponses = {
  200: AgentComposerImpactResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponse =
  PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterData = {
  body: ComposerSavePayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/save-to-roster'
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponses = {
  200: WorkflowAgentComposerResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponse =
  PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerValidateData = {
  body: ComposerSavePayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/validate'
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponses = {
  200: AgentComposerValidateResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponse =
  PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunData = {
  body?: never
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/last-run'
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunResponses = {
  200: WorkflowRunNodeExecutionResponse
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunResponse =
  GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdLastRunResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunData = {
  body: SnippetDraftNodeRunPayload
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/run'
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunErrors = {
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunResponses = {
  200: WorkflowRunNodeExecutionResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunResponse =
  PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdRunResponses]

export type DeleteSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesData = {
  body?: never
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/variables'
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses = {
  204: void
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponse =
  DeleteSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses[keyof DeleteSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesData = {
  body?: never
  path: {
    node_id: string
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/nodes/{node_id}/variables'
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses = {
  200: WorkflowDraftVariableList
}

export type GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftNodesByNodeIdVariablesResponses]

export type PostSnippetsBySnippetIdWorkflowsDraftRunData = {
  body: SnippetDraftRunPayload
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/run'
}

export type PostSnippetsBySnippetIdWorkflowsDraftRunErrors = {
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowsDraftRunResponses = {
  200: GeneratedAppResponse
}

export type PostSnippetsBySnippetIdWorkflowsDraftRunResponse =
  PostSnippetsBySnippetIdWorkflowsDraftRunResponses[keyof PostSnippetsBySnippetIdWorkflowsDraftRunResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftSystemVariablesData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/system-variables'
}

export type GetSnippetsBySnippetIdWorkflowsDraftSystemVariablesResponses = {
  200: WorkflowDraftVariableList
}

export type GetSnippetsBySnippetIdWorkflowsDraftSystemVariablesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftSystemVariablesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftSystemVariablesResponses]

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/variables'
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesResponses = {
  204: void
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesResponse =
  DeleteSnippetsBySnippetIdWorkflowsDraftVariablesResponses[keyof DeleteSnippetsBySnippetIdWorkflowsDraftVariablesResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: {
    limit?: number
    page?: number
  }
  url: '/snippets/{snippet_id}/workflows/draft/variables'
}

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesResponses = {
  200: WorkflowDraftVariableListWithoutValue
}

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesResponse =
  GetSnippetsBySnippetIdWorkflowsDraftVariablesResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftVariablesResponses]

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = {
  body?: never
  path: {
    snippet_id: string
    variable_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/variables/{variable_id}'
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = {
  404: unknown
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = {
  204: void
}

export type DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponse =
  DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses[keyof DeleteSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses]

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = {
  body?: never
  path: {
    snippet_id: string
    variable_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/variables/{variable_id}'
}

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = {
  200: WorkflowDraftVariable
}

export type GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponse =
  GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses[keyof GetSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses]

export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdData = {
  body: WorkflowDraftVariableUpdatePayload
  path: {
    snippet_id: string
    variable_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/variables/{variable_id}'
}

export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdErrors = {
  404: unknown
}

export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses = {
  200: WorkflowDraftVariable
}

export type PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponse =
  PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses[keyof PatchSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResponses]

export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetData = {
  body?: never
  path: {
    snippet_id: string
    variable_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/draft/variables/{variable_id}/reset'
}

export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetErrors = {
  404: unknown
}

export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetResponses = {
  200: WorkflowDraftVariable
  204: void
}

export type PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetResponse =
  PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetResponses[keyof PutSnippetsBySnippetIdWorkflowsDraftVariablesByVariableIdResetResponses]

export type GetSnippetsBySnippetIdWorkflowsPublishData = {
  body?: never
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/publish'
}

export type GetSnippetsBySnippetIdWorkflowsPublishErrors = {
  404: unknown
}

export type GetSnippetsBySnippetIdWorkflowsPublishResponses = {
  200: SnippetWorkflowResponse
}

export type GetSnippetsBySnippetIdWorkflowsPublishResponse =
  GetSnippetsBySnippetIdWorkflowsPublishResponses[keyof GetSnippetsBySnippetIdWorkflowsPublishResponses]

export type PostSnippetsBySnippetIdWorkflowsPublishData = {
  body: PublishWorkflowPayload
  path: {
    snippet_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/publish'
}

export type PostSnippetsBySnippetIdWorkflowsPublishErrors = {
  400: unknown
}

export type PostSnippetsBySnippetIdWorkflowsPublishResponses = {
  200: WorkflowPublishResponse
}

export type PostSnippetsBySnippetIdWorkflowsPublishResponse =
  PostSnippetsBySnippetIdWorkflowsPublishResponses[keyof PostSnippetsBySnippetIdWorkflowsPublishResponses]

export type PatchSnippetsBySnippetIdWorkflowsByWorkflowIdData = {
  body: WorkflowUpdatePayload
  path: {
    snippet_id: string
    workflow_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/{workflow_id}'
}

export type PatchSnippetsBySnippetIdWorkflowsByWorkflowIdErrors = {
  400: unknown
  404: unknown
}

export type PatchSnippetsBySnippetIdWorkflowsByWorkflowIdResponses = {
  200: SnippetWorkflowResponse
}

export type PatchSnippetsBySnippetIdWorkflowsByWorkflowIdResponse =
  PatchSnippetsBySnippetIdWorkflowsByWorkflowIdResponses[keyof PatchSnippetsBySnippetIdWorkflowsByWorkflowIdResponses]

export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreData = {
  body?: never
  path: {
    snippet_id: string
    workflow_id: string
  }
  query?: never
  url: '/snippets/{snippet_id}/workflows/{workflow_id}/restore'
}

export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreErrors = {
  400: unknown
  404: unknown
}

export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponses = {
  200: WorkflowRestoreResponse
}

export type PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponse =
  PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponses[keyof PostSnippetsBySnippetIdWorkflowsByWorkflowIdRestoreResponses]
