{
    "swagger": "2.0",
    "info": {
        "description": "This is sql editor server",
        "title": "SQL Editor API",
        "contact": {},
        "version": "1.0"
    },
    "host": "127.0.0.1:8080",
    "basePath": "/api/v1/dataapps/sqleditor",
    "paths": {
        "/orgs/{org_id}/projects/{project_id}/bot": {
            "post": {
                "description": "chat with bot",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "message"
                ],
                "summary": "chat with bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.InteractRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.InteractResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/status": {
            "get": {
                "description": "check cluster status",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "check cluster status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ClusterStatusRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/dataapi/sample": {
            "get": {
                "description": "show chat2data sample url",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show chat2data sample url",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GenericSuccessApiResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/dbs/{db_name}/{table_name}/exist": {
            "get": {
                "description": "is table exist",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "is table exist",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "db name",
                        "name": "db_name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "table_name",
                        "name": "table_name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.IsDBTableExistRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/dbs/{db_name}/{table_name}/meta": {
            "get": {
                "description": "table meta",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show table meta",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "db name",
                        "name": "db_name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "table_name",
                        "name": "table_name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowTableMetaRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/meta": {
            "get": {
                "description": "show all db meta",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show all db meta",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "value: true or false",
                        "name": "isbrief",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ClusterMetaRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/oplog": {
            "post": {
                "description": "create oplog",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "create oplog",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.SqlEditorOplogParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.BasicRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/sample/initialize": {
            "post": {
                "description": "import fortune500",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "import fortune500",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.SampleInitializeRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/schemas/databases": {
            "get": {
                "description": "list databases in a cluster",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "list databases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowDBsRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/schemas/databases/{db_name}/tables": {
            "get": {
                "description": "list tables in a database",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "list tables by database",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "db name",
                        "name": "db_name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowTablesRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/schemas/databases/{db_name}/tables/{table_name}/columns": {
            "get": {
                "description": "list columns in a table",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "list columns by database and table",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "db name",
                        "name": "db_name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "table name",
                        "name": "table_name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowColumnsRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/schemas/search": {
            "get": {
                "description": "search schema objects by keyword and type(database/table/column)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "search databases/tables/columns",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "database|table|column",
                        "name": "type",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "search keyword",
                        "name": "keyword",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "max results, default 100, max 1000",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.SchemaSearchRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/session": {
            "post": {
                "description": "create session result",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "create session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.SessionParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.SessionRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/session/{session_id}": {
            "delete": {
                "description": "close session result",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "close session",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "session ID",
                        "name": "session_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.SessionRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/settings": {
            "get": {
                "description": "show settings",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show settings",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowSettingsRes"
                        }
                    }
                }
            },
            "put": {
                "description": "update settings",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "update settings",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.Settings"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateSettingsRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/sqlfiles": {
            "get": {
                "description": "list sql file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "list sql file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ListSQLFileRes"
                        }
                    }
                }
            },
            "post": {
                "description": "create sql file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "create sql file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.SqlEditorFile"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.CreateSQLFileRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/sqlfiles/{sql_file_id}": {
            "get": {
                "description": "show sql file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show sql file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "sql file ID",
                        "name": "sql_file_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowSQLFileRes"
                        }
                    }
                }
            },
            "put": {
                "description": "update sql file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "update sql file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "sql file ID",
                        "name": "sql_file_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.SqlEditorFile"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateSQLFileRes"
                        }
                    }
                }
            },
            "delete": {
                "description": "delete sql file",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "delete sql file",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "sql file ID",
                        "name": "sql_file_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.DeleteSQLFileRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/statements": {
            "post": {
                "description": "execute sql result",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "execute sql",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.StatementParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.StatementsRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/clusters/{cluster}/enter/audit": {
            "get": {
                "description": "enter chat2query audit log",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "enter chat2query audit log",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GenericSuccessApiResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/permission/entry": {
            "get": {
                "description": "serverless permission to entrance",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "serverless permission to entrance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ServerlessPermission2EntryRes"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/settings": {
            "put": {
                "description": "update dataapp info",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "update dataapp info",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.DataAppSettingsFormat"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GenericSuccessApiResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/projects/{project_id}/users": {
            "get": {
                "description": "show user info",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "show user info",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ShowUserInfoRes"
                        }
                    }
                }
            },
            "put": {
                "description": "update user info",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sqleditor"
                ],
                "summary": "update user info",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org ID",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "project ID",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster ID",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "request_body",
                        "name": "request_body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/entity.UserInfoParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.UpdateUserInfoRes"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "dto.BasicRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ClusterMetaRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.DBMeta"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ClusterStatus": {
            "type": "object",
            "properties": {
                "cluster_id": {
                    "type": "string",
                    "example": "0"
                },
                "is_dedicated": {
                    "type": "boolean"
                },
                "link_status": {
                    "description": "private link status, 0=Unsupported, 1=NeedCreate, 2=Creating, 3=Normal",
                    "type": "integer"
                }
            }
        },
        "dto.ClusterStatusRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.ClusterStatus"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ClusterSupport": {
            "type": "object",
            "properties": {
                "cluster_id": {
                    "type": "string",
                    "example": "0"
                },
                "is_support": {
                    "description": "private link status, 0=Unsupported, 1=NeedCreate, 2=Creating, 3=Normal",
                    "type": "boolean"
                }
            }
        },
        "dto.CreateSQLFileRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "integer"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.DatabaseItem": {
            "type": "object",
            "properties": {
                "has_table": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "dto.DeleteSQLFileRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.GenericSuccessApiResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.InteractRequest": {
            "type": "object",
            "properties": {
                "async": {
                    "type": "boolean"
                },
                "bot_type": {
                    "type": "string"
                },
                "cluster_id": {
                    "type": "string"
                },
                "database": {
                    "type": "string"
                },
                "database_schema": {
                    "type": "string"
                },
                "prompt_template": {
                    "type": "string"
                },
                "prompt_template_version": {
                    "type": "string"
                },
                "question": {
                    "type": "string"
                },
                "question_num": {
                    "type": "integer"
                },
                "sample_data": {
                    "type": "string"
                },
                "session_id": {
                    "type": "string"
                },
                "sql_file_id": {
                    "type": "integer"
                },
                "tables": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "dto.InteractResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "database": {
                    "type": "string"
                },
                "end_time": {
                    "type": "string"
                },
                "end_time_ms": {
                    "type": "integer"
                },
                "execute_time": {
                    "type": "string"
                },
                "job_id": {
                    "type": "string"
                },
                "prompt": {
                    "type": "string"
                },
                "prompt_version": {
                    "type": "string"
                },
                "question": {
                    "type": "string"
                },
                "response": {
                    "type": "string"
                },
                "session_id": {
                    "type": "string"
                },
                "start_time": {
                    "type": "string"
                },
                "start_time_ms": {
                    "type": "integer"
                },
                "token_used": {
                    "type": "integer"
                }
            }
        },
        "dto.IsDBTableExistRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.IsDBTableExist"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ListSQLFileRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.SqlEditorFile"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.SampleInitializeRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.SchemaSearchItem": {
            "type": "object",
            "properties": {
                "column": {
                    "type": "string"
                },
                "data_type": {
                    "type": "string"
                },
                "database": {
                    "type": "string"
                },
                "has_table": {
                    "description": "HasTable is set when Type=database, indicating whether the database has any table.",
                    "type": "boolean"
                },
                "nullable": {
                    "type": "boolean"
                },
                "table": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/dto.SchemaSearchType"
                }
            }
        },
        "dto.SchemaSearchRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.SchemaSearchItem"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.SchemaSearchType": {
            "type": "string",
            "enum": [
                "database",
                "table",
                "column"
            ],
            "x-enum-varnames": [
                "SchemaSearchTypeDatabase",
                "SchemaSearchTypeTable",
                "SchemaSearchTypeColumn"
            ]
        },
        "dto.ServerlessPermission2EntryRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.ClusterSupport"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.SessionRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowColumnsRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.Columns"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowDBsRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.DatabaseItem"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowSQLFileRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.SqlEditorFile"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowSettingsRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.Settings"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowTableMetaRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.MetaRes"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowTablesRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.ShowUserInfoRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.UserInfo"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.StatementsRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "$ref": "#/definitions/entity.DataRes"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.UpdateSQLFileRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.UpdateSettingsRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "dto.UpdateUserInfoRes": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "entity.Columns": {
            "type": "object",
            "properties": {
                "col": {
                    "type": "string"
                },
                "data_type": {
                    "type": "string"
                },
                "nullable": {
                    "type": "boolean"
                }
            }
        },
        "entity.DBMeta": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "tables": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.TablesMeta"
                    }
                }
            }
        },
        "entity.DataAppSettingsFormat": {
            "type": "object",
            "properties": {
                "enable_dataapi": {
                    "type": "boolean"
                }
            }
        },
        "entity.DataRes": {
            "type": "object",
            "properties": {
                "columns": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.Columns"
                    }
                },
                "databases": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "end_time": {
                    "type": "string"
                },
                "end_time_ms": {
                    "type": "integer"
                },
                "execute_time": {
                    "type": "string"
                },
                "limit": {
                    "type": "integer"
                },
                "query": {
                    "type": "string"
                },
                "row_count": {
                    "type": "integer"
                },
                "rows": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "start_time": {
                    "type": "string"
                },
                "start_time_ms": {
                    "type": "integer"
                },
                "warn_count": {
                    "type": "integer"
                },
                "warn_messages": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "entity.EventType": {
            "type": "string",
            "enum": [
                "gen_sql",
                "sql_accept",
                "exec_sql"
            ],
            "x-enum-varnames": [
                "EventTypeGenSql",
                "EventTypeSqlAccept",
                "EventTypeExecSql"
            ]
        },
        "entity.IsDBTableExist": {
            "type": "object",
            "properties": {
                "is_exist": {
                    "type": "boolean"
                },
                "session_id": {
                    "type": "string"
                }
            }
        },
        "entity.MetaRes": {
            "type": "object",
            "properties": {
                "clusterid": {
                    "type": "integer"
                },
                "columns": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.Columns"
                    }
                },
                "database": {
                    "type": "string"
                },
                "table": {
                    "type": "string"
                }
            }
        },
        "entity.SessionParam": {
            "type": "object",
            "properties": {
                "database": {
                    "type": "string"
                }
            }
        },
        "entity.Settings": {
            "type": "object",
            "properties": {
                "enable_dataapi": {
                    "type": "boolean"
                },
                "limit": {
                    "type": "integer"
                },
                "show_system_db_schema": {
                    "type": "boolean"
                }
            }
        },
        "entity.SqlEditorFile": {
            "type": "object",
            "properties": {
                "cluster_id": {
                    "type": "integer"
                },
                "content": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "string"
                },
                "database": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_deleted": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "org_id": {
                    "type": "integer"
                },
                "project_id": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by": {
                    "type": "string"
                }
            }
        },
        "entity.SqlEditorOplogParam": {
            "type": "object",
            "required": [
                "event_type",
                "session_id",
                "sql_file_id"
            ],
            "properties": {
                "affected_rows": {
                    "type": "integer"
                },
                "chat2query_sid": {
                    "type": "string"
                },
                "end_time": {
                    "type": "integer"
                },
                "error_message": {
                    "type": "string"
                },
                "event_type": {
                    "$ref": "#/definitions/entity.EventType"
                },
                "is_accept": {
                    "type": "boolean"
                },
                "is_modified": {
                    "type": "boolean"
                },
                "prompt_version": {
                    "type": "string"
                },
                "session_id": {
                    "type": "string"
                },
                "sql_content": {
                    "type": "string"
                },
                "sql_file_id": {
                    "type": "integer"
                },
                "start_time": {
                    "type": "integer"
                },
                "status": {
                    "type": "integer"
                },
                "user_question": {
                    "type": "string"
                }
            }
        },
        "entity.StatementParam": {
            "type": "object",
            "required": [
                "sessionid"
            ],
            "properties": {
                "chat2query_sid": {
                    "type": "string"
                },
                "database": {
                    "type": "string"
                },
                "sessionid": {
                    "type": "string"
                },
                "sql": {
                    "type": "string"
                },
                "sql_file_id": {
                    "type": "integer"
                }
            }
        },
        "entity.TablesMeta": {
            "type": "object",
            "properties": {
                "columns": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/entity.Columns"
                    }
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "entity.UserInfo": {
            "type": "object",
            "properties": {
                "chat2query_init": {
                    "type": "boolean"
                },
                "created_by": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_privacy_allowed": {
                    "type": "boolean"
                },
                "privacy_box_count": {
                    "type": "integer"
                }
            }
        },
        "entity.UserInfoParam": {
            "type": "object",
            "properties": {
                "chat2query_init": {
                    "type": "boolean"
                },
                "is_privacy_allowed": {
                    "type": "boolean"
                },
                "privacy_box_count": {
                    "type": "integer"
                }
            }
        }
    }
}