{
  "swagger": "2.0",
  "info": {
    "title": "dataapi/service.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "DataAPIService"
    },
    {
      "name": "DataAPIGatewayService"
    },
    {
      "name": "DataAPIExecutorService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {},
  "definitions": {
    "baseBaseResp": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "errCode": {
          "type": "string",
          "format": "int64"
        },
        "errMsg": {
          "type": "string"
        }
      }
    },
    "dataapiAPIKeySource": {
      "type": "string",
      "enum": [
        "DataAPI_Source_UNSPECIFIED",
        "DataAPI_Source_Chat2Query_Console",
        "DataAPI_Source_DataAPI_Console",
        "DataAPI_Source_Vercel_Console"
      ],
      "default": "DataAPI_Source_UNSPECIFIED"
    },
    "dataapiAppInfo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "orgId": {
          "type": "string",
          "format": "uint64"
        },
        "projectId": {
          "type": "string",
          "format": "uint64"
        },
        "externalAppId": {
          "type": "string"
        },
        "appName": {
          "type": "string"
        },
        "appType": {
          "type": "string"
        },
        "deploymentRegion": {
          "type": "string"
        },
        "createdBy": {
          "type": "string"
        },
        "updatedBy": {
          "type": "string"
        },
        "isDeleted": {
          "type": "integer",
          "format": "int32"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        },
        "serviceUrl": {
          "type": "string"
        }
      }
    },
    "dataapiAuthAPIKeyResp": {
      "type": "object",
      "properties": {
        "authFlag": {
          "type": "boolean"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiCloseSessionResp": {
      "type": "object",
      "properties": {
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiClusterStatus": {
      "type": "string",
      "enum": [
        "Unsupported",
        "NeedCreate",
        "Creating",
        "Normal"
      ],
      "default": "Unsupported"
    },
    "dataapiClusterStatusInfo": {
      "type": "object",
      "properties": {
        "clusterId": {
          "type": "string",
          "format": "uint64"
        },
        "status": {
          "$ref": "#/definitions/dataapiClusterStatus"
        },
        "isDedicated": {
          "type": "boolean"
        }
      }
    },
    "dataapiColumn": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "dataType": {
          "type": "string"
        },
        "nullable": {
          "type": "boolean"
        }
      }
    },
    "dataapiCreateAPIKeyResp": {
      "type": "object",
      "properties": {
        "accessKey": {
          "type": "string"
        },
        "secretKey": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiCreateDataAppResp": {
      "type": "object",
      "properties": {
        "appInfo": {
          "$ref": "#/definitions/dataapiAppInfo"
        },
        "endpoints": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiEndpoint"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiCreateSessionResp": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiCredential": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/dataapiCrtType"
        },
        "key": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        }
      }
    },
    "dataapiCrtType": {
      "type": "string",
      "enum": [
        "AUTH0",
        "APIKEY",
        "ACCOUNT",
        "MIXED",
        "EMAIL"
      ],
      "default": "AUTH0"
    },
    "dataapiDeleteAPIKeyResp": {
      "type": "object",
      "properties": {
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiDeleteDataAppResp": {
      "type": "object",
      "properties": {
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiEndpoint": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "dataappId": {
          "type": "string",
          "format": "uint64"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "endpoint": {
          "type": "string"
        }
      }
    },
    "dataapiEndpointCodeExampleResp": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiExecSqlResp": {
      "type": "object",
      "properties": {
        "Code": {
          "type": "string",
          "format": "int64"
        },
        "Message": {
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiRow"
          }
        },
        "columns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiColumn"
          }
        },
        "startMs": {
          "type": "string",
          "format": "int64"
        },
        "endMs": {
          "type": "string",
          "format": "int64"
        },
        "affect": {
          "type": "string",
          "format": "int64"
        },
        "rowNum": {
          "type": "string",
          "format": "int64"
        },
        "databases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stmtType": {
          "$ref": "#/definitions/dataapiStmtType"
        },
        "warnCount": {
          "type": "integer",
          "format": "int32"
        },
        "warnMessages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiExecSqlRespV2": {
      "type": "object",
      "properties": {
        "stmtResults": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiExecStmtResult"
          }
        },
        "bytesCount": {
          "type": "string",
          "format": "int64"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiExecStmtResult": {
      "type": "object",
      "properties": {
        "errCode": {
          "type": "string",
          "format": "int64"
        },
        "errMessage": {
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiRow"
          }
        },
        "columns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiColumn"
          }
        },
        "startMs": {
          "type": "string",
          "format": "int64"
        },
        "endMs": {
          "type": "string",
          "format": "int64"
        },
        "affect": {
          "type": "string",
          "format": "int64"
        },
        "rowNum": {
          "type": "string",
          "format": "int64"
        },
        "databases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stmtType": {
          "$ref": "#/definitions/dataapiStmtType"
        },
        "stmtSql": {
          "type": "string"
        },
        "limitRows": {
          "type": "string",
          "format": "uint64"
        },
        "lastInsertId": {
          "type": "string",
          "format": "int64"
        },
        "warnCount": {
          "type": "integer",
          "format": "int32"
        },
        "warnMessages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiWarnMessage"
          }
        }
      }
    },
    "dataapiGetClusterMetaResp": {
      "type": "object",
      "properties": {
        "metas": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiTableMeta"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiGetClusterStatusResp": {
      "type": "object",
      "properties": {
        "status": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiClusterStatusInfo"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiGetDatabaseMetaResp": {
      "type": "object",
      "properties": {
        "metas": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiTableMeta"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiListAPIKeyResp": {
      "type": "object",
      "properties": {
        "apikeys": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiapikey"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiListDataAppResp": {
      "type": "object",
      "properties": {
        "appList": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiAppInfo"
          }
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiParseOneStmtResp": {
      "type": "object",
      "properties": {
        "stmtType": {
          "$ref": "#/definitions/dataapiStmtType"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiRow": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "dataapiSessionCmd": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "dataapiSessionItem": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "endSec": {
          "type": "string",
          "format": "uint64"
        },
        "database": {
          "type": "string"
        },
        "lastActiveTime": {
          "type": "string",
          "format": "uint64"
        },
        "crtId": {
          "type": "string"
        },
        "clusterId": {
          "type": "string",
          "format": "uint64"
        },
        "expireSec": {
          "type": "string",
          "format": "uint64"
        },
        "cmds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataapiSessionCmd"
          }
        },
        "executorEndpoint": {
          "type": "string"
        }
      }
    },
    "dataapiSettings": {
      "type": "object",
      "properties": {
        "timeout": {
          "type": "string",
          "format": "uint64"
        },
        "rowLimit": {
          "type": "string",
          "format": "uint64"
        },
        "enablePagination": {
          "type": "integer",
          "format": "int32"
        },
        "cacheEnabled": {
          "type": "integer",
          "format": "int32"
        },
        "cacheTtl": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "dataapiShowAPIKeyResp": {
      "type": "object",
      "properties": {
        "rawKey": {
          "type": "string"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiShowDataAppResp": {
      "type": "object",
      "properties": {
        "appInfo": {
          "$ref": "#/definitions/dataapiAppInfo"
        },
        "baseResp": {
          "$ref": "#/definitions/baseBaseResp"
        }
      }
    },
    "dataapiStmtType": {
      "type": "string",
      "enum": [
        "Other",
        "Select",
        "Insert",
        "Update",
        "Delete",
        "DropDatabase",
        "DropTable",
        "DropIndex",
        "AlterTable",
        "Show",
        "Explain",
        "Use"
      ],
      "default": "Other"
    },
    "dataapiTableMeta": {
      "type": "object",
      "properties": {
        "table": {
          "type": "string"
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "database": {
          "type": "string"
        }
      }
    },
    "dataapiWarnMessage": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "dataapiapikey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "description": {
          "type": "string"
        },
        "createdBy": {
          "type": "string"
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    }
  }
}
