openapi: 3.1.0
info:
  title: Bytebase API Reference
  description: API reference for Bytebase. Every endpoint is served by your own Bytebase instance.
  version: 1.0.0
paths:
  /bytebase.v1.SQLService/GetQueryHistory:
    post:
      tags:
        - SQLService
      summary: GetQueryHistory
      description: |-
        Deprecated: use QueryHistoryService.GetQueryHistory instead.
         Delegating alias kept for upgrade transition; will be removed in a future release.
         No HTTP binding: the REST route is served by QueryHistoryService.
         Permissions required: None (only returns the caller's own query history)
      operationId: SQLService_GetQueryHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.GetQueryHistoryRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.QueryHistory'
      deprecated: true
  /bytebase.v1.SQLService/ListQueryHistories:
    post:
      tags:
        - SQLService
      summary: ListQueryHistories
      description: |-
        Deprecated: use QueryHistoryService.ListQueryHistories instead.
         Delegating alias kept for upgrade transition; will be removed in a future release.
         No HTTP binding: the REST route is served by QueryHistoryService.
         Permissions required: bb.queryHistories.list
      operationId: SQLService_ListQueryHistories
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.ListQueryHistoriesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListQueryHistoriesResponse'
      deprecated: true
  /bytebase.v1.SQLService/SearchQueryHistories:
    post:
      tags:
        - SQLService
      summary: SearchQueryHistories
      description: |-
        Deprecated: use QueryHistoryService.SearchQueryHistories instead.
         Delegating alias kept for upgrade transition; will be removed in a future release.
         No HTTP binding: the REST route is served by QueryHistoryService.
         Permissions required: None (only returns caller's own query histories)
      operationId: SQLService_SearchQueryHistories
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SearchQueryHistoriesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchQueryHistoriesResponse'
      deprecated: true
  /v1/actuator/info:
    get:
      tags:
        - ActuatorService
      summary: GetActuatorInfo
      description: |-
        Gets system information and health status of the Bytebase instance.
         The workspace is resolved from the authenticated session.
         Permissions required: None (authentication required)
      operationId: ActuatorService_GetActuatorInfo
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ActuatorInfo'
  /v1/ai/chat:
    post:
      tags:
        - AIService
      summary: Chat
      description: |-
        Chat sends a conversation with tool definitions to the configured AI provider
         and returns the AI response.
      operationId: AIService_Chat
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.AIChatRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AIChatResponse'
  /v1/auditLogs:export:
    post:
      tags:
        - AuditLogService
      summary: ExportAuditLogs
      description: |-
        Exports audit logs in a specified format for external analysis.
         Permissions required: bb.auditLogs.export
      operationId: AuditLogService_ExportAuditLogs2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsResponse'
  /v1/auditLogs:search:
    post:
      tags:
        - AuditLogService
      summary: SearchAuditLogs
      description: |-
        Searches audit logs with optional filtering and pagination.
         Permissions required: bb.auditLogs.search
      operationId: AuditLogService_SearchAuditLogs2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsResponse'
  /v1/auth/info:
    get:
      tags:
        - AuthService
      summary: GetAuthenticationInfo
      description: |-
        Gets everything the login page renders: the sign-in restrictions and the
         identity providers it offers.
         Permissions required: None
      operationId: AuthService_GetAuthenticationInfo
      parameters:
        - name: workspace
          in: query
          description: |-
            Optional. The workspace whose authentication policy should be returned.
             Format: workspaces/{workspace}
             When unset, self-hosted resolves the singleton workspace and SaaS uses
             the deployment-level defaults.
          schema:
            type: string
            title: workspace
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AuthenticationInfo'
  /v1/auth/login:
    post:
      tags:
        - AuthService
      summary: Login
      description: |-
        Authenticates a user and returns access tokens.
         Permissions required: None
      operationId: AuthService_Login
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.LoginRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.LoginResponse'
  /v1/auth/logout:
    post:
      tags:
        - AuthService
      summary: Logout
      description: |-
        Logs out the current user session.
         Permissions required: None
      operationId: AuthService_Logout
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.LogoutRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/auth/refresh:
    post:
      tags:
        - AuthService
      summary: Refresh
      description: |-
        Refreshes the access token using the refresh token cookie.
         Permissions required: None (validates via refresh token cookie)
      operationId: AuthService_Refresh
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.RefreshRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.RefreshResponse'
  /v1/auth/signup:
    post:
      tags:
        - AuthService
      summary: Signup
      description: |-
        Registers a new user account. Creates a principal and assigns a workspace:
         - If the user's email was pre-invited to a workspace, joins that workspace.
         - Otherwise, creates a new workspace with the user as admin.
         Returns access tokens so the user is logged in immediately after signup.
      operationId: AuthService_Signup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SignupRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.LoginResponse'
  /v1/auth:exchangeToken:
    post:
      tags:
        - AuthService
      summary: ExchangeToken
      description: |-
        Exchanges an external OIDC token for a Bytebase access token.
         Used by CI/CD pipelines with Workload Identity Federation.
         Permissions required: None (validates via OIDC token)
      operationId: AuthService_ExchangeToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.ExchangeTokenRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExchangeTokenResponse'
  /v1/auth:requestPasswordReset:
    post:
      tags:
        - AuthService
      summary: RequestPasswordReset
      description: |-
        Requests a password reset email for the given email address.
         Always returns success to avoid leaking whether the email exists.
         Requires the workspace's SMTP mail delivery setting; without it the
         recovery route is an admin password reset.
         Permissions required: None
      operationId: AuthService_RequestPasswordReset
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.RequestPasswordResetRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/auth:resetPassword:
    post:
      tags:
        - AuthService
      summary: ResetPassword
      description: |-
        Resets the user's password using a password reset token from email.
         Permissions required: None (validates via token)
      operationId: AuthService_ResetPassword
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.ResetPasswordRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/auth:sendEmailLoginCode:
    post:
      tags:
        - AuthService
      summary: SendEmailLoginCode
      description: |-
        Sends a 6-digit verification code to the email for login/signup.
         Always returns success (no email enumeration). Enforces 60-sec resend cooldown.
         The signed-in counterpart is UserService.RequestReauthCode; LOGIN and
         REAUTH codes are not interchangeable.
         Permissions required: None
      operationId: AuthService_SendEmailLoginCode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SendEmailLoginCodeRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/auth:switchWorkspace:
    post:
      tags:
        - AuthService
      summary: SwitchWorkspace
      description: |-
        Switches the current user's active workspace and issues new tokens.
         The user must be a member of the target workspace.
      operationId: AuthService_SwitchWorkspace
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SwitchWorkspaceRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.LoginResponse'
  /v1/cel/batchDeparse:
    post:
      tags:
        - CelService
      summary: BatchDeparse
      description: |-
        Converts multiple CEL AST representations back into expression strings.
         Permissions required: None
      operationId: CelService_BatchDeparse
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.BatchDeparseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchDeparseResponse'
  /v1/cel/batchParse:
    post:
      tags:
        - CelService
      summary: BatchParse
      description: |-
        Parses multiple CEL expression strings into AST representations.
         Permissions required: None
      operationId: CelService_BatchParse
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.BatchParseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchParseResponse'
  /v1/databases:search:
    post:
      tags:
        - DatabaseService
      summary: SearchDatabases
      description: |-
        Searches for databases in every active project where the caller has the bb.databases.get permission, filtered by the specified filter.
         Permissions required: bb.databases.get (checked in each project)
      operationId: DatabaseService_SearchDatabases
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SearchDatabasesRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchDatabasesResponse'
  /v1/environments/{environment}/policies:
    get:
      tags:
        - OrgPolicyService
      summary: ListPolicies
      description: |-
        Lists policies at a specified resource level.
         Permissions required: bb.policies.list
      operationId: OrgPolicyService_ListPolicies3
      parameters:
        - name: environment
          in: path
          description: The environment id.
          required: true
          schema:
            type: string
        - name: policyType
          in: query
          description: Filter by specific policy type.
          schema:
            oneOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
              - type: "null"
            title: policy_type
        - name: showDeleted
          in: query
          description: Show deleted policies if specified.
          schema:
            type: boolean
            title: show_deleted
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
    post:
      tags:
        - OrgPolicyService
      summary: CreatePolicy
      description: |-
        Creates a new organizational policy.
         Permissions required: bb.policies.create
      operationId: OrgPolicyService_CreatePolicy3
      parameters:
        - name: environment
          in: path
          description: The environment id.
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type of policy to create.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
            title: type
      requestBody:
        description: The policy to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: The policy to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/environments/{environment}/policies/{policy}:
    get:
      tags:
        - OrgPolicyService
      summary: GetPolicy
      description: |-
        Retrieves a policy by name.
         Permissions required: bb.policies.get
      operationId: OrgPolicyService_GetPolicy3
      parameters:
        - name: environment
          in: path
          description: The environment id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
    delete:
      tags:
        - OrgPolicyService
      summary: DeletePolicy
      description: |-
        Deletes an organizational policy.
         Permissions required: bb.policies.delete
      operationId: OrgPolicyService_DeletePolicy3
      parameters:
        - name: environment
          in: path
          description: The environment id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - OrgPolicyService
      summary: UpdatePolicy
      description: |-
        Updates an existing organizational policy.
         Permissions required: bb.policies.update
      operationId: OrgPolicyService_UpdatePolicy3
      parameters:
        - name: environment
          in: path
          description: The environment id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the policy is not found, a new policy will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The policy to update.

           The policy's `name` field is used to identify the instance to update.
           Format: {resource name}/policies/{policy type}
           Workspace resource name: workspaces/{workspace-id}.
           Environment resource name: environments/environment-id.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: |-
                The policy to update.

                 The policy's `name` field is used to identify the instance to update.
                 Format: {resource name}/policies/{policy type}
                 Workspace resource name: workspaces/{workspace-id}.
                 Environment resource name: environments/environment-id.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/groups:
    get:
      tags:
        - GroupService
      summary: ListGroups
      description: |-
        Lists all groups in the workspace.
         Permissions required: bb.groups.list
      operationId: GroupService_ListGroups
      parameters:
        - name: pageSize
          in: query
          description: |-
            The maximum number of groups to return. The service may return fewer than
             this value.
             If unspecified, at most 10 groups will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListGroups` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListGroups` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter groups returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - title: the group title, support "==" and ".contains()" operator.
             - email: the group email, support "==" and ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.

             For example:
             title == "dba"
             email == "dba@bytebase.com"
             title.contains("dba")
             email.contains("dba")
             project == "projects/sample-project"
             You can combine filter conditions like:
             title.contains("dba") || email.contains("dba")
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListGroupsResponse'
    post:
      tags:
        - GroupService
      summary: CreateGroup
      description: |-
        Creates a new group.
         Permissions required: bb.groups.create
      operationId: GroupService_CreateGroup
      parameters:
        - name: groupEmail
          in: query
          description: |-
            The email to use for the group, which will become the final component
             of the group's resource name.
          required: true
          schema:
            type: string
            title: group_email
      requestBody:
        description: The group to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Group'
              title: group
              description: The group to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Group'
  /v1/groups/{group}:
    get:
      tags:
        - GroupService
      summary: GetGroup
      description: |-
        Gets a group by name.
         Group members or users with bb.groups.get permission can get the group.
         Permissions required: bb.groups.get OR caller is the group member
      operationId: GroupService_GetGroup
      parameters:
        - name: group
          in: path
          description: The group id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Group'
    delete:
      tags:
        - GroupService
      summary: DeleteGroup
      description: |-
        Deletes a group. Group owners or users with bb.groups.delete permission can delete.
         Permissions required: bb.groups.delete OR caller is group owner
      operationId: GroupService_DeleteGroup
      parameters:
        - name: group
          in: path
          description: The group id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - GroupService
      summary: UpdateGroup
      description: |-
        Updates a group. Group owners or users with bb.groups.update permission can update.
         Permissions required: bb.groups.update OR caller is group owner
         When allow_missing=true, also requires: bb.groups.create
      operationId: GroupService_UpdateGroup
      parameters:
        - name: group
          in: path
          description: The group id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the group is not found, a new group will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The group to update.

           The group's `name` field is used to identify the group to update.
           Format: groups/{email}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Group'
              title: group
              description: |-
                The group to update.

                 The group's `name` field is used to identify the group to update.
                 Format: groups/{email}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Group'
  /v1/groups:batchGet:
    get:
      tags:
        - GroupService
      summary: BatchGetGroups
      description: |-
        Gets multiple groups in a single request.
         Group members or users with bb.groups.get permission can get the group.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.groups.get OR caller is the group member
      operationId: GroupService_BatchGetGroups
      parameters:
        - name: names
          in: query
          description: |-
            The group names to retrieve.
             Format: groups/{email}
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetGroupsResponse'
  /v1/idps:
    get:
      tags:
        - IdentityProviderService
      summary: |-
        Lists the identity providers configured for the caller's workspace.
         The login page reads AuthService.GetAuthenticationInfo instead,
         which publishes only the fields a browser needs to start an SSO redirect.
      description: |-
        Returns the same representation as GetIdentityProvider — secrets redacted,
         the rest of the configuration included — so granting
         bb.identityProviders.list conveys configuration read over the whole
         collection, not merely the names in it.
         Permissions required: bb.identityProviders.list
      operationId: IdentityProviderService_ListIdentityProviders
      parameters:
        - name: parent
          in: query
          description: |-
            The parent workspace whose identity providers should be listed. It must be
             the workspace the caller's credential belongs to.
             Format: workspaces/{workspace}
          required: true
          schema:
            type: string
            title: parent
            pattern: ^workspaces/[^/]+$
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListIdentityProvidersResponse'
    post:
      tags:
        - IdentityProviderService
      summary: CreateIdentityProvider
      description: |-
        Creates a new identity provider.
         Permissions required: bb.identityProviders.create
      operationId: IdentityProviderService_CreateIdentityProvider
      parameters:
        - name: identityProviderId
          in: query
          description: |-
            The ID to use for the identity provider, which will become the final component of
             the identity provider's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
          schema:
            type: string
            title: identity_provider_id
        - name: validateOnly
          in: query
          description: If set to true, the request will be validated without actually creating the identity provider.
          schema:
            type: boolean
            title: validate_only
      requestBody:
        description: The identity provider to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
              title: identity_provider
              description: The identity provider to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
  /v1/idps/*:test:
    post:
      tags:
        - IdentityProviderService
      summary: TestIdentityProvider
      description: |-
        Tests the connection and configuration of an identity provider.
         Permissions required: bb.identityProviders.update
      operationId: IdentityProviderService_TestIdentityProvider
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.TestIdentityProviderRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TestIdentityProviderResponse'
  /v1/idps/{idp}:
    get:
      tags:
        - IdentityProviderService
      summary: GetIdentityProvider
      description: |-
        Gets an identity provider by name.
         Permissions required: bb.identityProviders.get
      operationId: IdentityProviderService_GetIdentityProvider
      parameters:
        - name: idp
          in: path
          description: The idp id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
    delete:
      tags:
        - IdentityProviderService
      summary: DeleteIdentityProvider
      description: |-
        Deletes an identity provider.
         Permissions required: bb.identityProviders.delete
      operationId: IdentityProviderService_DeleteIdentityProvider
      parameters:
        - name: idp
          in: path
          description: The idp id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - IdentityProviderService
      summary: UpdateIdentityProvider
      description: |-
        Updates an identity provider.
         Permissions required: bb.identityProviders.update
         When allow_missing=true, also requires: bb.identityProviders.create
      operationId: IdentityProviderService_UpdateIdentityProvider
      parameters:
        - name: idp
          in: path
          description: The idp id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the identity provider is not found, a new identity provider will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The identity provider to update.

           The identity provider's `name` field is used to identify the identity provider to update.
           Format: idps/{identity_provider}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
              title: identity_provider
              description: |-
                The identity provider to update.

                 The identity provider's `name` field is used to identify the identity provider to update.
                 Format: idps/{identity_provider}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
  /v1/instances:
    get:
      tags:
        - InstanceService
      summary: ListInstances
      description: |-
        Lists database instances, optionally within a project.
         Permissions required: bb.instances.list
      operationId: InstanceService_ListInstances
      parameters:
        - name: parent
          in: query
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, only workspace instances are
             returned. Wildcard project parents are not supported. When set, the
             `project` filter must be omitted or match this parent.
          schema:
            type: string
            title: parent
        - name: pageSize
          in: query
          description: |-
            The maximum number of instances to return. The service may return fewer than
             this value.
             If unspecified, at most 10 instances will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListInstances` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstances` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted instances if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter the instance.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - name: the instance name, support "==" and ".contains()" operator.
             - resource_id: the instance id, support "==" and ".contains()" operator.
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - state: the instance state, check State enum for values, support "==" operator.
             - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - host: the instance host, support "==" and ".contains()" operator.
             - port: the instance port, support "==" and ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - labels.{key}: the instance label, support "==" and "in" operators.

             For example:
             name == "sample instance"
             name.contains("sample")
             resource_id == "sample-instance"
             resource_id.contains("sample")
             state == "DELETED"
             environment == "environments/test"
             environment == "" (find instances which environment is not set)
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             host == "127.0.0.1"
             host.contains("127.0")
             port == "54321"
             port.contains("543")
             labels.org_group == "infrastructure"
             labels.environment in ["prod", "production"]
             project == "projects/sample-project"
             You can combine filter conditions like:
             name.contains("sample") && environment == "environments/test"
             host == "127.0.0.1" && port == "54321"
          schema:
            type: string
            title: filter
        - name: orderBy
          in: query
          description: |-
            The order by of instances.
             Support title, environment. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title desc, environment asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstancesResponse'
    post:
      tags:
        - InstanceService
      summary: CreateInstance
      description: |-
        Creates a new database instance.
         Permissions required: bb.instances.create
      operationId: InstanceService_CreateInstance
      parameters:
        - name: parent
          in: query
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, the instance is created in the
             workspace collection.
          schema:
            type: string
            title: parent
        - name: instanceId
          in: query
          description: |-
            The ID to use for the instance, which will become the final component of
             the instance's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
          schema:
            type: string
            title: instance_id
        - name: validateOnly
          in: query
          description: Validate only also tests the data source connection.
          schema:
            type: boolean
            title: validate_only
      requestBody:
        description: The instance to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Instance'
              title: instance
              description: The instance to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances/{instance}:
    get:
      tags:
        - InstanceService
      summary: GetInstance
      description: |-
        Gets a database instance by name.
         Permissions required: bb.instances.get
      operationId: InstanceService_GetInstance
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
    delete:
      tags:
        - InstanceService
      summary: DeleteInstance
      description: |-
        Deletes or soft-deletes a database instance.
         Soft-delete requests fail with FAILED_PRECONDITION while any task run
         targeting the instance is pending, available, or running.
         Permissions required: bb.instances.delete
      operationId: InstanceService_DeleteInstance
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: force
          in: query
          description: |-
            If set to true, a workspace instance's databases are moved to the default
             project before the instance is soft-deleted. Project instances reject this
             option because their databases must remain in the owning project.
          schema:
            type: boolean
            title: force
        - name: purge
          in: query
          description: |-
            If set to true, permanently purge the soft-deleted instance and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted instances.
             The instance must already be soft-deleted for this to work.
          schema:
            type: boolean
            title: purge
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - InstanceService
      summary: UpdateInstance
      description: |-
        Updates a database instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_UpdateInstance
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the instance is not found, a new instance will be created.
             In this situation, `update_mask` is ignored. A project-nested name creates
             the instance only under its encoded active, non-default project; it never
             falls back to a workspace instance.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The instance to update.

           The instance's `name` field is used to identify the instance to update.
           Format: instances/{instance} or projects/{project}/instances/{instance}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Instance'
              title: instance
              description: |-
                The instance to update.

                 The instance's `name` field is used to identify the instance to update.
                 Format: instances/{instance} or projects/{project}/instances/{instance}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances/{instance}/databases:
    get:
      tags:
        - DatabaseService
      summary: ListDatabases
      description: |-
        Lists databases in a project, instance, or workspace.
         Permissions required: bb.databases.list (for project or workspace parent), or bb.instances.get (for instance parent)
      operationId: DatabaseService_ListDatabases2
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListDatabases` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - name: the database name, support ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
             - table: filter by the database table, support "==" and ".contains()" operator.
             - labels.{key}: the database label, support "==" and "in" operators.

             For example:
             environment == "environments/{environment resource id}"
             environment == "" (find databases which environment is not set)
             project == "projects/{project resource id}"
             instance == "instances/{instance resource id}"
             instance == "projects/{project resource id}/instances/{instance resource id}"
             name.contains("database name")
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             exclude_unassigned == true
             table == "sample"
             table.contains("sam")
             labels.environment == "production"
             labels.region == "asia"
             labels.region in ["asia", "europe"]

             You can combine filter conditions like:
             environment == "environments/prod" && name.contains("employee")
          schema:
            type: string
            title: filter
        - name: showDeleted
          in: query
          description: Show deleted database if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: orderBy
          in: query
          description: |-
            The order by of databases.
             Support name, project, instance. The default sorting order is ascending.
             For example:
             - order_by = "name" - order by name ascending
             - order_by = "name desc"
             - order_by = "name desc, project asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
  /v1/instances/{instance}/databases/{database}:
    get:
      tags:
        - DatabaseService
      summary: GetDatabase
      description: |-
        Retrieves a database by name.
         Permissions required: bb.databases.get
      operationId: DatabaseService_GetDatabase
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Database'
    patch:
      tags:
        - DatabaseService
      summary: UpdateDatabase
      description: |-
        Updates database properties such as labels and project assignment.
         Permissions required: bb.databases.update
      operationId: DatabaseService_UpdateDatabase
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
      requestBody:
        description: |-
          The database to update.

           The database's `name` field is used to identify the database to update.
           Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Database'
              title: database
              description: |-
                The database to update.

                 The database's `name` field is used to identify the database to update.
                 Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Database'
  /v1/instances/{instance}/databases/{database}/catalog:
    get:
      tags:
        - DatabaseCatalogService
      summary: GetDatabaseCatalog
      description: |-
        Gets the catalog metadata for a database.
         Permissions required: bb.databaseCatalogs.get
      operationId: DatabaseCatalogService_GetDatabaseCatalog
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
    patch:
      tags:
        - DatabaseCatalogService
      summary: UpdateDatabaseCatalog
      description: |-
        Updates catalog metadata such as classifications and labels.
         Permissions required: bb.databaseCatalogs.update
      operationId: DatabaseCatalogService_UpdateDatabaseCatalog
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        description: |-
          The database catalog to update, identified by its `name` field.
           Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog

           Replaces the whole catalog: send the complete value, since anything omitted
           is erased. There is no `update_mask` because `schemas` is a repeated field,
           and AIP-161 forbids addressing one element of one.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
              title: catalog
              description: |-
                The database catalog to update, identified by its `name` field.
                 Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog

                 Replaces the whole catalog: send the complete value, since anything omitted
                 is erased. There is no `update_mask` because `schemas` is a repeated field,
                 and AIP-161 forbids addressing one element of one.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
  /v1/instances/{instance}/databases/{database}/changelogs:
    get:
      tags:
        - ChangelogService
      summary: ListChangelogs
      description: |-
        Lists migration history for a database.
         Permissions required: bb.changelogs.list
      operationId: ChangelogService_ListChangelogs
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of changelogs to return. The service may return fewer
             than this value. If unspecified, at most 10 changelogs will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from the previous call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: view
          in: query
          description: The view query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
            title: view
        - name: filter
          in: query
          description: |-
            Filter is used to filter changelogs returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - status: the changelog status, support "==" operation. check Changelog.Status for available values.
             - has_schema_snapshot: filters to changelogs with a schema snapshot; only "has_schema_snapshot == true" is supported.
             - create_time: the changelog create time in RFC 3339 format, supports ">=", "<=", or "<" operator.

             Example:
             status == "DONE"
             status == "FAILED"
             has_schema_snapshot == true && create_time < "2024-01-02T00:00:00Z"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListChangelogsResponse'
  /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:
    get:
      tags:
        - ChangelogService
      summary: GetChangelog
      description: |-
        Retrieves a specific changelog entry.
         Permissions required: bb.changelogs.get
      operationId: ChangelogService_GetChangelog
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: changelog
          in: path
          description: The changelog id.
          required: true
          schema:
            type: string
        - name: view
          in: query
          description: The view query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
            title: view
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Changelog'
  /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:diffSchema:
    post:
      tags:
        - DatabaseService
      summary: DiffSchema
      description: |-
        Compares and generates migration statements between two schemas.
         Permissions required: bb.databases.get
      operationId: DatabaseService_DiffSchema3
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: changelog
          in: path
          description: The changelog id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    changelog:
                      type: string
                      title: changelog
                      description: |-
                        The resource name of the changelog
                         Format:
                         instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
                  title: changelog
                - type: object
                  properties:
                    schema:
                      type: string
                      title: schema
                      description: The target schema.
                  title: schema
              unevaluatedProperties: false
              not:
                allOf:
                  - anyOf:
                      - required:
                          - changelog
                      - required:
                          - schema
                  - not:
                      oneOf:
                        - required:
                            - changelog
                        - required:
                            - schema
              title: DiffSchemaRequest
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
  /v1/instances/{instance}/databases/{database}/metadata:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseMetadata
      description: |-
        Retrieves database metadata including tables, columns, and indexes.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseMetadata
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - schema: the schema name, support "==" operator.
             - table: the table name, support "==" and ".contains()" operator.

             For example:
             schema == "schema-a"
             table == "table-a"
             table.contains("table-a")
             schema == "schema-a" && table.contains("sample")
             The filter is used to search for tables containing "sample" in the schema "schemas/schema-a".
             The column masking level will only be returned when a table filter is used.
          schema:
            type: string
            title: filter
        - name: limit
          in: query
          description: |-
            Limit the response size of returned table metadata per schema.
             For example, if the database has 3 schemas, and each schema has 100 tables,
             if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
             Default 0, means no limit.
          schema:
            type: integer
            title: limit
            format: int32
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
  /v1/instances/{instance}/databases/{database}/revisions:
    get:
      tags:
        - RevisionService
      summary: ListRevisions
      description: |-
        Lists schema revisions for a database.
         Permissions required: bb.revisions.list
      operationId: RevisionService_ListRevisions
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of revisions to return. The service may return fewer
             than this value. If unspecified, at most 10 revisions will be returned. The
             maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListRevisions` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListRevisions` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Whether to include deleted revisions in the results.
          schema:
            type: boolean
            title: show_deleted
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListRevisionsResponse'
  /v1/instances/{instance}/databases/{database}/revisions/{revision}:
    get:
      tags:
        - RevisionService
      summary: GetRevision
      description: |-
        Retrieves a schema revision by name.
         Permissions required: bb.revisions.get
      operationId: RevisionService_GetRevision
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: revision
          in: path
          description: The revision id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Revision'
    delete:
      tags:
        - RevisionService
      summary: DeleteRevision
      description: |-
        Deletes a schema revision.
         Permissions required: bb.revisions.delete
      operationId: RevisionService_DeleteRevision
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: revision
          in: path
          description: The revision id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/instances/{instance}/databases/{database}/revisions:batchCreate:
    post:
      tags:
        - RevisionService
      summary: BatchCreateRevisions
      description: |-
        Creates multiple schema revisions in a single operation.
         Permissions required: bb.revisions.create
      operationId: RevisionService_BatchCreateRevisions
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.CreateRevisionRequest'
                  title: requests
                  description: |-
                    The request message specifying the revisions to create.
                     A maximum of 100 revisions can be created in a batch.
              title: BatchCreateRevisionsRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchCreateRevisionsResponse'
  /v1/instances/{instance}/databases/{database}/schema:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseSchema
      description: |-
        Retrieves database schema as DDL statements.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseSchema
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseSchema'
  /v1/instances/{instance}/databases/{database}/schemaString:
    get:
      tags:
        - DatabaseService
      summary: GetSchemaString
      description: |-
        Generates schema DDL for a database object.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetSchemaString
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GetSchemaStringRequest.ObjectType'
            title: type
        - name: schema
          in: query
          description: It's empty for DATABASE.
          schema:
            type: string
            title: schema
        - name: object
          in: query
          description: It's empty for DATABASE and SCHEMA.
          schema:
            type: string
            title: object
        - name: metadata.name
          in: query
          description: |-
            The database metadata name.

             Format: instances/{instance}/databases/{database}/metadata or projects/{project}/instances/{instance}/databases/{database}/metadata
          schema:
            type: string
            title: name
        - name: metadata.schemas.name
          in: query
          description: |-
            The name is the schema name.
             It is an empty string for databases without such concept such as MySQL.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.name
          in: query
          description: The name is the name of a table.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.tables.columns.hasDefault
          in: query
          description: The metadata.schemas.tables.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.tables.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.tables.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.tables.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.tables.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.tables.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.tables.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.tables.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.columns.generation.type
          in: query
          description: The metadata.schemas.tables.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.tables.columns.generation.expression
          in: query
          description: The metadata.schemas.tables.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.columns.isIdentity
          in: query
          description: The metadata.schemas.tables.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.tables.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.tables.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.tables.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.tables.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.tables.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.tables.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.tables.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.tables.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.tables.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.tables.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.tables.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.tables.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.tables.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tables.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.tables.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.tables.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.tables.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.tables.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.tables.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.tables.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.tables.engine
          in: query
          description: The engine is the engine of a table.
          schema:
            type: string
            title: engine
        - name: metadata.schemas.tables.collation
          in: query
          description: The collation is the collation of a table.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.tables.charset
          in: query
          description: The character set of table.
          schema:
            type: string
            title: charset
        - name: metadata.schemas.tables.rowCount
          in: query
          description: The row_count is the estimated number of rows of a table.
          schema:
            type: string
            title: row_count
            format: int64
        - name: metadata.schemas.tables.dataSize
          in: query
          description: The data_size is the estimated data size of a table.
          schema:
            type: string
            title: data_size
            format: int64
        - name: metadata.schemas.tables.indexSize
          in: query
          description: The index_size is the estimated index size of a table.
          schema:
            type: string
            title: index_size
            format: int64
        - name: metadata.schemas.tables.dataFree
          in: query
          description: The data_free is the estimated free data size of a table.
          schema:
            type: string
            title: data_free
            format: int64
        - name: metadata.schemas.tables.createOptions
          in: query
          description: The create_options is the create option of a table.
          schema:
            type: string
            title: create_options
        - name: metadata.schemas.tables.comment
          in: query
          description: The comment is the comment of a table.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.foreignKeys.name
          in: query
          description: The name is the name of a foreign key.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.foreignKeys.columns
          in: query
          description: The columns are the ordered referencing columns of a foreign key.
          schema:
            type: array
            items:
              type: string
            title: columns
        - name: metadata.schemas.tables.foreignKeys.referencedSchema
          in: query
          description: |-
            The referenced_schema is the referenced schema name of a foreign key.
             It is an empty string for databases without such concept such as MySQL.
          schema:
            type: string
            title: referenced_schema
        - name: metadata.schemas.tables.foreignKeys.referencedTable
          in: query
          description: The referenced_table is the referenced table name of a foreign key.
          schema:
            type: string
            title: referenced_table
        - name: metadata.schemas.tables.foreignKeys.referencedColumns
          in: query
          description: The referenced_columns are the ordered referenced columns of a foreign key.
          schema:
            type: array
            items:
              type: string
            title: referenced_columns
        - name: metadata.schemas.tables.foreignKeys.onDelete
          in: query
          description: The on_delete is the on delete action of a foreign key.
          schema:
            type: string
            title: on_delete
        - name: metadata.schemas.tables.foreignKeys.onUpdate
          in: query
          description: The on_update is the on update action of a foreign key.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.tables.foreignKeys.matchType
          in: query
          description: |-
            The match_type is the match type of a foreign key.
             The match_type is the PostgreSQL specific field.
             It's empty string for other databases.
          schema:
            type: string
            title: match_type
        - name: metadata.schemas.tables.partitions.name
          in: query
          description: The name is the name of a table partition.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.type
          in: query
          description: The type of a table partition.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata.Type'
            title: type
        - name: metadata.schemas.tables.partitions.expression
          in: query
          description: |-
            The expression is the expression of a table partition.
             For PostgreSQL, the expression is the text of {FOR VALUES
             partition_bound_spec}, see
             https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
             the expression is the `expr` or `column_list` of the following syntax.
             PARTITION BY
                { [LINEAR] HASH(expr)
                | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
                | RANGE{(expr) | COLUMNS(column_list)}
                | LIST{(expr) | COLUMNS(column_list)} }.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.partitions.value
          in: query
          description: |-
            The value is the value of a table partition.
             For MySQL, the value is for RANGE and LIST partition types,
             - For a RANGE partition, it contains the value set in the partition's
             VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
             - For a LIST partition, this column contains the values defined in the
             partition's VALUES IN clause, which is a list of comma-separated integer
             values.
             - For others, it's an empty string.
          schema:
            type: string
            title: value
        - name: metadata.schemas.tables.partitions.useDefault
          in: query
          description: |-
            The use_default is whether the users use the default partition, it stores
             the different value for different database engines. For MySQL, it's [INT]
             type, 0 means not use default partition, otherwise, it's equals to number
             in syntax [SUB]PARTITION {number}.
          schema:
            type: string
            title: use_default
        - name: metadata.schemas.tables.partitions.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.tables.partitions.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.tables.partitions.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.tables.partitions.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.partitions.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.tables.partitions.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.tables.partitions.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.tables.partitions.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.partitions.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tables.partitions.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.tables.partitions.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.tables.partitions.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.tables.partitions.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.tables.partitions.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.tables.partitions.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.tables.partitions.checkConstraints.name
          in: query
          description: The name is the name of a check constraint.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.checkConstraints.expression
          in: query
          description: The expression is the expression of a check constraint.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.checkConstraints.name
          in: query
          description: The name is the name of a check constraint.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.checkConstraints.expression
          in: query
          description: The expression is the expression of a check constraint.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.owner
          in: query
          description: The owner of the table.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.tables.sortingKeys
          in: query
          description: |-
            The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
             Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
          schema:
            type: array
            items:
              type: string
            title: sorting_keys
        - name: metadata.schemas.tables.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.tables.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.tables.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.tables.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.tables.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.tables.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.tables.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.tables.skipDump
          in: query
          description: Whether to skip this table during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.tables.shardingInfo
          in: query
          description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
          schema:
            type: string
            title: sharding_info
        - name: metadata.schemas.tables.primaryKeyType
          in: query
          description: |-
            https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
             CLUSTERED or NONCLUSTERED.
          schema:
            type: string
            title: primary_key_type
        - name: metadata.schemas.externalTables.name
          in: query
          description: The name is the name of a external table.
          schema:
            type: string
            title: name
        - name: metadata.schemas.externalTables.externalServerName
          in: query
          description: The external_server_name is the name of the external server.
          schema:
            type: string
            title: external_server_name
        - name: metadata.schemas.externalTables.externalDatabaseName
          in: query
          description: The external_database_name is the name of the external database.
          schema:
            type: string
            title: external_database_name
        - name: metadata.schemas.externalTables.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.externalTables.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.externalTables.columns.hasDefault
          in: query
          description: The metadata.schemas.externalTables.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.externalTables.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.externalTables.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.externalTables.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.externalTables.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.externalTables.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.externalTables.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.externalTables.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.externalTables.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.externalTables.columns.generation.type
          in: query
          description: The metadata.schemas.externalTables.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.externalTables.columns.generation.expression
          in: query
          description: The metadata.schemas.externalTables.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.externalTables.columns.isIdentity
          in: query
          description: The metadata.schemas.externalTables.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.externalTables.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.externalTables.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.externalTables.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.externalTables.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.externalTables.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.externalTables.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.views.name
          in: query
          description: The name is the name of a view.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.definition
          in: query
          description: The definition is the definition of a view.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.views.comment
          in: query
          description: The comment is the comment of a view.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.dependencyColumns.schema
          in: query
          description: The schema is the schema of a reference column.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.views.dependencyColumns.table
          in: query
          description: The table is the table of a reference column.
          schema:
            type: string
            title: table
        - name: metadata.schemas.views.dependencyColumns.column
          in: query
          description: The column is the name of a reference column.
          schema:
            type: string
            title: column
        - name: metadata.schemas.views.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.views.columns.hasDefault
          in: query
          description: The metadata.schemas.views.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.views.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.views.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.views.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.views.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.views.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.views.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.views.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.views.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.columns.generation.type
          in: query
          description: The metadata.schemas.views.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.views.columns.generation.expression
          in: query
          description: The metadata.schemas.views.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.views.columns.isIdentity
          in: query
          description: The metadata.schemas.views.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.views.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.views.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.views.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.views.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.views.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.views.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.views.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.views.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.views.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.views.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.views.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.views.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.views.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.views.skipDump
          in: query
          description: The metadata.schemas.views.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.functions.name
          in: query
          description: The name is the name of a function.
          schema:
            type: string
            title: name
        - name: metadata.schemas.functions.definition
          in: query
          description: The definition is the definition of a function.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.functions.signature
          in: query
          description: |-
            The signature is the name with the number and type of input arguments the
             function takes.
          schema:
            type: string
            title: signature
        - name: metadata.schemas.functions.characterSetClient
          in: query
          description: MySQL specific metadata.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.functions.collationConnection
          in: query
          description: The metadata.schemas.functions.collationConnection query parameter.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.functions.databaseCollation
          in: query
          description: The metadata.schemas.functions.databaseCollation query parameter.
          schema:
            type: string
            title: database_collation
        - name: metadata.schemas.functions.sqlMode
          in: query
          description: The metadata.schemas.functions.sqlMode query parameter.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.functions.comment
          in: query
          description: The metadata.schemas.functions.comment query parameter.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.functions.dependencyTables.schema
          in: query
          description: The schema is the schema of a reference table.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.functions.dependencyTables.table
          in: query
          description: The table is the name of a reference table.
          schema:
            type: string
            title: table
        - name: metadata.schemas.functions.skipDump
          in: query
          description: The metadata.schemas.functions.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.procedures.name
          in: query
          description: The name is the name of a procedure.
          schema:
            type: string
            title: name
        - name: metadata.schemas.procedures.definition
          in: query
          description: The definition is the definition of a procedure.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.procedures.signature
          in: query
          description: |-
            The signature is the name with the number and type of input arguments the
             procedure takes.
          schema:
            type: string
            title: signature
        - name: metadata.schemas.procedures.characterSetClient
          in: query
          description: MySQL specific metadata.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.procedures.collationConnection
          in: query
          description: The metadata.schemas.procedures.collationConnection query parameter.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.procedures.databaseCollation
          in: query
          description: The metadata.schemas.procedures.databaseCollation query parameter.
          schema:
            type: string
            title: database_collation
        - name: metadata.schemas.procedures.sqlMode
          in: query
          description: The metadata.schemas.procedures.sqlMode query parameter.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.procedures.comment
          in: query
          description: The comment is the comment of a procedure.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.procedures.skipDump
          in: query
          description: The metadata.schemas.procedures.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.streams.name
          in: query
          description: The name is the name of a stream.
          schema:
            type: string
            title: name
        - name: metadata.schemas.streams.tableName
          in: query
          description: The table_name is the name of the table/view that the stream is created on.
          schema:
            type: string
            title: table_name
        - name: metadata.schemas.streams.owner
          in: query
          description: The owner of the stream.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.streams.comment
          in: query
          description: The comment of the stream.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.streams.type
          in: query
          description: The type of the stream.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Type'
            title: type
        - name: metadata.schemas.streams.stale
          in: query
          description: Indicates whether the stream was last read before the `stale_after` time.
          schema:
            type: boolean
            title: stale
        - name: metadata.schemas.streams.mode
          in: query
          description: The mode of the stream.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Mode'
            title: mode
        - name: metadata.schemas.streams.definition
          in: query
          description: The definition of the stream.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tasks.name
          in: query
          description: The name is the name of a task.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tasks.id
          in: query
          description: |-
            The id is the snowflake-generated id of a task.
             Example: 01ad32a0-1bb6-5e93-0000-000000000001
          schema:
            type: string
            title: id
        - name: metadata.schemas.tasks.owner
          in: query
          description: The owner of the task.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.tasks.comment
          in: query
          description: The comment of the task.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tasks.warehouse
          in: query
          description: The warehouse of the task.
          schema:
            type: string
            title: warehouse
        - name: metadata.schemas.tasks.schedule
          in: query
          description: The schedule interval of the task.
          schema:
            type: string
            title: schedule
        - name: metadata.schemas.tasks.predecessors
          in: query
          description: The predecessor tasks of the task.
          schema:
            type: array
            items:
              type: string
            title: predecessors
        - name: metadata.schemas.tasks.state
          in: query
          description: The state of the task.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.TaskMetadata.State'
            title: state
        - name: metadata.schemas.tasks.condition
          in: query
          description: The condition of the task.
          schema:
            type: string
            title: condition
        - name: metadata.schemas.tasks.definition
          in: query
          description: The definition of the task.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.name
          in: query
          description: The name is the name of a materialized view.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.definition
          in: query
          description: The definition is the definition of a materialized view.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.comment
          in: query
          description: The comment is the comment of a materialized view.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.dependencyColumns.schema
          in: query
          description: The schema is the schema of a reference column.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.materializedViews.dependencyColumns.table
          in: query
          description: The table is the table of a reference column.
          schema:
            type: string
            title: table
        - name: metadata.schemas.materializedViews.dependencyColumns.column
          in: query
          description: The column is the name of a reference column.
          schema:
            type: string
            title: column
        - name: metadata.schemas.materializedViews.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.materializedViews.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.materializedViews.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.materializedViews.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.materializedViews.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.materializedViews.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.materializedViews.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.materializedViews.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.materializedViews.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.materializedViews.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.materializedViews.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.materializedViews.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.materializedViews.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.materializedViews.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.materializedViews.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.materializedViews.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.materializedViews.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.materializedViews.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.materializedViews.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.materializedViews.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.materializedViews.skipDump
          in: query
          description: The metadata.schemas.materializedViews.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.packages.name
          in: query
          description: The name is the name of a package.
          schema:
            type: string
            title: name
        - name: metadata.schemas.packages.definition
          in: query
          description: The definition is the definition of a package.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.owner
          in: query
          description: The owner of the schema.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.sequences.name
          in: query
          description: The name of a sequence.
          schema:
            type: string
            title: name
        - name: metadata.schemas.sequences.dataType
          in: query
          description: The data type of a sequence.
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.sequences.start
          in: query
          description: The start value of a sequence.
          schema:
            type: string
            title: start
        - name: metadata.schemas.sequences.minValue
          in: query
          description: The minimum value of a sequence.
          schema:
            type: string
            title: min_value
        - name: metadata.schemas.sequences.maxValue
          in: query
          description: The maximum value of a sequence.
          schema:
            type: string
            title: max_value
        - name: metadata.schemas.sequences.increment
          in: query
          description: Increment value of a sequence.
          schema:
            type: string
            title: increment
        - name: metadata.schemas.sequences.cycle
          in: query
          description: Cycle is whether the sequence cycles.
          schema:
            type: boolean
            title: cycle
        - name: metadata.schemas.sequences.cacheSize
          in: query
          description: Cache size of a sequence.
          schema:
            type: string
            title: cache_size
        - name: metadata.schemas.sequences.lastValue
          in: query
          description: Last value of a sequence.
          schema:
            type: string
            title: last_value
        - name: metadata.schemas.sequences.ownerTable
          in: query
          description: The owner table of the sequence.
          schema:
            type: string
            title: owner_table
        - name: metadata.schemas.sequences.ownerColumn
          in: query
          description: The owner column of the sequence.
          schema:
            type: string
            title: owner_column
        - name: metadata.schemas.sequences.comment
          in: query
          description: The comment describing the sequence.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.sequences.skipDump
          in: query
          description: Whether to skip this sequence during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.events.name
          in: query
          description: The name of the event.
          schema:
            type: string
            title: name
        - name: metadata.schemas.events.definition
          in: query
          description: The schedule of the event.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.events.timeZone
          in: query
          description: The time zone of the event.
          schema:
            type: string
            title: time_zone
        - name: metadata.schemas.events.sqlMode
          in: query
          description: The SQL mode setting for the event.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.events.characterSetClient
          in: query
          description: The character set used by the client creating the event.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.events.collationConnection
          in: query
          description: The collation used for the connection when creating the event.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.events.comment
          in: query
          description: The comment is the comment of an event.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.enumTypes.name
          in: query
          description: The name of a type.
          schema:
            type: string
            title: name
        - name: metadata.schemas.enumTypes.values
          in: query
          description: The enum values of a type.
          schema:
            type: array
            items:
              type: string
            title: values
        - name: metadata.schemas.enumTypes.comment
          in: query
          description: The comment describing the enum type.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.enumTypes.skipDump
          in: query
          description: Whether to skip this enum type during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.skipDump
          in: query
          description: Whether to skip this schema during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.comment
          in: query
          description: The comment is the comment of a schema.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.compositeTypes.name
          in: query
          description: The name of the composite type.
          schema:
            type: string
            title: name
        - name: metadata.schemas.compositeTypes.attributes.name
          in: query
          description: The name of the attribute.
          schema:
            type: string
            title: name
        - name: metadata.schemas.compositeTypes.attributes.type
          in: query
          description: The attribute type. User-defined types are always schema-qualified.
          schema:
            type: string
            title: type
        - name: metadata.schemas.compositeTypes.attributes.collation
          in: query
          description: |-
            The non-default collation of the attribute as an emit-ready SQL
             identifier reference (quoted as needed, schema-qualified when outside
             pg_catalog), empty otherwise. e.g. `"C"` or `locale.en_us`.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.compositeTypes.attributes.comment
          in: query
          description: The comment describing the attribute.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.compositeTypes.comment
          in: query
          description: The comment describing the composite type.
          schema:
            type: string
            title: comment
        - name: metadata.characterSet
          in: query
          description: The character_set is the character set of a database.
          schema:
            type: string
            title: character_set
        - name: metadata.collation
          in: query
          description: The collation is the collation of a database.
          schema:
            type: string
            title: collation
        - name: metadata.extensions.name
          in: query
          description: The name is the name of an extension.
          schema:
            type: string
            title: name
        - name: metadata.extensions.schema
          in: query
          description: |-
            The schema is the extension that is installed to. But the extension usage
             is not limited to the schema.
          schema:
            type: string
            title: schema
        - name: metadata.extensions.version
          in: query
          description: The version is the version of an extension.
          schema:
            type: string
            title: version
        - name: metadata.extensions.description
          in: query
          description: The description is the description of an extension.
          schema:
            type: string
            title: description
        - name: metadata.owner
          in: query
          description: The owner of the database.
          schema:
            type: string
            title: owner
        - name: metadata.searchPath
          in: query
          description: The search_path is the search path of a PostgreSQL database.
          schema:
            type: string
            title: search_path
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.GetSchemaStringResponse'
  /v1/instances/{instance}/databases/{database}/sdlSchema:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseSDLSchema
      description: |-
        Retrieves database schema in SDL (Schema Definition Language) format.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseSDLSchema
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: format
          in: query
          description: The format of the SDL schema output.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat'
            title: format
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseSDLSchema'
  /v1/instances/{instance}/databases/{database}:diffMetadata:
    post:
      tags:
        - DatabaseService
      summary: DiffMetadata
      description: |-
        Generates migration statements from the database's current schema to the
         given target metadata.
         Permissions required: bb.databases.diffMetadata
      operationId: DatabaseService_DiffMetadata
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                targetMetadata:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
                  title: target_metadata
                  description: |-
                    The metadata of the target schema. The source metadata and the engine are
                     read from the database, so only the target travels in the request.
                     Must describe the COMPLETE target schema: the diff runs against the full
                     stored source, so any object omitted from the target (for example by a
                     truncated metadata fetch) is treated as dropped.
              title: DiffMetadataRequest
              required:
                - targetMetadata
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffMetadataResponse'
  /v1/instances/{instance}/databases/{database}:diffSchema:
    post:
      tags:
        - DatabaseService
      summary: DiffSchema
      description: |-
        Compares and generates migration statements between two schemas.
         Permissions required: bb.databases.get
      operationId: DatabaseService_DiffSchema
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    changelog:
                      type: string
                      title: changelog
                      description: |-
                        The resource name of the changelog
                         Format:
                         instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
                  title: changelog
                - type: object
                  properties:
                    schema:
                      type: string
                      title: schema
                      description: The target schema.
                  title: schema
              unevaluatedProperties: false
              not:
                allOf:
                  - anyOf:
                      - required:
                          - changelog
                      - required:
                          - schema
                  - not:
                      oneOf:
                        - required:
                            - changelog
                        - required:
                            - schema
              title: DiffSchemaRequest
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
  /v1/instances/{instance}/databases/{database}:export:
    post:
      tags:
        - SQLService
      summary: Export
      description: |-
        Exports query results to a file format.
         Permissions required: bb.databases.get, and bb.sql.export on the data the statement reads.
         An active access grant with export=true for the statement satisfies bb.sql.export on its target databases.
      operationId: SQLService_Export
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                statement:
                  type: string
                  title: statement
                  description: The SQL statement to execute.
                limit:
                  type: integer
                  title: limit
                  format: int32
                  description: The maximum number of rows to return.
                format:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.ExportFormat'
                  title: format
                  description: The export format.
                admin:
                  type: boolean
                  title: admin
                  description: |-
                    The admin is used for workspace owner and DBA for exporting data from SQL
                     Editor Admin mode. The exported data is not masked.
                password:
                  type: string
                  title: password
                  description: The zip password provide by users.
                dataSourceId:
                  type: string
                  title: data_source_id
                  description: |-
                    The id of data source.
                     If omitted, Export resolves the data source server-side by using the
                     single read-only data source when exactly one exists, or the admin data
                     source otherwise. It can also be set explicitly to export from the admin
                     data source or a specific read-only data source.
                schema:
                  type:
                    - string
                    - "null"
                  title: schema
                  description: |-
                    The default schema to search objects. Equals to the current schema in
                     Oracle and search path in Postgres.
                container:
                  type:
                    - string
                    - "null"
                  title: container
                  description: |-
                    Container is the container name to execute the query against, used for
                     CosmosDB only.
                destination:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.ExportDestination'
                  title: destination
                  description: |-
                    Where the export goes. A destination the workspace query data policy
                     does not allow is rejected with FAILED_PRECONDITION.
              title: ExportRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExportResponse'
  /v1/instances/{instance}/databases/{database}:query:
    post:
      tags:
        - SQLService
      summary: Query
      description: |-
        Executes a read-only SQL query against a database.
         Permissions required: bb.databases.get
      operationId: SQLService_Query
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                statement:
                  type: string
                  title: statement
                  description: The SQL statement to execute.
                limit:
                  type: integer
                  title: limit
                  format: int32
                  description: The maximum number of rows to return.
                dataSourceId:
                  type: string
                  title: data_source_id
                  description: |-
                    The id of data source.
                     If omitted, Query resolves the data source server-side by using the single
                     read-only data source when exactly one exists, or the admin data source
                     otherwise. It can also be set explicitly to query the admin data source or
                     a specific read-only data source.
                explain:
                  type: boolean
                  title: explain
                  description: Explain the statement.
                schema:
                  type:
                    - string
                    - "null"
                  title: schema
                  description: |-
                    The default schema to search objects. Equals to the current schema in
                     Oracle and search path in Postgres.
                queryOption:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.QueryOption'
                  title: query_option
                container:
                  type:
                    - string
                    - "null"
                  title: container
                  description: |-
                    Container is the container name to execute the query against, used for
                     CosmosDB only.
              title: QueryRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.QueryResponse'
  /v1/instances/{instance}/databases/{database}:sync:
    post:
      tags:
        - DatabaseService
      summary: SyncDatabase
      description: |-
        Synchronizes database schema from the instance.
         Permissions required: bb.databases.sync
      operationId: DatabaseService_SyncDatabase
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SyncDatabaseResponse'
  /v1/instances/{instance}/databases:batchGet:
    get:
      tags:
        - DatabaseService
      summary: BatchGetDatabases
      description: |-
        Retrieves multiple databases by their names.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.databases.get (on each named database's project)
      operationId: DatabaseService_BatchGetDatabases2
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: names
          in: query
          description: The list of database names to retrieve.
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetDatabasesResponse'
  /v1/instances/{instance}/databases:batchSync:
    post:
      tags:
        - DatabaseService
      summary: BatchSyncDatabases
      description: |-
        Synchronizes multiple databases in a single batch operation.
         Permissions required: bb.databases.sync
      operationId: DatabaseService_BatchSyncDatabases
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                names:
                  type: array
                  items:
                    type: string
                  title: names
                  description: The list of database names to sync.
              title: BatchSyncDatabasesRequest
              required:
                - names
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchSyncDatabasesResponse'
  /v1/instances/{instance}/databases:batchUpdate:
    post:
      tags:
        - DatabaseService
      summary: BatchUpdateDatabases
      description: |-
        Updates multiple databases in a single batch operation.
         Permissions required: bb.databases.update
      operationId: DatabaseService_BatchUpdateDatabases
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.UpdateDatabaseRequest'
                  title: requests
                  description: |-
                    The request message specifying the resources to update.
                     A maximum of 1000 databases can be modified in a batch.
              title: BatchUpdateDatabasesRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchUpdateDatabasesResponse'
  /v1/instances/{instance}/roles:
    get:
      tags:
        - InstanceRoleService
      summary: ListInstanceRoles
      description: |-
        Lists all database roles in an instance.
         Permissions required: bb.instanceRoles.list
      operationId: InstanceRoleService_ListInstanceRoles
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            Not used.
             The maximum number of roles to return. The service may return fewer than
             this value.
             If unspecified, at most 10 roles will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            Not used.
             A page token, received from a previous `ListInstanceRoles` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstanceRoles` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: refresh
          in: query
          description: Refresh will refresh and return the latest data.
          schema:
            type: boolean
            title: refresh
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstanceRolesResponse'
  /v1/instances/{instance}:addDataSource:
    post:
      tags:
        - InstanceService
      summary: AddDataSource
      description: |-
        Adds a read-only data source to an instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_AddDataSource
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dataSource:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DataSource'
                  title: data_source
                  description: |-
                    Identified by data source ID.
                     Only READ_ONLY data source can be added.
                validateOnly:
                  type: boolean
                  title: validate_only
                  description: Validate only also tests the data source connection.
              title: AddDataSourceRequest
              required:
                - dataSource
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances/{instance}:databases:
    post:
      tags:
        - InstanceService
      summary: ListInstanceDatabase
      description: |-
        Lists all databases within an instance without creating them.
         Permissions required: bb.instances.get
      operationId: InstanceService_ListInstanceDatabase
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                instance:
                  oneOf:
                    - $ref: '#/components/schemas/bytebase.v1.Instance'
                    - type: "null"
                  title: instance
                  description: The target instance. We need to set this field if the target instance is not created yet.
              title: ListInstanceDatabaseRequest
              required:
                - instance
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstanceDatabaseResponse'
  /v1/instances/{instance}:removeDataSource:
    post:
      tags:
        - InstanceService
      summary: RemoveDataSource
      description: |-
        Removes a read-only data source from an instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_RemoveDataSource
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dataSource:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DataSource'
                  title: data_source
                  description: |-
                    Identified by data source ID.
                     Only READ_ONLY data source can be removed.
              title: RemoveDataSourceRequest
              required:
                - dataSource
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances/{instance}:sync:
    post:
      tags:
        - InstanceService
      summary: SyncInstance
      description: |-
        Syncs database schemas and metadata from an instance.
         Permissions required: bb.instances.sync
      operationId: InstanceService_SyncInstance
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                enableFullSync:
                  type: boolean
                  title: enable_full_sync
                  description: |-
                    When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
                     the instance metadata (such as the database list) and any newly discovered databases will be synced.
              title: SyncInstanceRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SyncInstanceResponse'
  /v1/instances/{instance}:undelete:
    post:
      tags:
        - InstanceService
      summary: UndeleteInstance
      description: |-
        Restores a soft-deleted database instance.
         Restore requests fail with FAILED_PRECONDITION while any task run targeting
         the instance is pending, available, or running.
         Permissions required: bb.instances.undelete
      operationId: InstanceService_UndeleteInstance
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances/{instance}:updateDataSource:
    patch:
      tags:
        - InstanceService
      summary: UpdateDataSource
      description: |-
        Updates a data source configuration.
         Permissions required: bb.instances.update
      operationId: InstanceService_UpdateDataSource
      parameters:
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: validateOnly
          in: query
          description: Validate only also tests the data source connection.
          schema:
            type: boolean
            title: validate_only
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the data source is not found, a new data source will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: Identified by data source ID.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSource'
              title: data_source
              description: Identified by data source ID.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/instances:batchSync:
    post:
      tags:
        - InstanceService
      summary: BatchSyncInstances
      description: |-
        Syncs multiple instances in a single request.
         Permissions required: bb.instances.sync
      operationId: InstanceService_BatchSyncInstances
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.BatchSyncInstancesRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchSyncInstancesResponse'
  /v1/instances:batchUpdate:
    post:
      tags:
        - InstanceService
      summary: BatchUpdateInstances
      description: |-
        Updates multiple instances in a single request.
         Permissions required: bb.instances.update
      operationId: InstanceService_BatchUpdateInstances
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.BatchUpdateInstancesRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchUpdateInstancesResponse'
  /v1/projects:
    get:
      tags:
        - ProjectService
      summary: ListProjects
      description: |-
        Lists all projects in the workspace with optional filtering.
         Permissions required: bb.projects.list
      operationId: ProjectService_ListProjects
      parameters:
        - name: pageSize
          in: query
          description: |-
            The maximum number of projects to return. The service may return fewer than
             this value.
             If unspecified, at most 10 projects will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListProjects` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListProjects` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted projects if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter the project.
             Check filter for SearchProjectsRequest for details.
             Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
          schema:
            type: string
            title: filter
        - name: orderBy
          in: query
          description: |-
            The order by of projects.
             Support title. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListProjectsResponse'
    post:
      tags:
        - ProjectService
      summary: CreateProject
      description: |-
        Creates a new project in the workspace.
         Permissions required: bb.projects.create
      operationId: ProjectService_CreateProject
      parameters:
        - name: projectId
          in: query
          description: |-
            The ID to use for the project, which will become the final component of
             the project's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
          schema:
            type: string
            title: project_id
      requestBody:
        description: The project to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Project'
              title: project
              description: The project to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects/{project}:
    get:
      tags:
        - ProjectService
      summary: GetProject
      description: |-
        GetProject retrieves a project by name.
         Users with "bb.projects.get" permission on the workspace or the project owner can access this method.
         Permissions required: bb.projects.get
      operationId: ProjectService_GetProject
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
    delete:
      tags:
        - ProjectService
      summary: DeleteProject
      description: |-
        Deletes (soft-delete or purge) a project.
         Permissions required: bb.projects.delete
      operationId: ProjectService_DeleteProject
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: purge
          in: query
          description: |-
            If set to true, permanently purge the soft-deleted project and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted projects.
             The project must already be soft-deleted for this to work.
             When purge=true, all databases will be moved to the default project before deletion.
             When purge=false (soft delete/archive), the project and its databases/issues remain unchanged.
          schema:
            type: boolean
            title: purge
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - ProjectService
      summary: UpdateProject
      description: |-
        Updates an existing project's properties.
         Permissions required: bb.projects.update
      operationId: ProjectService_UpdateProject
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the project is not found, a new project will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The project to update.

           The project's `name` field is used to identify the project to update.
           Format: projects/{project}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Project'
              title: project
              description: |-
                The project to update.

                 The project's `name` field is used to identify the project to update.
                 Format: projects/{project}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects/{project}/accessGrants:
    get:
      tags:
        - AccessGrantService
      summary: ListAccessGrants
      description: Lists access grants in a project.
      operationId: AccessGrantService_ListAccessGrants
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: The maximum number of access grants to return.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: A page token from a previous ListAccessGrants call.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter expression using AIP-160 syntax.
             Supported fields:
             - name: the fullname in "projects/{project}/accessGrants/{access_grant}" format, support "==" operator.
             - creator: the creator name in "users/{email}" format, support "==" operator.
             - status: the access status, support "==" and "in" operator.
             - issue: the access issue fullname, support "==" operator.
             - expire_time: the access expire time in "2006-01-02T15:04:05Z07:00" format, support ">=", ">", "<=" and "<" operator.
             - create_time: the access creation time in "2006-01-02T15:04:05Z07:00" format, support ">=", ">", "<=" and "<" operator.
             - query: the access query, support "==" and ".contains(xx)" operator.
               Equality trims only boundary ASCII space, tab, LF, CR, vertical tab, and form feed.
             - query_hash: supports "==" with a lowercase hexadecimal SHA-256 digest of
               the UTF-8 query after the same boundary trim. Internal whitespace and Unicode
               remain unchanged.
             - schema: execution schema, supports "=="; empty matches only empty or absent values.
             - container: execution container, supports "=="; empty matches only empty or absent values.
             - target: the target database fullname, support "==" operator.
             - unmask: whether the grant allows unmasking sensitive data, support "==" operator with a boolean literal.
             - export: whether the grant allows exporting the query result, support "==" operator with a boolean literal.

             Examples:
             - creator == "users/dev@example.com"
             - status == "ACTIVE"
             - status in ["ACTIVE", "PENDING"]
             - creator == "users/dev@example.com" && status == "ACTIVE"
             - issue == "projects/x/issues/123"
             - status == "ACTIVE" && expire_time > "2024-02-01T00:00:00Z"
             - target == "instances/sample/databases/employee"
             - unmask == true
             - export == true && status == "ACTIVE"
          schema:
            type: string
            title: filter
        - name: orderBy
          in: query
          description: |-
            The order by of access grants.
             Support creator, expire_time, create_time. The default sorting order is ascending.
             For example:
             - order_by = "creator"
             - order_by = "expire_time desc"
             - order_by = "expire_time asc, create_time desc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListAccessGrantsResponse'
    post:
      tags:
        - AccessGrantService
      summary: CreateAccessGrant
      description: Creates an access grant.
      operationId: AccessGrantService_CreateAccessGrant
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        description: The access grant to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AccessGrant'
              title: access_grant
              description: The access grant to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AccessGrant'
  /v1/projects/{project}/accessGrants/{accessGrant}:
    get:
      tags:
        - AccessGrantService
      summary: GetAccessGrant
      description: Gets an access grant by name.
      operationId: AccessGrantService_GetAccessGrant
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: accessGrant
          in: path
          description: The accessGrant id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AccessGrant'
  /v1/projects/{project}/accessGrants/{accessGrant}:activate:
    post:
      tags:
        - AccessGrantService
      summary: ActivateAccessGrant
      description: Activates a pending access grant.
      operationId: AccessGrantService_ActivateAccessGrant
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: accessGrant
          in: path
          description: The accessGrant id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AccessGrant'
  /v1/projects/{project}/accessGrants/{accessGrant}:revoke:
    post:
      tags:
        - AccessGrantService
      summary: RevokeAccessGrant
      description: Revokes an active access grant.
      operationId: AccessGrantService_RevokeAccessGrant
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: accessGrant
          in: path
          description: The accessGrant id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AccessGrant'
  /v1/projects/{project}/accessGrants:searchMy:
    post:
      tags:
        - AccessGrantService
      summary: SearchMyAccessGrants
      description: Searches access grants created by the caller.
      operationId: AccessGrantService_SearchMyAccessGrants
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: The maximum number of access grants to return.
                pageToken:
                  type: string
                  title: page_token
                  description: A page token from a previous SearchMyAccessGrants call.
                filter:
                  type: string
                  title: filter
                  description: Check the filter field in the ListAccessGrantsRequest message.
                orderBy:
                  type: string
                  title: order_by
                  description: Check the order_by field in the ListAccessGrantsRequest message.
              title: SearchMyAccessGrantsRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchMyAccessGrantsResponse'
  /v1/projects/{project}/auditLogs:export:
    post:
      tags:
        - AuditLogService
      summary: ExportAuditLogs
      description: |-
        Exports audit logs in a specified format for external analysis.
         Permissions required: bb.auditLogs.export
      operationId: AuditLogService_ExportAuditLogs
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  type: string
                  title: filter
                  description: |-
                    The filter of the log. It should be a valid CEL expression.
                     Check the filter field in the SearchAuditLogsRequest message.
                orderBy:
                  type: string
                  title: order_by
                  description: |-
                    The order by of the log.
                     Only support order by create_time. The default sorting order is ascending.
                     For example:
                      - order_by = "create_time asc"
                      - order_by = "create_time desc"
                format:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.ExportFormat'
                  title: format
                  description: The export format.
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: |-
                    The maximum number of logs to return.
                     The service may return fewer than this value.
                     If unspecified, at most 10 log entries will be returned.
                     The maximum value is 5000; values above 5000 will be coerced to 5000.
                pageToken:
                  type: string
                  title: page_token
                  description: |-
                    A page token, received from a previous `ExportAuditLogs` call.
                     Provide this to retrieve the subsequent page.
              title: ExportAuditLogsRequest
              additionalProperties: false
              description: Request message for exporting audit logs.
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsResponse'
  /v1/projects/{project}/auditLogs:search:
    post:
      tags:
        - AuditLogService
      summary: SearchAuditLogs
      description: |-
        Searches audit logs with optional filtering and pagination.
         Permissions required: bb.auditLogs.search
      operationId: AuditLogService_SearchAuditLogs
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  type: string
                  title: filter
                  description: |-
                    The filter of the log. It should be a valid CEL expression.
                     The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

                     Supported filter:
                     - method: the API name, can be found in the docs. Usually "/bytebase.v1.…", for example "/bytebase.v1.UserService/CreateUser"; entries written outside the v1 API carry their own prefix, such as "/bytebase.mcp.Session/Authorize" or "/bytebase.cli.Recovery/ResetUserPassword". Support "==" operator.
                     - resource: the resource the entry is about, support "==" operator.
                     - severity: support "==" operator, check Severity enum in AuditLog message for values.
                     - actor: the actor, in users/{email}, serviceAccounts/{email}, or
                       workloadIdentities/{email} format. Support "==" operator.
                     - create_time: support ">=" and "<=" operator.
                     - mcp: true selects the entries MCP produced, false the rest. A boolean, not a string. Support "==" operator.
                     - mcp_correlation_id: the MCP session an entry belongs to, taken from an entry's mcp_delegation.correlation_id. Support "==" operator. Entries MCP produced outside a session — a refused connection or consent — carry none and match no value here.

                     For example:
                      - filter = "method == '/bytebase.v1.SQLService/Query'"
                      - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
                      - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && actor == 'users/bb@bytebase.com'"
                      - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
                      - filter = "mcp == true"
                      - filter = "mcp_correlation_id == '0b7f1a3c-1d2e-4f56-8a90-1b2c3d4e5f60'"
                orderBy:
                  type: string
                  title: order_by
                  description: |-
                    The order by of the log.
                     Only support order by create_time. The default sorting order is ascending.
                     For example:
                      - order_by = "create_time asc"
                      - order_by = "create_time desc"
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: |-
                    The maximum number of logs to return.
                     The service may return fewer than this value.
                     If unspecified, at most 10 log entries will be returned.
                     The maximum value is 5000; values above 5000 will be coerced to 5000.
                pageToken:
                  type: string
                  title: page_token
                  description: |-
                    A page token, received from a previous `SearchLogs` call.
                     Provide this to retrieve the subsequent page.
              title: SearchAuditLogsRequest
              additionalProperties: false
              description: Request message for searching audit logs.
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsResponse'
  /v1/projects/{project}/databaseGroups:
    get:
      tags:
        - DatabaseGroupService
      summary: ListDatabaseGroups
      description: |-
        Lists database groups in a project.
         Permissions required: bb.databaseGroups.list
      operationId: DatabaseGroupService_ListDatabaseGroups
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: view
          in: query
          description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
            title: view
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListDatabaseGroupsResponse'
    post:
      tags:
        - DatabaseGroupService
      summary: CreateDatabaseGroup
      description: |-
        Creates a new database group.
         Permissions required: bb.databaseGroups.create
      operationId: DatabaseGroupService_CreateDatabaseGroup
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: databaseGroupId
          in: query
          description: |-
            The ID to use for the database group, which will become the final component of
             the database group's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
          schema:
            type: string
            title: database_group_id
        - name: validateOnly
          in: query
          description: If set, validate the create request and preview the full database group response, but do not actually create it.
          schema:
            type: boolean
            title: validate_only
      requestBody:
        description: The database group to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
              title: database_group
              description: The database group to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
  /v1/projects/{project}/databaseGroups/{databaseGroup}:
    get:
      tags:
        - DatabaseGroupService
      summary: GetDatabaseGroup
      description: |-
        Gets a database group by name.
         Permissions required: bb.databaseGroups.get
      operationId: DatabaseGroupService_GetDatabaseGroup
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: databaseGroup
          in: path
          description: The databaseGroup id.
          required: true
          schema:
            type: string
        - name: view
          in: query
          description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
            title: view
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
    delete:
      tags:
        - DatabaseGroupService
      summary: DeleteDatabaseGroup
      description: |-
        Deletes a database group.
         Permissions required: bb.databaseGroups.delete
      operationId: DatabaseGroupService_DeleteDatabaseGroup
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: databaseGroup
          in: path
          description: The databaseGroup id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - DatabaseGroupService
      summary: UpdateDatabaseGroup
      description: |-
        Updates a database group.
         Permissions required: bb.databaseGroups.update
         When allow_missing=true, also requires: bb.databaseGroups.create
      operationId: DatabaseGroupService_UpdateDatabaseGroup
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: databaseGroup
          in: path
          description: The databaseGroup id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the database group is not found, a new database group will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The database group to update.

           The database group's `name` field is used to identify the database group to update.
           Format: projects/{project}/databaseGroups/{databaseGroup}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
              title: database_group
              description: |-
                The database group to update.

                 The database group's `name` field is used to identify the database group to update.
                 Format: projects/{project}/databaseGroups/{databaseGroup}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
  /v1/projects/{project}/databases:
    get:
      tags:
        - DatabaseService
      summary: ListDatabases
      description: |-
        Lists databases in a project, instance, or workspace.
         Permissions required: bb.databases.list (for project or workspace parent), or bb.instances.get (for instance parent)
      operationId: DatabaseService_ListDatabases
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListDatabases` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - name: the database name, support ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
             - table: filter by the database table, support "==" and ".contains()" operator.
             - labels.{key}: the database label, support "==" and "in" operators.

             For example:
             environment == "environments/{environment resource id}"
             environment == "" (find databases which environment is not set)
             project == "projects/{project resource id}"
             instance == "instances/{instance resource id}"
             instance == "projects/{project resource id}/instances/{instance resource id}"
             name.contains("database name")
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             exclude_unassigned == true
             table == "sample"
             table.contains("sam")
             labels.environment == "production"
             labels.region == "asia"
             labels.region in ["asia", "europe"]

             You can combine filter conditions like:
             environment == "environments/prod" && name.contains("employee")
          schema:
            type: string
            title: filter
        - name: showDeleted
          in: query
          description: Show deleted database if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: orderBy
          in: query
          description: |-
            The order by of databases.
             Support name, project, instance. The default sorting order is ascending.
             For example:
             - order_by = "name" - order by name ascending
             - order_by = "name desc"
             - order_by = "name desc, project asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
  /v1/projects/{project}/databases:batchGet:
    get:
      tags:
        - DatabaseService
      summary: BatchGetDatabases
      description: |-
        Retrieves multiple databases by their names.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.databases.get (on each named database's project)
      operationId: DatabaseService_BatchGetDatabases
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: names
          in: query
          description: The list of database names to retrieve.
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetDatabasesResponse'
  /v1/projects/{project}/instances:
    get:
      tags:
        - InstanceService
      summary: ListInstances
      description: |-
        Lists database instances, optionally within a project.
         Permissions required: bb.instances.list
      operationId: InstanceService_ListInstances2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of instances to return. The service may return fewer than
             this value.
             If unspecified, at most 10 instances will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListInstances` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstances` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted instances if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter the instance.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - name: the instance name, support "==" and ".contains()" operator.
             - resource_id: the instance id, support "==" and ".contains()" operator.
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - state: the instance state, check State enum for values, support "==" operator.
             - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - host: the instance host, support "==" and ".contains()" operator.
             - port: the instance port, support "==" and ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - labels.{key}: the instance label, support "==" and "in" operators.

             For example:
             name == "sample instance"
             name.contains("sample")
             resource_id == "sample-instance"
             resource_id.contains("sample")
             state == "DELETED"
             environment == "environments/test"
             environment == "" (find instances which environment is not set)
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             host == "127.0.0.1"
             host.contains("127.0")
             port == "54321"
             port.contains("543")
             labels.org_group == "infrastructure"
             labels.environment in ["prod", "production"]
             project == "projects/sample-project"
             You can combine filter conditions like:
             name.contains("sample") && environment == "environments/test"
             host == "127.0.0.1" && port == "54321"
          schema:
            type: string
            title: filter
        - name: orderBy
          in: query
          description: |-
            The order by of instances.
             Support title, environment. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title desc, environment asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstancesResponse'
    post:
      tags:
        - InstanceService
      summary: CreateInstance
      description: |-
        Creates a new database instance.
         Permissions required: bb.instances.create
      operationId: InstanceService_CreateInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instanceId
          in: query
          description: |-
            The ID to use for the instance, which will become the final component of
             the instance's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
          schema:
            type: string
            title: instance_id
        - name: validateOnly
          in: query
          description: Validate only also tests the data source connection.
          schema:
            type: boolean
            title: validate_only
      requestBody:
        description: The instance to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Instance'
              title: instance
              description: The instance to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances/{instance}:
    get:
      tags:
        - InstanceService
      summary: GetInstance
      description: |-
        Gets a database instance by name.
         Permissions required: bb.instances.get
      operationId: InstanceService_GetInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
    delete:
      tags:
        - InstanceService
      summary: DeleteInstance
      description: |-
        Deletes or soft-deletes a database instance.
         Soft-delete requests fail with FAILED_PRECONDITION while any task run
         targeting the instance is pending, available, or running.
         Permissions required: bb.instances.delete
      operationId: InstanceService_DeleteInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: force
          in: query
          description: |-
            If set to true, a workspace instance's databases are moved to the default
             project before the instance is soft-deleted. Project instances reject this
             option because their databases must remain in the owning project.
          schema:
            type: boolean
            title: force
        - name: purge
          in: query
          description: |-
            If set to true, permanently purge the soft-deleted instance and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted instances.
             The instance must already be soft-deleted for this to work.
          schema:
            type: boolean
            title: purge
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - InstanceService
      summary: UpdateInstance
      description: |-
        Updates a database instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_UpdateInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the instance is not found, a new instance will be created.
             In this situation, `update_mask` is ignored. A project-nested name creates
             the instance only under its encoded active, non-default project; it never
             falls back to a workspace instance.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The instance to update.

           The instance's `name` field is used to identify the instance to update.
           Format: instances/{instance} or projects/{project}/instances/{instance}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Instance'
              title: instance
              description: |-
                The instance to update.

                 The instance's `name` field is used to identify the instance to update.
                 Format: instances/{instance} or projects/{project}/instances/{instance}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances/{instance}/databases:
    get:
      tags:
        - DatabaseService
      summary: ListDatabases
      description: |-
        Lists databases in a project, instance, or workspace.
         Permissions required: bb.databases.list (for project or workspace parent), or bb.instances.get (for instance parent)
      operationId: DatabaseService_ListDatabases4
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListDatabases` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - name: the database name, support ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
             - table: filter by the database table, support "==" and ".contains()" operator.
             - labels.{key}: the database label, support "==" and "in" operators.

             For example:
             environment == "environments/{environment resource id}"
             environment == "" (find databases which environment is not set)
             project == "projects/{project resource id}"
             instance == "instances/{instance resource id}"
             instance == "projects/{project resource id}/instances/{instance resource id}"
             name.contains("database name")
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             exclude_unassigned == true
             table == "sample"
             table.contains("sam")
             labels.environment == "production"
             labels.region == "asia"
             labels.region in ["asia", "europe"]

             You can combine filter conditions like:
             environment == "environments/prod" && name.contains("employee")
          schema:
            type: string
            title: filter
        - name: showDeleted
          in: query
          description: Show deleted database if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: orderBy
          in: query
          description: |-
            The order by of databases.
             Support name, project, instance. The default sorting order is ascending.
             For example:
             - order_by = "name" - order by name ascending
             - order_by = "name desc"
             - order_by = "name desc, project asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}:
    get:
      tags:
        - DatabaseService
      summary: GetDatabase
      description: |-
        Retrieves a database by name.
         Permissions required: bb.databases.get
      operationId: DatabaseService_GetDatabase2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Database'
    patch:
      tags:
        - DatabaseService
      summary: UpdateDatabase
      description: |-
        Updates database properties such as labels and project assignment.
         Permissions required: bb.databases.update
      operationId: DatabaseService_UpdateDatabase2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
      requestBody:
        description: |-
          The database to update.

           The database's `name` field is used to identify the database to update.
           Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Database'
              title: database
              description: |-
                The database to update.

                 The database's `name` field is used to identify the database to update.
                 Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Database'
  /v1/projects/{project}/instances/{instance}/databases/{database}/catalog:
    get:
      tags:
        - DatabaseCatalogService
      summary: GetDatabaseCatalog
      description: |-
        Gets the catalog metadata for a database.
         Permissions required: bb.databaseCatalogs.get
      operationId: DatabaseCatalogService_GetDatabaseCatalog2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
    patch:
      tags:
        - DatabaseCatalogService
      summary: UpdateDatabaseCatalog
      description: |-
        Updates catalog metadata such as classifications and labels.
         Permissions required: bb.databaseCatalogs.update
      operationId: DatabaseCatalogService_UpdateDatabaseCatalog2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        description: |-
          The database catalog to update, identified by its `name` field.
           Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog

           Replaces the whole catalog: send the complete value, since anything omitted
           is erased. There is no `update_mask` because `schemas` is a repeated field,
           and AIP-161 forbids addressing one element of one.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
              title: catalog
              description: |-
                The database catalog to update, identified by its `name` field.
                 Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog

                 Replaces the whole catalog: send the complete value, since anything omitted
                 is erased. There is no `update_mask` because `schemas` is a repeated field,
                 and AIP-161 forbids addressing one element of one.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
  /v1/projects/{project}/instances/{instance}/databases/{database}/changelogs:
    get:
      tags:
        - ChangelogService
      summary: ListChangelogs
      description: |-
        Lists migration history for a database.
         Permissions required: bb.changelogs.list
      operationId: ChangelogService_ListChangelogs2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of changelogs to return. The service may return fewer
             than this value. If unspecified, at most 10 changelogs will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from the previous call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: view
          in: query
          description: The view query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
            title: view
        - name: filter
          in: query
          description: |-
            Filter is used to filter changelogs returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - status: the changelog status, support "==" operation. check Changelog.Status for available values.
             - has_schema_snapshot: filters to changelogs with a schema snapshot; only "has_schema_snapshot == true" is supported.
             - create_time: the changelog create time in RFC 3339 format, supports ">=", "<=", or "<" operator.

             Example:
             status == "DONE"
             status == "FAILED"
             has_schema_snapshot == true && create_time < "2024-01-02T00:00:00Z"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListChangelogsResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}:
    get:
      tags:
        - ChangelogService
      summary: GetChangelog
      description: |-
        Retrieves a specific changelog entry.
         Permissions required: bb.changelogs.get
      operationId: ChangelogService_GetChangelog2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: changelog
          in: path
          description: The changelog id.
          required: true
          schema:
            type: string
        - name: view
          in: query
          description: The view query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
            title: view
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Changelog'
  /v1/projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}:diffSchema:
    post:
      tags:
        - DatabaseService
      summary: DiffSchema
      description: |-
        Compares and generates migration statements between two schemas.
         Permissions required: bb.databases.get
      operationId: DatabaseService_DiffSchema4
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: changelog
          in: path
          description: The changelog id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    changelog:
                      type: string
                      title: changelog
                      description: |-
                        The resource name of the changelog
                         Format:
                         instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
                  title: changelog
                - type: object
                  properties:
                    schema:
                      type: string
                      title: schema
                      description: The target schema.
                  title: schema
              unevaluatedProperties: false
              not:
                allOf:
                  - anyOf:
                      - required:
                          - changelog
                      - required:
                          - schema
                  - not:
                      oneOf:
                        - required:
                            - changelog
                        - required:
                            - schema
              title: DiffSchemaRequest
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}/metadata:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseMetadata
      description: |-
        Retrieves database metadata including tables, columns, and indexes.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseMetadata2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - schema: the schema name, support "==" operator.
             - table: the table name, support "==" and ".contains()" operator.

             For example:
             schema == "schema-a"
             table == "table-a"
             table.contains("table-a")
             schema == "schema-a" && table.contains("sample")
             The filter is used to search for tables containing "sample" in the schema "schemas/schema-a".
             The column masking level will only be returned when a table filter is used.
          schema:
            type: string
            title: filter
        - name: limit
          in: query
          description: |-
            Limit the response size of returned table metadata per schema.
             For example, if the database has 3 schemas, and each schema has 100 tables,
             if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
             Default 0, means no limit.
          schema:
            type: integer
            title: limit
            format: int32
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
  /v1/projects/{project}/instances/{instance}/databases/{database}/revisions:
    get:
      tags:
        - RevisionService
      summary: ListRevisions
      description: |-
        Lists schema revisions for a database.
         Permissions required: bb.revisions.list
      operationId: RevisionService_ListRevisions2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of revisions to return. The service may return fewer
             than this value. If unspecified, at most 10 revisions will be returned. The
             maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListRevisions` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListRevisions` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Whether to include deleted revisions in the results.
          schema:
            type: boolean
            title: show_deleted
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListRevisionsResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}/revisions/{revision}:
    get:
      tags:
        - RevisionService
      summary: GetRevision
      description: |-
        Retrieves a schema revision by name.
         Permissions required: bb.revisions.get
      operationId: RevisionService_GetRevision2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: revision
          in: path
          description: The revision id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Revision'
    delete:
      tags:
        - RevisionService
      summary: DeleteRevision
      description: |-
        Deletes a schema revision.
         Permissions required: bb.revisions.delete
      operationId: RevisionService_DeleteRevision2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: revision
          in: path
          description: The revision id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/projects/{project}/instances/{instance}/databases/{database}/revisions:batchCreate:
    post:
      tags:
        - RevisionService
      summary: BatchCreateRevisions
      description: |-
        Creates multiple schema revisions in a single operation.
         Permissions required: bb.revisions.create
      operationId: RevisionService_BatchCreateRevisions2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.CreateRevisionRequest'
                  title: requests
                  description: |-
                    The request message specifying the revisions to create.
                     A maximum of 100 revisions can be created in a batch.
              title: BatchCreateRevisionsRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchCreateRevisionsResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}/schema:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseSchema
      description: |-
        Retrieves database schema as DDL statements.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseSchema2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseSchema'
  /v1/projects/{project}/instances/{instance}/databases/{database}/schemaString:
    get:
      tags:
        - DatabaseService
      summary: GetSchemaString
      description: |-
        Generates schema DDL for a database object.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetSchemaString2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GetSchemaStringRequest.ObjectType'
            title: type
        - name: schema
          in: query
          description: It's empty for DATABASE.
          schema:
            type: string
            title: schema
        - name: object
          in: query
          description: It's empty for DATABASE and SCHEMA.
          schema:
            type: string
            title: object
        - name: metadata.name
          in: query
          description: |-
            The database metadata name.

             Format: instances/{instance}/databases/{database}/metadata or projects/{project}/instances/{instance}/databases/{database}/metadata
          schema:
            type: string
            title: name
        - name: metadata.schemas.name
          in: query
          description: |-
            The name is the schema name.
             It is an empty string for databases without such concept such as MySQL.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.name
          in: query
          description: The name is the name of a table.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.tables.columns.hasDefault
          in: query
          description: The metadata.schemas.tables.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.tables.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.tables.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.tables.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.tables.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.tables.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.tables.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.tables.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.columns.generation.type
          in: query
          description: The metadata.schemas.tables.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.tables.columns.generation.expression
          in: query
          description: The metadata.schemas.tables.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.columns.isIdentity
          in: query
          description: The metadata.schemas.tables.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.tables.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.tables.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.tables.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.tables.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.tables.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.tables.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.tables.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.tables.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.tables.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.tables.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.tables.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.tables.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.tables.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tables.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.tables.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.tables.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.tables.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.tables.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.tables.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.tables.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.tables.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.tables.engine
          in: query
          description: The engine is the engine of a table.
          schema:
            type: string
            title: engine
        - name: metadata.schemas.tables.collation
          in: query
          description: The collation is the collation of a table.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.tables.charset
          in: query
          description: The character set of table.
          schema:
            type: string
            title: charset
        - name: metadata.schemas.tables.rowCount
          in: query
          description: The row_count is the estimated number of rows of a table.
          schema:
            type: string
            title: row_count
            format: int64
        - name: metadata.schemas.tables.dataSize
          in: query
          description: The data_size is the estimated data size of a table.
          schema:
            type: string
            title: data_size
            format: int64
        - name: metadata.schemas.tables.indexSize
          in: query
          description: The index_size is the estimated index size of a table.
          schema:
            type: string
            title: index_size
            format: int64
        - name: metadata.schemas.tables.dataFree
          in: query
          description: The data_free is the estimated free data size of a table.
          schema:
            type: string
            title: data_free
            format: int64
        - name: metadata.schemas.tables.createOptions
          in: query
          description: The create_options is the create option of a table.
          schema:
            type: string
            title: create_options
        - name: metadata.schemas.tables.comment
          in: query
          description: The comment is the comment of a table.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.foreignKeys.name
          in: query
          description: The name is the name of a foreign key.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.foreignKeys.columns
          in: query
          description: The columns are the ordered referencing columns of a foreign key.
          schema:
            type: array
            items:
              type: string
            title: columns
        - name: metadata.schemas.tables.foreignKeys.referencedSchema
          in: query
          description: |-
            The referenced_schema is the referenced schema name of a foreign key.
             It is an empty string for databases without such concept such as MySQL.
          schema:
            type: string
            title: referenced_schema
        - name: metadata.schemas.tables.foreignKeys.referencedTable
          in: query
          description: The referenced_table is the referenced table name of a foreign key.
          schema:
            type: string
            title: referenced_table
        - name: metadata.schemas.tables.foreignKeys.referencedColumns
          in: query
          description: The referenced_columns are the ordered referenced columns of a foreign key.
          schema:
            type: array
            items:
              type: string
            title: referenced_columns
        - name: metadata.schemas.tables.foreignKeys.onDelete
          in: query
          description: The on_delete is the on delete action of a foreign key.
          schema:
            type: string
            title: on_delete
        - name: metadata.schemas.tables.foreignKeys.onUpdate
          in: query
          description: The on_update is the on update action of a foreign key.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.tables.foreignKeys.matchType
          in: query
          description: |-
            The match_type is the match type of a foreign key.
             The match_type is the PostgreSQL specific field.
             It's empty string for other databases.
          schema:
            type: string
            title: match_type
        - name: metadata.schemas.tables.partitions.name
          in: query
          description: The name is the name of a table partition.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.type
          in: query
          description: The type of a table partition.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata.Type'
            title: type
        - name: metadata.schemas.tables.partitions.expression
          in: query
          description: |-
            The expression is the expression of a table partition.
             For PostgreSQL, the expression is the text of {FOR VALUES
             partition_bound_spec}, see
             https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
             the expression is the `expr` or `column_list` of the following syntax.
             PARTITION BY
                { [LINEAR] HASH(expr)
                | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
                | RANGE{(expr) | COLUMNS(column_list)}
                | LIST{(expr) | COLUMNS(column_list)} }.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.partitions.value
          in: query
          description: |-
            The value is the value of a table partition.
             For MySQL, the value is for RANGE and LIST partition types,
             - For a RANGE partition, it contains the value set in the partition's
             VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
             - For a LIST partition, this column contains the values defined in the
             partition's VALUES IN clause, which is a list of comma-separated integer
             values.
             - For others, it's an empty string.
          schema:
            type: string
            title: value
        - name: metadata.schemas.tables.partitions.useDefault
          in: query
          description: |-
            The use_default is whether the users use the default partition, it stores
             the different value for different database engines. For MySQL, it's [INT]
             type, 0 means not use default partition, otherwise, it's equals to number
             in syntax [SUB]PARTITION {number}.
          schema:
            type: string
            title: use_default
        - name: metadata.schemas.tables.partitions.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.tables.partitions.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.tables.partitions.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.tables.partitions.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.tables.partitions.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.tables.partitions.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.tables.partitions.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.tables.partitions.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.partitions.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tables.partitions.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.tables.partitions.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.tables.partitions.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.tables.partitions.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.tables.partitions.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.tables.partitions.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.tables.partitions.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.tables.partitions.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.tables.partitions.checkConstraints.name
          in: query
          description: The name is the name of a check constraint.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.partitions.checkConstraints.expression
          in: query
          description: The expression is the expression of a check constraint.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.checkConstraints.name
          in: query
          description: The name is the name of a check constraint.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.checkConstraints.expression
          in: query
          description: The expression is the expression of a check constraint.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.tables.owner
          in: query
          description: The owner of the table.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.tables.sortingKeys
          in: query
          description: |-
            The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
             Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
          schema:
            type: array
            items:
              type: string
            title: sorting_keys
        - name: metadata.schemas.tables.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tables.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.tables.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.tables.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.tables.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.tables.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.tables.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.tables.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tables.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.tables.skipDump
          in: query
          description: Whether to skip this table during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.tables.shardingInfo
          in: query
          description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
          schema:
            type: string
            title: sharding_info
        - name: metadata.schemas.tables.primaryKeyType
          in: query
          description: |-
            https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
             CLUSTERED or NONCLUSTERED.
          schema:
            type: string
            title: primary_key_type
        - name: metadata.schemas.externalTables.name
          in: query
          description: The name is the name of a external table.
          schema:
            type: string
            title: name
        - name: metadata.schemas.externalTables.externalServerName
          in: query
          description: The external_server_name is the name of the external server.
          schema:
            type: string
            title: external_server_name
        - name: metadata.schemas.externalTables.externalDatabaseName
          in: query
          description: The external_database_name is the name of the external database.
          schema:
            type: string
            title: external_database_name
        - name: metadata.schemas.externalTables.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.externalTables.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.externalTables.columns.hasDefault
          in: query
          description: The metadata.schemas.externalTables.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.externalTables.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.externalTables.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.externalTables.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.externalTables.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.externalTables.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.externalTables.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.externalTables.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.externalTables.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.externalTables.columns.generation.type
          in: query
          description: The metadata.schemas.externalTables.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.externalTables.columns.generation.expression
          in: query
          description: The metadata.schemas.externalTables.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.externalTables.columns.isIdentity
          in: query
          description: The metadata.schemas.externalTables.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.externalTables.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.externalTables.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.externalTables.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.externalTables.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.externalTables.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.externalTables.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.views.name
          in: query
          description: The name is the name of a view.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.definition
          in: query
          description: The definition is the definition of a view.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.views.comment
          in: query
          description: The comment is the comment of a view.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.dependencyColumns.schema
          in: query
          description: The schema is the schema of a reference column.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.views.dependencyColumns.table
          in: query
          description: The table is the table of a reference column.
          schema:
            type: string
            title: table
        - name: metadata.schemas.views.dependencyColumns.column
          in: query
          description: The column is the name of a reference column.
          schema:
            type: string
            title: column
        - name: metadata.schemas.views.columns.name
          in: query
          description: The name is the name of a column.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.columns.position
          in: query
          description: The position is the position in columns.
          schema:
            type: integer
            title: position
            format: int32
        - name: metadata.schemas.views.columns.hasDefault
          in: query
          description: The metadata.schemas.views.columns.hasDefault query parameter.
          schema:
            type: boolean
            title: has_default
        - name: metadata.schemas.views.columns.default
          in: query
          description: The default value of column.
          schema:
            type: string
            title: default
        - name: metadata.schemas.views.columns.defaultOnNull
          in: query
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
          schema:
            type: boolean
            title: default_on_null
        - name: metadata.schemas.views.columns.onUpdate
          in: query
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
          schema:
            type: string
            title: on_update
        - name: metadata.schemas.views.columns.nullable
          in: query
          description: The nullable is the nullable of a column.
          schema:
            type: boolean
            title: nullable
        - name: metadata.schemas.views.columns.type
          in: query
          description: The type is the type of a column.
          schema:
            type: string
            title: type
        - name: metadata.schemas.views.columns.characterSet
          in: query
          description: The character_set is the character_set of a column.
          schema:
            type: string
            title: character_set
        - name: metadata.schemas.views.columns.collation
          in: query
          description: The collation is the collation of a column.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.views.columns.comment
          in: query
          description: The comment is the comment of a column.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.columns.generation.type
          in: query
          description: The metadata.schemas.views.columns.generation.type query parameter.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
            title: type
        - name: metadata.schemas.views.columns.generation.expression
          in: query
          description: The metadata.schemas.views.columns.generation.expression query parameter.
          schema:
            type: string
            title: expression
        - name: metadata.schemas.views.columns.isIdentity
          in: query
          description: The metadata.schemas.views.columns.isIdentity query parameter.
          schema:
            type: boolean
            title: is_identity
        - name: metadata.schemas.views.columns.identityGeneration
          in: query
          description: The identity_generation is for identity columns, PG only.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
            title: identity_generation
        - name: metadata.schemas.views.columns.identitySeed
          in: query
          description: The identity_seed is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_seed
            format: int64
        - name: metadata.schemas.views.columns.identityIncrement
          in: query
          description: The identity_increment is for identity columns, MSSQL only.
          schema:
            type: string
            title: identity_increment
            format: int64
        - name: metadata.schemas.views.columns.defaultConstraintName
          in: query
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
          schema:
            type: string
            title: default_constraint_name
        - name: metadata.schemas.views.columns.srid
          in: query
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
          schema:
            type: integer
            title: srid
        - name: metadata.schemas.views.columns.isInvisible
          in: query
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
          schema:
            type: boolean
            title: is_invisible
        - name: metadata.schemas.views.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.views.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.views.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.views.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.views.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.views.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.views.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.views.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.views.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.views.skipDump
          in: query
          description: The metadata.schemas.views.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.functions.name
          in: query
          description: The name is the name of a function.
          schema:
            type: string
            title: name
        - name: metadata.schemas.functions.definition
          in: query
          description: The definition is the definition of a function.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.functions.signature
          in: query
          description: |-
            The signature is the name with the number and type of input arguments the
             function takes.
          schema:
            type: string
            title: signature
        - name: metadata.schemas.functions.characterSetClient
          in: query
          description: MySQL specific metadata.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.functions.collationConnection
          in: query
          description: The metadata.schemas.functions.collationConnection query parameter.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.functions.databaseCollation
          in: query
          description: The metadata.schemas.functions.databaseCollation query parameter.
          schema:
            type: string
            title: database_collation
        - name: metadata.schemas.functions.sqlMode
          in: query
          description: The metadata.schemas.functions.sqlMode query parameter.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.functions.comment
          in: query
          description: The metadata.schemas.functions.comment query parameter.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.functions.dependencyTables.schema
          in: query
          description: The schema is the schema of a reference table.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.functions.dependencyTables.table
          in: query
          description: The table is the name of a reference table.
          schema:
            type: string
            title: table
        - name: metadata.schemas.functions.skipDump
          in: query
          description: The metadata.schemas.functions.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.procedures.name
          in: query
          description: The name is the name of a procedure.
          schema:
            type: string
            title: name
        - name: metadata.schemas.procedures.definition
          in: query
          description: The definition is the definition of a procedure.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.procedures.signature
          in: query
          description: |-
            The signature is the name with the number and type of input arguments the
             procedure takes.
          schema:
            type: string
            title: signature
        - name: metadata.schemas.procedures.characterSetClient
          in: query
          description: MySQL specific metadata.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.procedures.collationConnection
          in: query
          description: The metadata.schemas.procedures.collationConnection query parameter.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.procedures.databaseCollation
          in: query
          description: The metadata.schemas.procedures.databaseCollation query parameter.
          schema:
            type: string
            title: database_collation
        - name: metadata.schemas.procedures.sqlMode
          in: query
          description: The metadata.schemas.procedures.sqlMode query parameter.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.procedures.comment
          in: query
          description: The comment is the comment of a procedure.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.procedures.skipDump
          in: query
          description: The metadata.schemas.procedures.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.streams.name
          in: query
          description: The name is the name of a stream.
          schema:
            type: string
            title: name
        - name: metadata.schemas.streams.tableName
          in: query
          description: The table_name is the name of the table/view that the stream is created on.
          schema:
            type: string
            title: table_name
        - name: metadata.schemas.streams.owner
          in: query
          description: The owner of the stream.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.streams.comment
          in: query
          description: The comment of the stream.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.streams.type
          in: query
          description: The type of the stream.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Type'
            title: type
        - name: metadata.schemas.streams.stale
          in: query
          description: Indicates whether the stream was last read before the `stale_after` time.
          schema:
            type: boolean
            title: stale
        - name: metadata.schemas.streams.mode
          in: query
          description: The mode of the stream.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Mode'
            title: mode
        - name: metadata.schemas.streams.definition
          in: query
          description: The definition of the stream.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.tasks.name
          in: query
          description: The name is the name of a task.
          schema:
            type: string
            title: name
        - name: metadata.schemas.tasks.id
          in: query
          description: |-
            The id is the snowflake-generated id of a task.
             Example: 01ad32a0-1bb6-5e93-0000-000000000001
          schema:
            type: string
            title: id
        - name: metadata.schemas.tasks.owner
          in: query
          description: The owner of the task.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.tasks.comment
          in: query
          description: The comment of the task.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.tasks.warehouse
          in: query
          description: The warehouse of the task.
          schema:
            type: string
            title: warehouse
        - name: metadata.schemas.tasks.schedule
          in: query
          description: The schedule interval of the task.
          schema:
            type: string
            title: schedule
        - name: metadata.schemas.tasks.predecessors
          in: query
          description: The predecessor tasks of the task.
          schema:
            type: array
            items:
              type: string
            title: predecessors
        - name: metadata.schemas.tasks.state
          in: query
          description: The state of the task.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.TaskMetadata.State'
            title: state
        - name: metadata.schemas.tasks.condition
          in: query
          description: The condition of the task.
          schema:
            type: string
            title: condition
        - name: metadata.schemas.tasks.definition
          in: query
          description: The definition of the task.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.name
          in: query
          description: The name is the name of a materialized view.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.definition
          in: query
          description: The definition is the definition of a materialized view.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.comment
          in: query
          description: The comment is the comment of a materialized view.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.dependencyColumns.schema
          in: query
          description: The schema is the schema of a reference column.
          schema:
            type: string
            title: schema
        - name: metadata.schemas.materializedViews.dependencyColumns.table
          in: query
          description: The table is the table of a reference column.
          schema:
            type: string
            title: table
        - name: metadata.schemas.materializedViews.dependencyColumns.column
          in: query
          description: The column is the name of a reference column.
          schema:
            type: string
            title: column
        - name: metadata.schemas.materializedViews.triggers.name
          in: query
          description: The name is the name of the trigger.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.triggers.event
          in: query
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
          schema:
            type: string
            title: event
        - name: metadata.schemas.materializedViews.triggers.timing
          in: query
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
          schema:
            type: string
            title: timing
        - name: metadata.schemas.materializedViews.triggers.body
          in: query
          description: The body is the body of the trigger.
          schema:
            type: string
            title: body
        - name: metadata.schemas.materializedViews.triggers.sqlMode
          in: query
          description: The SQL mode setting for the trigger.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.materializedViews.triggers.characterSetClient
          in: query
          description: The character set used by the client creating the trigger.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.materializedViews.triggers.collationConnection
          in: query
          description: The collation used for the connection when creating the trigger.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.materializedViews.triggers.comment
          in: query
          description: The comment describing the trigger.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.triggers.skipDump
          in: query
          description: Whether to skip this trigger during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.materializedViews.indexes.name
          in: query
          description: The name is the name of an index.
          schema:
            type: string
            title: name
        - name: metadata.schemas.materializedViews.indexes.expressions
          in: query
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
          schema:
            type: array
            items:
              type: string
            title: expressions
        - name: metadata.schemas.materializedViews.indexes.keyLength
          in: query
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
          schema:
            type: array
            items:
              type: string
              format: int64
            title: key_length
        - name: metadata.schemas.materializedViews.indexes.descending
          in: query
          description: The descending is the ordered descending of an index.
          schema:
            type: array
            items:
              type: boolean
            title: descending
        - name: metadata.schemas.materializedViews.indexes.type
          in: query
          description: The type is the type of an index.
          schema:
            type: string
            title: type
        - name: metadata.schemas.materializedViews.indexes.unique
          in: query
          description: The unique is whether the index is unique.
          schema:
            type: boolean
            title: unique
        - name: metadata.schemas.materializedViews.indexes.primary
          in: query
          description: The primary is whether the index is a primary key index.
          schema:
            type: boolean
            title: primary
        - name: metadata.schemas.materializedViews.indexes.visible
          in: query
          description: The visible is whether the index is visible.
          schema:
            type: boolean
            title: visible
        - name: metadata.schemas.materializedViews.indexes.comment
          in: query
          description: The comment is the comment of an index.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.materializedViews.indexes.definition
          in: query
          description: The definition of an index.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.materializedViews.indexes.parentIndexSchema
          in: query
          description: The schema name of the parent index.
          schema:
            type: string
            title: parent_index_schema
        - name: metadata.schemas.materializedViews.indexes.parentIndexName
          in: query
          description: The index name of the parent index.
          schema:
            type: string
            title: parent_index_name
        - name: metadata.schemas.materializedViews.indexes.granularity
          in: query
          description: The number of granules in the block. It's a ClickHouse specific field.
          schema:
            type: string
            title: granularity
            format: int64
        - name: metadata.schemas.materializedViews.indexes.isConstraint
          in: query
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
          schema:
            type: boolean
            title: is_constraint
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.method
          in: query
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
          schema:
            type: string
            title: method
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.scheme
          in: query
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
          schema:
            type: string
            title: scheme
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.gridLevels.level
          in: query
          description: Grid level number (1-4 for SQL Server)
          schema:
            type: integer
            title: level
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.gridLevels.density
          in: query
          description: Grid density (LOW, MEDIUM, HIGH)
          schema:
            type: string
            title: density
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.cellsPerObject
          in: query
          description: Number of cells per object (1-8192 for SQL Server)
          schema:
            type: integer
            title: cells_per_object
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.xmin
          in: query
          description: Minimum X coordinate
          schema:
            type: number
            title: xmin
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.ymin
          in: query
          description: Minimum Y coordinate
          schema:
            type: number
            title: ymin
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.xmax
          in: query
          description: Maximum X coordinate
          schema:
            type: number
            title: xmax
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.tessellation.boundingBox.ymax
          in: query
          description: Maximum Y coordinate
          schema:
            type: number
            title: ymax
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.fillfactor
          in: query
          description: Fill factor percentage (1-100)
          schema:
            type: integer
            title: fillfactor
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.buffering
          in: query
          description: Buffering mode for PostgreSQL (auto, on, off)
          schema:
            type: string
            title: buffering
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.tablespace
          in: query
          description: Tablespace configuration for Oracle
          schema:
            type: string
            title: tablespace
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.workTablespace
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.workTablespace query parameter.
          schema:
            type: string
            title: work_tablespace
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.sdoLevel
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.sdoLevel query parameter.
          schema:
            type: integer
            title: sdo_level
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.commitInterval
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.commitInterval query parameter.
          schema:
            type: integer
            title: commit_interval
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.padIndex
          in: query
          description: SQL Server specific parameters
          schema:
            type: boolean
            title: pad_index
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.sortInTempdb
          in: query
          description: ON, OFF
          schema:
            type: string
            title: sort_in_tempdb
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.dropExisting
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.dropExisting query parameter.
          schema:
            type: boolean
            title: drop_existing
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.online
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.online query parameter.
          schema:
            type: boolean
            title: online
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowRowLocks
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowRowLocks query parameter.
          schema:
            type: boolean
            title: allow_row_locks
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowPageLocks
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.allowPageLocks query parameter.
          schema:
            type: boolean
            title: allow_page_locks
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.maxdop
          in: query
          description: The metadata.schemas.materializedViews.indexes.spatialConfig.storage.maxdop query parameter.
          schema:
            type: integer
            title: maxdop
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.storage.dataCompression
          in: query
          description: NONE, ROW, PAGE
          schema:
            type: string
            title: data_compression
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.dimensions
          in: query
          description: Number of dimensions (2-4, default 2)
          schema:
            type: integer
            title: dimensions
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.dataType
          in: query
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.srid
          in: query
          description: Spatial reference system identifier (SRID)
          schema:
            type: integer
            title: srid
            format: int32
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.dimension
          in: query
          description: Dimension name/type (X, Y, Z, M, etc.)
          schema:
            type: string
            title: dimension
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.minValue
          in: query
          description: Minimum value for this dimension
          schema:
            type: number
            title: min_value
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.maxValue
          in: query
          description: Maximum value for this dimension
          schema:
            type: number
            title: max_value
            format: double
        - name: metadata.schemas.materializedViews.indexes.spatialConfig.dimensional.constraints.tolerance
          in: query
          description: Tolerance for this dimension
          schema:
            type: number
            title: tolerance
            format: double
        - name: metadata.schemas.materializedViews.indexes.opclassNames
          in: query
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: string
            title: opclass_names
        - name: metadata.schemas.materializedViews.indexes.opclassDefaults
          in: query
          description: True if the operator class is the default. (PostgreSQL specific).
          schema:
            type: array
            items:
              type: boolean
            title: opclass_defaults
        - name: metadata.schemas.materializedViews.skipDump
          in: query
          description: The metadata.schemas.materializedViews.skipDump query parameter.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.packages.name
          in: query
          description: The name is the name of a package.
          schema:
            type: string
            title: name
        - name: metadata.schemas.packages.definition
          in: query
          description: The definition is the definition of a package.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.owner
          in: query
          description: The owner of the schema.
          schema:
            type: string
            title: owner
        - name: metadata.schemas.sequences.name
          in: query
          description: The name of a sequence.
          schema:
            type: string
            title: name
        - name: metadata.schemas.sequences.dataType
          in: query
          description: The data type of a sequence.
          schema:
            type: string
            title: data_type
        - name: metadata.schemas.sequences.start
          in: query
          description: The start value of a sequence.
          schema:
            type: string
            title: start
        - name: metadata.schemas.sequences.minValue
          in: query
          description: The minimum value of a sequence.
          schema:
            type: string
            title: min_value
        - name: metadata.schemas.sequences.maxValue
          in: query
          description: The maximum value of a sequence.
          schema:
            type: string
            title: max_value
        - name: metadata.schemas.sequences.increment
          in: query
          description: Increment value of a sequence.
          schema:
            type: string
            title: increment
        - name: metadata.schemas.sequences.cycle
          in: query
          description: Cycle is whether the sequence cycles.
          schema:
            type: boolean
            title: cycle
        - name: metadata.schemas.sequences.cacheSize
          in: query
          description: Cache size of a sequence.
          schema:
            type: string
            title: cache_size
        - name: metadata.schemas.sequences.lastValue
          in: query
          description: Last value of a sequence.
          schema:
            type: string
            title: last_value
        - name: metadata.schemas.sequences.ownerTable
          in: query
          description: The owner table of the sequence.
          schema:
            type: string
            title: owner_table
        - name: metadata.schemas.sequences.ownerColumn
          in: query
          description: The owner column of the sequence.
          schema:
            type: string
            title: owner_column
        - name: metadata.schemas.sequences.comment
          in: query
          description: The comment describing the sequence.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.sequences.skipDump
          in: query
          description: Whether to skip this sequence during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.events.name
          in: query
          description: The name of the event.
          schema:
            type: string
            title: name
        - name: metadata.schemas.events.definition
          in: query
          description: The schedule of the event.
          schema:
            type: string
            title: definition
        - name: metadata.schemas.events.timeZone
          in: query
          description: The time zone of the event.
          schema:
            type: string
            title: time_zone
        - name: metadata.schemas.events.sqlMode
          in: query
          description: The SQL mode setting for the event.
          schema:
            type: string
            title: sql_mode
        - name: metadata.schemas.events.characterSetClient
          in: query
          description: The character set used by the client creating the event.
          schema:
            type: string
            title: character_set_client
        - name: metadata.schemas.events.collationConnection
          in: query
          description: The collation used for the connection when creating the event.
          schema:
            type: string
            title: collation_connection
        - name: metadata.schemas.events.comment
          in: query
          description: The comment is the comment of an event.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.enumTypes.name
          in: query
          description: The name of a type.
          schema:
            type: string
            title: name
        - name: metadata.schemas.enumTypes.values
          in: query
          description: The enum values of a type.
          schema:
            type: array
            items:
              type: string
            title: values
        - name: metadata.schemas.enumTypes.comment
          in: query
          description: The comment describing the enum type.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.enumTypes.skipDump
          in: query
          description: Whether to skip this enum type during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.skipDump
          in: query
          description: Whether to skip this schema during schema dump operations.
          schema:
            type: boolean
            title: skip_dump
        - name: metadata.schemas.comment
          in: query
          description: The comment is the comment of a schema.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.compositeTypes.name
          in: query
          description: The name of the composite type.
          schema:
            type: string
            title: name
        - name: metadata.schemas.compositeTypes.attributes.name
          in: query
          description: The name of the attribute.
          schema:
            type: string
            title: name
        - name: metadata.schemas.compositeTypes.attributes.type
          in: query
          description: The attribute type. User-defined types are always schema-qualified.
          schema:
            type: string
            title: type
        - name: metadata.schemas.compositeTypes.attributes.collation
          in: query
          description: |-
            The non-default collation of the attribute as an emit-ready SQL
             identifier reference (quoted as needed, schema-qualified when outside
             pg_catalog), empty otherwise. e.g. `"C"` or `locale.en_us`.
          schema:
            type: string
            title: collation
        - name: metadata.schemas.compositeTypes.attributes.comment
          in: query
          description: The comment describing the attribute.
          schema:
            type: string
            title: comment
        - name: metadata.schemas.compositeTypes.comment
          in: query
          description: The comment describing the composite type.
          schema:
            type: string
            title: comment
        - name: metadata.characterSet
          in: query
          description: The character_set is the character set of a database.
          schema:
            type: string
            title: character_set
        - name: metadata.collation
          in: query
          description: The collation is the collation of a database.
          schema:
            type: string
            title: collation
        - name: metadata.extensions.name
          in: query
          description: The name is the name of an extension.
          schema:
            type: string
            title: name
        - name: metadata.extensions.schema
          in: query
          description: |-
            The schema is the extension that is installed to. But the extension usage
             is not limited to the schema.
          schema:
            type: string
            title: schema
        - name: metadata.extensions.version
          in: query
          description: The version is the version of an extension.
          schema:
            type: string
            title: version
        - name: metadata.extensions.description
          in: query
          description: The description is the description of an extension.
          schema:
            type: string
            title: description
        - name: metadata.owner
          in: query
          description: The owner of the database.
          schema:
            type: string
            title: owner
        - name: metadata.searchPath
          in: query
          description: The search_path is the search path of a PostgreSQL database.
          schema:
            type: string
            title: search_path
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.GetSchemaStringResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}/sdlSchema:
    get:
      tags:
        - DatabaseService
      summary: GetDatabaseSDLSchema
      description: |-
        Retrieves database schema in SDL (Schema Definition Language) format.
         Permissions required: bb.databases.getSchema
      operationId: DatabaseService_GetDatabaseSDLSchema2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
        - name: format
          in: query
          description: The format of the SDL schema output.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat'
            title: format
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DatabaseSDLSchema'
  /v1/projects/{project}/instances/{instance}/databases/{database}:diffMetadata:
    post:
      tags:
        - DatabaseService
      summary: DiffMetadata
      description: |-
        Generates migration statements from the database's current schema to the
         given target metadata.
         Permissions required: bb.databases.diffMetadata
      operationId: DatabaseService_DiffMetadata2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                targetMetadata:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
                  title: target_metadata
                  description: |-
                    The metadata of the target schema. The source metadata and the engine are
                     read from the database, so only the target travels in the request.
                     Must describe the COMPLETE target schema: the diff runs against the full
                     stored source, so any object omitted from the target (for example by a
                     truncated metadata fetch) is treated as dropped.
              title: DiffMetadataRequest
              required:
                - targetMetadata
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffMetadataResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}:diffSchema:
    post:
      tags:
        - DatabaseService
      summary: DiffSchema
      description: |-
        Compares and generates migration statements between two schemas.
         Permissions required: bb.databases.get
      operationId: DatabaseService_DiffSchema2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    changelog:
                      type: string
                      title: changelog
                      description: |-
                        The resource name of the changelog
                         Format:
                         instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
                  title: changelog
                - type: object
                  properties:
                    schema:
                      type: string
                      title: schema
                      description: The target schema.
                  title: schema
              unevaluatedProperties: false
              not:
                allOf:
                  - anyOf:
                      - required:
                          - changelog
                      - required:
                          - schema
                  - not:
                      oneOf:
                        - required:
                            - changelog
                        - required:
                            - schema
              title: DiffSchemaRequest
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}:export:
    post:
      tags:
        - SQLService
      summary: Export
      description: |-
        Exports query results to a file format.
         Permissions required: bb.databases.get, and bb.sql.export on the data the statement reads.
         An active access grant with export=true for the statement satisfies bb.sql.export on its target databases.
      operationId: SQLService_Export2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                statement:
                  type: string
                  title: statement
                  description: The SQL statement to execute.
                limit:
                  type: integer
                  title: limit
                  format: int32
                  description: The maximum number of rows to return.
                format:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.ExportFormat'
                  title: format
                  description: The export format.
                admin:
                  type: boolean
                  title: admin
                  description: |-
                    The admin is used for workspace owner and DBA for exporting data from SQL
                     Editor Admin mode. The exported data is not masked.
                password:
                  type: string
                  title: password
                  description: The zip password provide by users.
                dataSourceId:
                  type: string
                  title: data_source_id
                  description: |-
                    The id of data source.
                     If omitted, Export resolves the data source server-side by using the
                     single read-only data source when exactly one exists, or the admin data
                     source otherwise. It can also be set explicitly to export from the admin
                     data source or a specific read-only data source.
                schema:
                  type:
                    - string
                    - "null"
                  title: schema
                  description: |-
                    The default schema to search objects. Equals to the current schema in
                     Oracle and search path in Postgres.
                container:
                  type:
                    - string
                    - "null"
                  title: container
                  description: |-
                    Container is the container name to execute the query against, used for
                     CosmosDB only.
                destination:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.ExportDestination'
                  title: destination
                  description: |-
                    Where the export goes. A destination the workspace query data policy
                     does not allow is rejected with FAILED_PRECONDITION.
              title: ExportRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExportResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}:query:
    post:
      tags:
        - SQLService
      summary: Query
      description: |-
        Executes a read-only SQL query against a database.
         Permissions required: bb.databases.get
      operationId: SQLService_Query2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                statement:
                  type: string
                  title: statement
                  description: The SQL statement to execute.
                limit:
                  type: integer
                  title: limit
                  format: int32
                  description: The maximum number of rows to return.
                dataSourceId:
                  type: string
                  title: data_source_id
                  description: |-
                    The id of data source.
                     If omitted, Query resolves the data source server-side by using the single
                     read-only data source when exactly one exists, or the admin data source
                     otherwise. It can also be set explicitly to query the admin data source or
                     a specific read-only data source.
                explain:
                  type: boolean
                  title: explain
                  description: Explain the statement.
                schema:
                  type:
                    - string
                    - "null"
                  title: schema
                  description: |-
                    The default schema to search objects. Equals to the current schema in
                     Oracle and search path in Postgres.
                queryOption:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.QueryOption'
                  title: query_option
                container:
                  type:
                    - string
                    - "null"
                  title: container
                  description: |-
                    Container is the container name to execute the query against, used for
                     CosmosDB only.
              title: QueryRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.QueryResponse'
  /v1/projects/{project}/instances/{instance}/databases/{database}:sync:
    post:
      tags:
        - DatabaseService
      summary: SyncDatabase
      description: |-
        Synchronizes database schema from the instance.
         Permissions required: bb.databases.sync
      operationId: DatabaseService_SyncDatabase2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: database
          in: path
          description: The database id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SyncDatabaseResponse'
  /v1/projects/{project}/instances/{instance}/databases:batchGet:
    get:
      tags:
        - DatabaseService
      summary: BatchGetDatabases
      description: |-
        Retrieves multiple databases by their names.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.databases.get (on each named database's project)
      operationId: DatabaseService_BatchGetDatabases3
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: names
          in: query
          description: The list of database names to retrieve.
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetDatabasesResponse'
  /v1/projects/{project}/instances/{instance}/databases:batchSync:
    post:
      tags:
        - DatabaseService
      summary: BatchSyncDatabases
      description: |-
        Synchronizes multiple databases in a single batch operation.
         Permissions required: bb.databases.sync
      operationId: DatabaseService_BatchSyncDatabases2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                names:
                  type: array
                  items:
                    type: string
                  title: names
                  description: The list of database names to sync.
              title: BatchSyncDatabasesRequest
              required:
                - names
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchSyncDatabasesResponse'
  /v1/projects/{project}/instances/{instance}/databases:batchUpdate:
    post:
      tags:
        - DatabaseService
      summary: BatchUpdateDatabases
      description: |-
        Updates multiple databases in a single batch operation.
         Permissions required: bb.databases.update
      operationId: DatabaseService_BatchUpdateDatabases2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.UpdateDatabaseRequest'
                  title: requests
                  description: |-
                    The request message specifying the resources to update.
                     A maximum of 1000 databases can be modified in a batch.
              title: BatchUpdateDatabasesRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchUpdateDatabasesResponse'
  /v1/projects/{project}/instances/{instance}/roles:
    get:
      tags:
        - InstanceRoleService
      summary: ListInstanceRoles
      description: |-
        Lists all database roles in an instance.
         Permissions required: bb.instanceRoles.list
      operationId: InstanceRoleService_ListInstanceRoles2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            Not used.
             The maximum number of roles to return. The service may return fewer than
             this value.
             If unspecified, at most 10 roles will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            Not used.
             A page token, received from a previous `ListInstanceRoles` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstanceRoles` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: refresh
          in: query
          description: Refresh will refresh and return the latest data.
          schema:
            type: boolean
            title: refresh
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstanceRolesResponse'
  /v1/projects/{project}/instances/{instance}:addDataSource:
    post:
      tags:
        - InstanceService
      summary: AddDataSource
      description: |-
        Adds a read-only data source to an instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_AddDataSource2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dataSource:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DataSource'
                  title: data_source
                  description: |-
                    Identified by data source ID.
                     Only READ_ONLY data source can be added.
                validateOnly:
                  type: boolean
                  title: validate_only
                  description: Validate only also tests the data source connection.
              title: AddDataSourceRequest
              required:
                - dataSource
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances/{instance}:databases:
    post:
      tags:
        - InstanceService
      summary: ListInstanceDatabase
      description: |-
        Lists all databases within an instance without creating them.
         Permissions required: bb.instances.get
      operationId: InstanceService_ListInstanceDatabase2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                instance:
                  oneOf:
                    - $ref: '#/components/schemas/bytebase.v1.Instance'
                    - type: "null"
                  title: instance
                  description: The target instance. We need to set this field if the target instance is not created yet.
              title: ListInstanceDatabaseRequest
              required:
                - instance
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListInstanceDatabaseResponse'
  /v1/projects/{project}/instances/{instance}:removeDataSource:
    post:
      tags:
        - InstanceService
      summary: RemoveDataSource
      description: |-
        Removes a read-only data source from an instance.
         Permissions required: bb.instances.update
      operationId: InstanceService_RemoveDataSource2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dataSource:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.DataSource'
                  title: data_source
                  description: |-
                    Identified by data source ID.
                     Only READ_ONLY data source can be removed.
              title: RemoveDataSourceRequest
              required:
                - dataSource
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances/{instance}:sync:
    post:
      tags:
        - InstanceService
      summary: SyncInstance
      description: |-
        Syncs database schemas and metadata from an instance.
         Permissions required: bb.instances.sync
      operationId: InstanceService_SyncInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                enableFullSync:
                  type: boolean
                  title: enable_full_sync
                  description: |-
                    When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
                     the instance metadata (such as the database list) and any newly discovered databases will be synced.
              title: SyncInstanceRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SyncInstanceResponse'
  /v1/projects/{project}/instances/{instance}:undelete:
    post:
      tags:
        - InstanceService
      summary: UndeleteInstance
      description: |-
        Restores a soft-deleted database instance.
         Restore requests fail with FAILED_PRECONDITION while any task run targeting
         the instance is pending, available, or running.
         Permissions required: bb.instances.undelete
      operationId: InstanceService_UndeleteInstance2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances/{instance}:updateDataSource:
    patch:
      tags:
        - InstanceService
      summary: UpdateDataSource
      description: |-
        Updates a data source configuration.
         Permissions required: bb.instances.update
      operationId: InstanceService_UpdateDataSource2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: instance
          in: path
          description: The instance id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: validateOnly
          in: query
          description: Validate only also tests the data source connection.
          schema:
            type: boolean
            title: validate_only
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the data source is not found, a new data source will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: Identified by data source ID.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSource'
              title: data_source
              description: Identified by data source ID.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/instances:batchSync:
    post:
      tags:
        - InstanceService
      summary: BatchSyncInstances
      description: |-
        Syncs multiple instances in a single request.
         Permissions required: bb.instances.sync
      operationId: InstanceService_BatchSyncInstances2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.SyncInstanceRequest'
                  title: requests
                  description: |-
                    The request message specifying the instances to sync.
                     A maximum of 1000 instances can be synced in a batch.
              title: BatchSyncInstancesRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchSyncInstancesResponse'
  /v1/projects/{project}/instances:batchUpdate:
    post:
      tags:
        - InstanceService
      summary: BatchUpdateInstances
      description: |-
        Updates multiple instances in a single request.
         Permissions required: bb.instances.update
      operationId: InstanceService_BatchUpdateInstances2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.UpdateInstanceRequest'
                  title: requests
                  description: The request message specifying the resources to update.
              title: BatchUpdateInstancesRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchUpdateInstancesResponse'
  /v1/projects/{project}/instances:prepareSampleProjectInstance:
    post:
      tags:
        - InstanceService
      summary: PrepareSampleProjectInstance
      description: |-
        Prepares a Sample Project Instance for a project.
         Permissions required: bb.instances.create
      operationId: InstanceService_PrepareSampleProjectInstance
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Instance'
  /v1/projects/{project}/issues:
    get:
      tags:
        - IssueService
      summary: ListIssues
      description: |-
        Lists issues in a project.
         Permissions required: bb.issues.list
      operationId: IssueService_ListIssues
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of issues to return. The service may return fewer than
             this value.
             If unspecified, at most 10 issues will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListIssues` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListIssues` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter issues returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
             - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
             - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
             - labels: the issue labels, support "==" and "in" operator.
             - risk_level: the issue risk level, support "in" operator, check the RiskLevel enum for the values.
             - approval_status: issue approval status, support "==" operator.
             - current_approver: the issue approver, should in "users/{email} format", support "==" operator.

             For example:
             creator == "users/ed@bytebase.com" && status in ["OPEN", "DONE"]
             status == "CANCELED" && type == "DATABASE_CHANGE"
             labels in ["label1", "label2"]
             risk_level in ["HIGH", "MODERATE"]
             create_time >= "2025-01-02T15:04:05Z07:00"
          schema:
            type: string
            title: filter
        - name: query
          in: query
          description: Query is the query statement.
          schema:
            type: string
            title: query
        - name: orderBy
          in: query
          description: |-
            The order by of issues.
             Support:
             - create_time
             - update_time
             The default sorting order is ascending.
             For example:
             - order_by = "create_time desc"
             - order_by = "update_time asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListIssuesResponse'
    post:
      tags:
        - IssueService
      summary: CreateIssue
      description: |-
        Creates a new issue for database changes or tasks.
         Permissions required: bb.issues.create
      operationId: IssueService_CreateIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        description: The issue to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Issue'
              title: issue
              description: The issue to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues/{issue}:
    get:
      tags:
        - IssueService
      summary: GetIssue
      description: |-
        Retrieves an issue by name.
         Permissions required: bb.issues.get
      operationId: IssueService_GetIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: force
          in: query
          description: If set to true, bypass cache and fetch the latest data.
          schema:
            type: boolean
            title: force
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
    patch:
      tags:
        - IssueService
      summary: UpdateIssue
      description: |-
        Updates an issue's properties such as title, description, or labels.
         Permissions required: bb.issues.update
      operationId: IssueService_UpdateIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          required: true
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the issue is not found, a new issue will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The issue to update.

           The issue's `name` field is used to identify the issue to update.
           Format: projects/{project}/issues/{issue}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Issue'
              title: issue
              description: |-
                The issue to update.

                 The issue's `name` field is used to identify the issue to update.
                 Format: projects/{project}/issues/{issue}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues/{issue}/issueComments:
    get:
      tags:
        - IssueService
      summary: ListIssueComments
      description: |-
        Lists comments on an issue.
         Permissions required: bb.issueComments.list
      operationId: IssueService_ListIssueComments
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of issue comments to return. The service may return fewer than
             this value.
             If unspecified, at most 10 issue comments will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListIssueComments` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListIssueComments` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            CEL filter over events, root comments, and replies.
             Supported: root == null, root == "<comment name>", or root in ["<comment name>", ...].
             Root names must belong to parent. Empty and root == null return the
             timeline (events and root comments); other filters return replies only.
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListIssueCommentsResponse'
  /v1/projects/{project}/issues/{issue}/reviewRuns/{reviewRun}:
    get:
      tags:
        - IssueService
      summary: GetReviewRun
      description: |-
        Gets the current run of one reviewer on an issue. The run carries
         execution status only; review results are issue comments. A reviewer
         that has never run on the issue is NOT_FOUND.
         Permissions required: bb.reviewRuns.get
      operationId: IssueService_GetReviewRun
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: reviewRun
          in: path
          description: The reviewRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ReviewRun'
  /v1/projects/{project}/issues/{issue}/reviewRuns/{reviewRun}:run:
    post:
      tags:
        - IssueService
      summary: RunReview
      description: |-
        Triggers a review run. The slot is reset unconditionally: a RUNNING
         execution is superseded (its completion is fenced off), the attempt
         number is bumped, and the returned run is AVAILABLE.
         Review results are not returned by this RPC: they are posted as issue
         comments. The returned run carries execution status only, and
         GetReviewRun reads it back.
         The audit log is the only record of who triggered a run.
         Permissions required: bb.reviewRuns.run
      operationId: IssueService_RunReview
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: reviewRun
          in: path
          description: The reviewRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ReviewRun'
  /v1/projects/{project}/issues/{issue}:approve:
    post:
      tags:
        - IssueService
      summary: ApproveIssue
      description: |-
        Approves an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
         Permissions required: None (determined by approval flow)
      operationId: IssueService_ApproveIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
                  title: comment
                  description: The comment explaining the approval decision.
              title: ApproveIssueRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues/{issue}:comment:
    post:
      tags:
        - IssueService
      summary: CreateIssueComment
      description: |-
        Adds a comment to an issue.
         Permissions required: bb.issueComments.create
      operationId: IssueService_CreateIssueComment
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
      requestBody:
        description: The comment to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment'
              title: issue_comment
              description: The comment to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IssueComment'
    patch:
      tags:
        - IssueService
      summary: UpdateIssueComment
      description: |-
        Updates an existing issue comment.
         Permissions required: bb.issueComments.update
      operationId: IssueService_UpdateIssueComment
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          required: true
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the issue comment is not found, a new issue comment will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: The comment to update.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment'
              title: issue_comment
              description: The comment to update.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IssueComment'
  /v1/projects/{project}/issues/{issue}:reject:
    post:
      tags:
        - IssueService
      summary: RejectIssue
      description: |-
        Rejects an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
         Permissions required: None (determined by approval flow)
      operationId: IssueService_RejectIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
                  title: comment
                  description: The comment explaining the rejection decision.
              title: RejectIssueRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues/{issue}:request:
    post:
      tags:
        - IssueService
      summary: RequestIssue
      description: |-
        Requests changes on an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
         Permissions required: None (determined by approval flow)
      operationId: IssueService_RequestIssue
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
                  title: comment
                  description: The comment explaining the request.
              title: RequestIssueRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues/{issue}:retryApproval:
    post:
      tags:
        - IssueService
      summary: RetryIssueApproval
      description: |-
        Re-runs approval-template finding for an issue stuck in CHECKING.
         Useful when the synchronous post-create finding errored (e.g. against
         a malformed workspace approval rule) and the operator has since
         corrected it — without this, the issue would remain in CHECKING
         indefinitely because there is no other retry path for non-DATABASE_CHANGE
         issue types. Idempotent: returns the existing issue unchanged when
         approval-finding has already completed.
         Permissions required: None (caller must be the issue creator;
         mirrors RequestIssue's authorization model).
      operationId: IssueService_RetryIssueApproval
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: issue
          in: path
          description: The issue id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Issue'
  /v1/projects/{project}/issues:batchUpdateStatus:
    post:
      tags:
        - IssueService
      summary: BatchUpdateIssuesStatus
      description: |-
        Updates the status of multiple issues in a single operation.
         Permissions required: bb.issues.update
      operationId: IssueService_BatchUpdateIssuesStatus
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                issues:
                  type: array
                  items:
                    type: string
                  title: issues
                  description: |-
                    The list of issues to update.
                     Format: projects/{project}/issues/{issue}
                status:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
                  title: status
                  description: The new status.
                reason:
                  type: string
                  title: reason
                  description: The reason for the status change.
              title: BatchUpdateIssuesStatusRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchUpdateIssuesStatusResponse'
  /v1/projects/{project}/issues:search:
    post:
      tags:
        - IssueService
      summary: SearchIssues
      description: |-
        Search for issues that the caller has the bb.issues.get permission on and also satisfy the specified filter & query.
         Permissions required: bb.issues.get
      operationId: IssueService_SearchIssues
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: |-
                    The maximum number of issues to return. The service may return fewer than
                     this value.
                     If unspecified, at most 10 issues will be returned.
                     The maximum value is 1000; values above 1000 will be coerced to 1000.
                pageToken:
                  type: string
                  title: page_token
                  description: |-
                    A page token, received from a previous `SearchIssues` call.
                     Provide this to retrieve the subsequent page.

                     When paginating, all other parameters provided to `SearchIssues` must match
                     the call that provided the page token.
                filter:
                  type: string
                  title: filter
                  description: |-
                    Filter is used to filter issues returned in the list.
                     Check the filter field in the ListIssuesRequest message.
                query:
                  type: string
                  title: query
                  description: Query is the query statement.
                orderBy:
                  type: string
                  title: order_by
                  description: |-
                    The order by of issues.
                     Support:
                     - create_time
                     - update_time
                     The default sorting order is ascending.
                     For example:
                     - order_by = "create_time desc"
                     - order_by = "update_time asc"
              title: SearchIssuesRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchIssuesResponse'
  /v1/projects/{project}/plans:
    get:
      tags:
        - PlanService
      summary: ListPlans
      description: |-
        Lists deployment plans in a project.
         Permissions required: bb.plans.list
      operationId: PlanService_ListPlans
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of plans to return. The service may return fewer than
             this value.
             If unspecified, at most 10 plans will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListPlans` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListPlans` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter plans returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
             - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
             - title: the plan title, support "==" operator for exact match and ".contains()" operator for case-insensitive substring match.
             - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config" or "change_database_config".
             - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
             - has_release: whether a spec references a release, support "==" operator, the value should be "true" or "false".
             - release: the release a spec references, in "projects/{project}/releases/{release}" format, support "==" operator.
             - task_status: the current status of any task in the plan, support "in" operator, the values should be Task.Status values except STATUS_UNSPECIFIED.

             For example:
             creator == "users/ed@bytebase.com" && create_time >= "2025-01-02T15:04:05Z07:00"
             title == "My Plan"
             title.contains("database migration")
             spec_type == "change_database_config"
             state == "ACTIVE"
             has_release == true && task_status in ["FAILED", "RUNNING"]
             release == "projects/my-project/releases/release_20260115-RC00"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListPlansResponse'
    post:
      tags:
        - PlanService
      summary: CreatePlan
      description: |-
        Creates a new deployment plan.
         Permissions required: bb.plans.create
      operationId: PlanService_CreatePlan
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        description: The plan to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Plan'
              title: plan
              description: The plan to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Plan'
  /v1/projects/{project}/plans/{plan}:
    get:
      tags:
        - PlanService
      summary: GetPlan
      description: |-
        Retrieves a deployment plan by name.
         Permissions required: bb.plans.get
      operationId: PlanService_GetPlan
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Plan'
    patch:
      tags:
        - PlanService
      summary: UpdatePlan
      description: |-
        UpdatePlan updates the plan.
         The plan creator and the user with bb.plans.update permission on the project can update the plan.
         Permissions required: bb.plans.update (or creator)
      operationId: PlanService_UpdatePlan
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          required: true
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the plan is not found, a new plan will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The plan to update.

           The plan's `name` field is used to identify the plan to update.
           Format: projects/{project}/plans/{plan}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Plan'
              title: plan
              description: |-
                The plan to update.

                 The plan's `name` field is used to identify the plan to update.
                 Format: projects/{project}/plans/{plan}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Plan'
  /v1/projects/{project}/plans/{plan}/planCheckRun:
    get:
      tags:
        - PlanService
      summary: GetPlanCheckRun
      description: |-
        Gets the plan check run for a deployment plan.
         Permissions required: bb.planCheckRuns.get
      operationId: PlanService_GetPlanCheckRun
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PlanCheckRun'
  /v1/projects/{project}/plans/{plan}/planCheckRun:cancel:
    post:
      tags:
        - PlanService
      summary: CancelPlanCheckRun
      description: |-
        Cancels the plan check run for a deployment plan.
         Permissions required: bb.planCheckRuns.run
      operationId: PlanService_CancelPlanCheckRun
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.CancelPlanCheckRunResponse'
  /v1/projects/{project}/plans/{plan}/rollout:
    get:
      tags:
        - RolloutService
      summary: GetRollout
      description: |-
        Retrieves a rollout by its plan name.
         Permissions required: bb.rollouts.get
      operationId: RolloutService_GetRollout
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Rollout'
    post:
      tags:
        - RolloutService
      summary: CreateRollout
      description: |-
        Creates a new rollout for a plan.
         Permissions required: bb.rollouts.create
      operationId: RolloutService_CreateRollout
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                target:
                  type:
                    - string
                    - "null"
                  title: target
                  description: |-
                    Create the rollout only for the specified target.
                     Format: environments/{environment}
                     If unspecified, all stages are created.
                     If set to "", no stages are created.
              title: CreateRolloutRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Rollout'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns:
    get:
      tags:
        - RolloutService
      summary: ListTaskRuns
      description: |-
        Lists task run executions for a task.
         Permissions required: bb.taskRuns.list
      operationId: RolloutService_ListTaskRuns
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of task runs to return. The service may return fewer
             than this value.
             If unspecified, at most 1000 task runs will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListTaskRuns` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListTaskRuns` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListTaskRunsResponse'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}:
    get:
      tags:
        - RolloutService
      summary: GetTaskRun
      description: |-
        Retrieves a task run by name.
         Permissions required: bb.taskRuns.list
      operationId: RolloutService_GetTaskRun
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
        - name: taskRun
          in: path
          description: The taskRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TaskRun'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/log:
    get:
      tags:
        - RolloutService
      summary: GetTaskRunLog
      description: |-
        Retrieves execution logs for a task run.
         Permissions required: bb.taskRuns.list
      operationId: RolloutService_GetTaskRunLog
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
        - name: taskRun
          in: path
          description: The taskRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TaskRunLog'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/session:
    get:
      tags:
        - RolloutService
      summary: GetTaskRunSession
      description: |-
        Retrieves database session information for a running task.
         Permissions required: bb.taskRuns.list
      operationId: RolloutService_GetTaskRunSession
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
        - name: taskRun
          in: path
          description: The taskRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TaskRunSession'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}:previewRollback:
    post:
      tags:
        - RolloutService
      summary: PreviewTaskRunRollback
      description: |-
        Generates rollback SQL for a completed task run.
         Permissions required: bb.taskRuns.list
      operationId: RolloutService_PreviewTaskRunRollback
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
        - name: taskRun
          in: path
          description: The taskRun id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PreviewTaskRunRollbackResponse'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns:batchCancel:
    post:
      tags:
        - RolloutService
      summary: BatchCancelTaskRuns
      description: |-
        Cancels multiple task runs.
         PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive
         a best-effort cancellation request and may continue running if the request is missed or the
         executor does not stop. The response does not report which task runs were actually canceled.
         Permissions required: bb.taskRuns.create (or user with rollout policy role for the environment)
      operationId: RolloutService_BatchCancelTaskRuns
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
        - name: task
          in: path
          description: The task id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                taskRuns:
                  type: array
                  items:
                    type: string
                  title: task_runs
                  description: |-
                    The taskRuns to cancel.
                     Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
              title: BatchCancelTaskRunsRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchCancelTaskRunsResponse'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks:batchRun:
    post:
      tags:
        - RolloutService
      summary: BatchRunTasks
      description: |-
        Executes multiple tasks in a rollout stage.
         Permissions required: bb.taskRuns.create (or user with rollout policy role for the environment)
      operationId: RolloutService_BatchRunTasks
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tasks:
                  type: array
                  items:
                    type: string
                  title: tasks
                  description: |-
                    The tasks to run.
                     Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
                runTime:
                  oneOf:
                    - $ref: '#/components/schemas/google.protobuf.Timestamp'
                    - type: "null"
                  title: run_time
                  description: The task run should run after run_time.
                skipPriorBackup:
                  type: boolean
                  title: skip_prior_backup
                  description: If true, skip prior backup for this run even if the task has prior backup enabled.
              title: BatchRunTasksRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchRunTasksResponse'
  /v1/projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks:batchSkip:
    post:
      tags:
        - RolloutService
      summary: BatchSkipTasks
      description: |-
        Skips multiple tasks in a rollout stage.
         Permissions required: bb.taskRuns.create (or user with rollout policy role for the environment)
      operationId: RolloutService_BatchSkipTasks
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
        - name: stage
          in: path
          description: The stage id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tasks:
                  type: array
                  items:
                    type: string
                  title: tasks
                  description: |-
                    The tasks to skip.
                     Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
                reason:
                  type: string
                  title: reason
                  maxLength: 1000
                  description: The reason for skipping the tasks.
              title: BatchSkipTasksRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchSkipTasksResponse'
  /v1/projects/{project}/plans/{plan}:runPlanChecks:
    post:
      tags:
        - PlanService
      summary: RunPlanChecks
      description: |-
        Executes validation checks on a deployment plan.
         Permissions required: bb.planCheckRuns.run
      operationId: PlanService_RunPlanChecks
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: plan
          in: path
          description: The plan id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                specId:
                  type:
                    - string
                    - "null"
                  title: spec_id
                  description: |-
                    The UUID of the specific spec to run plan checks for.
                     This should match the spec.id field in Plan.Spec.
                     If not set, all specs in the plan will be used.
              title: RunPlanChecksRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.RunPlanChecksResponse'
  /v1/projects/{project}/policies:
    get:
      tags:
        - OrgPolicyService
      summary: ListPolicies
      description: |-
        Lists policies at a specified resource level.
         Permissions required: bb.policies.list
      operationId: OrgPolicyService_ListPolicies2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: policyType
          in: query
          description: Filter by specific policy type.
          schema:
            oneOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
              - type: "null"
            title: policy_type
        - name: showDeleted
          in: query
          description: Show deleted policies if specified.
          schema:
            type: boolean
            title: show_deleted
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
    post:
      tags:
        - OrgPolicyService
      summary: CreatePolicy
      description: |-
        Creates a new organizational policy.
         Permissions required: bb.policies.create
      operationId: OrgPolicyService_CreatePolicy2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type of policy to create.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
            title: type
      requestBody:
        description: The policy to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: The policy to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/projects/{project}/policies/{policy}:
    get:
      tags:
        - OrgPolicyService
      summary: GetPolicy
      description: |-
        Retrieves a policy by name.
         Permissions required: bb.policies.get
      operationId: OrgPolicyService_GetPolicy2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
    delete:
      tags:
        - OrgPolicyService
      summary: DeletePolicy
      description: |-
        Deletes an organizational policy.
         Permissions required: bb.policies.delete
      operationId: OrgPolicyService_DeletePolicy2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - OrgPolicyService
      summary: UpdatePolicy
      description: |-
        Updates an existing organizational policy.
         Permissions required: bb.policies.update
      operationId: OrgPolicyService_UpdatePolicy2
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the policy is not found, a new policy will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The policy to update.

           The policy's `name` field is used to identify the instance to update.
           Format: {resource name}/policies/{policy type}
           Workspace resource name: workspaces/{workspace-id}.
           Environment resource name: environments/environment-id.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: |-
                The policy to update.

                 The policy's `name` field is used to identify the instance to update.
                 Format: {resource name}/policies/{policy type}
                 Workspace resource name: workspaces/{workspace-id}.
                 Environment resource name: environments/environment-id.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/projects/{project}/queryHistories:
    get:
      tags:
        - QueryHistoryService
      summary: ListQueryHistories
      description: |-
        ListQueryHistories lists query histories of all users in a project.
         Results are ordered by create time descending (newest first).
         Permissions required: bb.queryHistories.list
      operationId: QueryHistoryService_ListQueryHistories
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of histories to return.
             The service may return fewer than this value.
             If unspecified, at most 10 history entries will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListQueryHistories` call.
             Provide this to retrieve the subsequent page.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is the filter to apply on the list query histories.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - creator: the user full name in "users/{email}" format, support "==" operator.

             For example:
             creator == "users/{email}"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListQueryHistoriesResponse'
  /v1/projects/{project}/queryHistories/{queryHistory}:
    get:
      tags:
        - QueryHistoryService
      summary: GetQueryHistory
      description: |-
        GetQueryHistory gets a single query history for the caller.
         Permissions required: None (only returns the caller's own query history)
      operationId: QueryHistoryService_GetQueryHistory
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: queryHistory
          in: path
          description: The queryHistory id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.QueryHistory'
  /v1/projects/{project}/queryHistories:search:
    post:
      tags:
        - QueryHistoryService
      summary: SearchQueryHistories
      description: |-
        SearchQueryHistories searches query histories for the caller.
         Permissions required: None (only returns caller's own query histories)
      operationId: QueryHistoryService_SearchQueryHistories
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: |-
                    The maximum number of histories to return.
                     The service may return fewer than this value.
                     If unspecified, at most 10 history entries will be returned.
                     The maximum value is 1000; values above 1000 will be coerced to 1000.
                pageToken:
                  type: string
                  title: page_token
                  description: |-
                    A page token, received from a previous `ListQueryHistory` call.
                     Provide this to retrieve the subsequent page.
                filter:
                  type: string
                  title: filter
                  description: |-
                    Filter is the filter to apply on the search query history
                     The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

                     Supported filter:
                     - project: the project full name in "projects/{id}" format, support "==" operator.
                     - database: the database full name in "instances/{id}/databases/{name}" or "projects/{project}/instances/{id}/databases/{name}" format, support "==" operator.
                     - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
                     - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
                     - statement: the SQL statement, support "==" and ".contains()" operators.

                     For example:
                     project == "projects/{project}"
                     database == "instances/{instance}/databases/{database}"
                     instance == "instances/{instance}"
                     type == "QUERY"
                     type == "EXPORT"
                     statement == "SELECT 1;"
                     statement.contains("select")
                     type == "QUERY" && statement.contains("select")
              title: SearchQueryHistoriesRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchQueryHistoriesResponse'
  /v1/projects/{project}/releases:
    get:
      tags:
        - ReleaseService
      summary: ListReleases
      description: |-
        Lists releases in a project.
         Permissions required: bb.releases.list
      operationId: ReleaseService_ListReleases
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of releases to return. The service may return fewer than this value.
             If unspecified, at most 10 releases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListReleases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListReleases` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted releases if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter releases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - category: release category, support "==" operator.

             For example:
             category == "webapp"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListReleasesResponse'
    post:
      tags:
        - ReleaseService
      summary: CreateRelease
      description: |-
        Creates a new release with SQL files.
         Permissions required: bb.releases.create
      operationId: ReleaseService_CreateRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: releaseIdTemplate
          in: query
          description: |-
            Template for release ID generation.
             Available variables: {date}, {time}, {timestamp}, {iteration}.
             Example: "release_{date}-RC{iteration}" generates "release_20260119-RC00".
             Default: "release_{date}-RC{iteration}".
          schema:
            type: string
            title: release_id_template
        - name: releaseIdTimezone
          in: query
          description: |-
            Timezone for {date} and {time} variables in the template.
             Must be a valid IANA timezone (e.g., "UTC", "America/Los_Angeles").
             Default: "UTC".
          schema:
            type: string
            title: release_id_timezone
      requestBody:
        description: The release to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Release'
              title: release
              description: The release to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Release'
  /v1/projects/{project}/releases/{release}:
    get:
      tags:
        - ReleaseService
      summary: GetRelease
      description: |-
        Retrieves a release by name.
         Permissions required: bb.releases.get
      operationId: ReleaseService_GetRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: release
          in: path
          description: The release id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Release'
    delete:
      tags:
        - ReleaseService
      summary: DeleteRelease
      description: |-
        Deletes a release.
         Permissions required: bb.releases.delete
      operationId: ReleaseService_DeleteRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: release
          in: path
          description: The release id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - ReleaseService
      summary: UpdateRelease
      description: |-
        Updates an existing release.
         Permissions required: bb.releases.update
         When allow_missing=true, also requires: bb.releases.create
      operationId: ReleaseService_UpdateRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: release
          in: path
          description: The release id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to be updated.
          schema:
            type: string
      requestBody:
        description: The release to update.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Release'
              title: release
              description: The release to update.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Release'
  /v1/projects/{project}/releases/{release}:undelete:
    post:
      tags:
        - ReleaseService
      summary: UndeleteRelease
      description: |-
        Restores a deleted release.
         Permissions required: bb.releases.undelete
      operationId: ReleaseService_UndeleteRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: release
          in: path
          description: The release id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Release'
  /v1/projects/{project}/releases:check:
    post:
      tags:
        - ReleaseService
      summary: CheckRelease
      description: |-
        Validates a release by dry-running checks on target databases.
         Permissions required: bb.releases.check
      operationId: ReleaseService_CheckRelease
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                release:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.Release'
                  title: release
                  description: The release to check.
                targets:
                  type: array
                  items:
                    type: string
                  title: targets
                  description: |-
                    The targets to dry-run the release.
                     Can be database or databaseGroup.
                     Format:
                     projects/{project}/databaseGroups/{databaseGroup}
                     instances/{instance}/databases/{database}
                     projects/{project}/instances/{instance}/databases/{database}
                customRules:
                  type: string
                  title: custom_rules
                  description: |-
                    Custom linting rules in natural language for AI-powered validation.
                     Each rule should be a clear statement describing the desired schema constraint.
                     Example: "All tables must have a primary key"
                     Example: "VARCHAR columns should specify a maximum length"
                vcsUser:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.VCSUser'
                  title: vcs_user
                  description: |-
                    The non-bot VCS pull request or merge request creator observed by bytebase-release.
                     If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.
              title: CheckReleaseRequest
              required:
                - release
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.CheckReleaseResponse'
  /v1/projects/{project}/releases:listCategories:
    get:
      tags:
        - ReleaseService
      summary: ListReleaseCategories
      description: |-
        Lists all unique categories in a project.
         Permissions required: bb.releases.list
      operationId: ReleaseService_ListReleaseCategories
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListReleaseCategoriesResponse'
  /v1/projects/{project}/rollouts:
    get:
      tags:
        - RolloutService
      summary: ListRollouts
      description: |-
        Lists rollouts in a project.
         Permissions required: bb.rollouts.list
      operationId: RolloutService_ListRollouts
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of rollouts to return. The service may return fewer than
             this value.
             If unspecified, at most 10 rollouts will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListRollouts` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListRollouts` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter rollouts returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - task_type: the task type, support "in" operator, check the Task.Type enum for the values.

             For example:
             update_time >= "2025-01-02T15:04:05Z07:00"
             task_type in ["DATABASE_MIGRATE", "DATABASE_CREATE"]
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListRolloutsResponse'
  /v1/projects/{project}/savedQueries:
    get:
      tags:
        - SavedQueryService
      summary: ListSavedQueries
      description: |-
        List saved queries for auditing. The permission alone grants reading
         every matched saved query with full content, private ones included;
         bindings are ignored. Use parent "projects/-" for all projects.
         Results default to title ascending; see `order_by`.
         Permissions required: bb.savedQueries.list on the project, or on the
         workspace when the parent is "projects/-"
      operationId: SavedQueryService_ListSavedQueries
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: |-
            Filter the result, in CEL. See https://github.com/google/cel-spec

             Supported fields:
             - creator: the creator in "users/{email}" format. Supports "==" and "!=".

             For example:
             creator == "users/alice@example.com"
          schema:
            type: string
            title: filter
        - name: pageSize
          in: query
          description: |-
            The maximum number of saved queries to return. The service may return
             fewer. Defaults to 10; values above 1000 are coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token from a previous ListSavedQueries call. Keep every other
             parameter the same as the call that returned it.
          schema:
            type: string
            title: page_token
        - name: orderBy
          in: query
          description: |-
            Sort the results, per https://google.aip.dev/132#ordering. Supported
             fields: `update_time`, `create_time`, `title`; append " desc" for
             descending, e.g. "update_time desc" for most recently modified first.
             A modification is a title, content, database, or folder write; sharing
             and stars do not count, and a never-modified saved query counts its
             create time. Empty means `title` ascending. `resource_id` is always
             appended as a final tiebreak so pages stay stable.
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListSavedQueriesResponse'
    post:
      tags:
        - SavedQueryService
      summary: CreateSavedQuery
      description: |-
        Create a saved query. The creator becomes the owner and the saved query
         starts private.
         Permissions required: bb.savedQueries.create on the project
      operationId: SavedQueryService_CreateSavedQuery
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        description: The saved query to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SavedQuery'
              title: saved_query
              description: The saved query to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQuery'
  /v1/projects/{project}/savedQueries/{savedQuery}:
    get:
      tags:
        - SavedQueryService
      summary: GetSavedQuery
      description: |-
        Get a saved query with its full content.
         Permissions required: bb.savedQueries.get (creator, VIEWER/EDITOR
         binding, or project-level grant)
      operationId: SavedQueryService_GetSavedQuery
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQuery'
    delete:
      tags:
        - SavedQueryService
      summary: DeleteSavedQuery
      description: |-
        Delete a saved query and every user's stars on it. An EDITOR binding
         cannot delete.
         Permissions required: bb.savedQueries.delete (creator or project-level
         grant)
      operationId: SavedQueryService_DeleteSavedQuery
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - SavedQueryService
      summary: UpdateSavedQuery
      description: |-
        Update a saved query. `database` must belong to the saved query's project.
         Permissions required: bb.savedQueries.update (creator, EDITOR binding, or
         project-level grant)
      operationId: SavedQueryService_UpdateSavedQuery
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: |-
            Fields to update, relative to the saved query (`title`, not
             `saved_query.title`). Supported: `title`, `content`, `database`, `folder`.
             At least one path is required.
          schema:
            type: string
      requestBody:
        description: |-
          `saved_query.name` identifies the saved query to update.
           Format: projects/{project}/savedQueries/{savedQuery}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SavedQuery'
              title: saved_query
              description: |-
                `saved_query.name` identifies the saved query to update.
                 Format: projects/{project}/savedQueries/{savedQuery}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQuery'
  /v1/projects/{project}/savedQueries/{savedQuery}:getPolicy:
    get:
      tags:
        - SavedQueryService
      summary: GetSavedQueryPolicy
      description: |-
        Get a saved query's sharing policy: who it is shared with, at what level.
         Permissions required: bb.savedQueries.getIamPolicy (creator, VIEWER/EDITOR
         binding, or project-level grant)
      operationId: SavedQueryService_GetSavedQueryPolicy
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQueryPolicy'
  /v1/projects/{project}/savedQueries/{savedQuery}:setPolicy:
    post:
      tags:
        - SavedQueryService
      summary: SetSavedQueryPolicy
      description: |-
        Replace a saved query's sharing policy in full. `policy.etag` must match
         the stored policy; a mismatch fails with ABORTED.
         Permissions required: bb.savedQueries.setIamPolicy (creator or
         project-level grant; no predefined role carries it)
      operationId: SavedQueryService_SetSavedQueryPolicy
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                policy:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.SavedQueryPolicy'
                  title: policy
                  description: |-
                    The new policy, replacing the stored one in full. Empty `bindings` makes
                     the saved query private again.
              title: SetSavedQueryPolicyRequest
              required:
                - policy
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQueryPolicy'
  /v1/projects/{project}/savedQueries/{savedQuery}:updateStar:
    post:
      tags:
        - SavedQueryService
      summary: UpdateSavedQueryStar
      description: |-
        Star or unstar a saved query for the caller. Stars are personal: nobody
         else sees them and they grant nothing. The caller can star any saved
         query they can read. When access is lost the star is hidden, not
         deleted; it comes back if access returns.
         Permissions required: bb.savedQueries.get (creator, VIEWER/EDITOR
         binding, or project-level grant)
      operationId: SavedQueryService_UpdateSavedQueryStar
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: savedQuery
          in: path
          description: The savedQuery id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                starred:
                  type: boolean
                  title: starred
                  description: Whether the caller stars the saved query.
              title: UpdateSavedQueryStarRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SavedQuery'
  /v1/projects/{project}/savedQueries:moveMy:
    post:
      tags:
        - SavedQueryService
      summary: MoveMySavedQueries
      description: |-
        Move the caller's saved queries filed under `source_folder`, descendants
         included, into `target_folder`: renaming "a/b" to "a/c" also moves
         "a/b/deep". Only the caller's own saved queries move; the response counts
         how many did. Re-filing a single saved query is UpdateSavedQuery's
         `folder` field.
         Permissions required: creator
      operationId: SavedQueryService_MoveMySavedQueries
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceFolder:
                  type: string
                  title: source_folder
                  maxLength: 256
                  minLength: 1
                  description: The folder to move, descendants included, e.g. "a/b".
                targetFolder:
                  type: string
                  title: target_folder
                  maxLength: 256
                  description: |-
                    Where it lands. A path like "a/b/c"; empty drops the `source_folder`
                     prefix, promoting the folder's contents toward the root.
              title: MoveMySavedQueriesRequest
              required:
                - sourceFolder
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.MoveMySavedQueriesResponse'
  /v1/projects/{project}/savedQueries:search:
    post:
      tags:
        - SavedQueryService
      summary: SearchSavedQueries
      description: |-
        Search saved queries in one project. Returns content previews of the
         saved queries the caller can read, the same access rule as GetSavedQuery.
         Permissions required: bb.savedQueries.search on the project
      operationId: SavedQueryService_SearchSavedQueries
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  type: string
                  title: filter
                  description: |-
                    Filter the result, in CEL. See https://github.com/google/cel-spec

                     Supported fields:
                     - name: the saved query name. Supports "==" and "in [...]".
                     - title: the title. Supports "contains".
                     - creator: the creator in "users/{email}" format. Supports "==" and "!=".
                     - shared: whether a binding shares the saved query with the caller. Their
                       own saved queries, and ones visible only through a project-level
                       bb.savedQueries.get, are not "shared". Supports "==".
                     - starred: whether the caller starred it. Supports "==".
                     - folder: the exact folder path. Supports "==".

                     Use `creator == "users/{me}"` for a My view and `shared == true` for a
                     Shared view. Prefer `shared` over `creator !=`: with a project-level
                     bb.savedQueries.get, `creator !=` also matches saved queries nobody
                     shared with the caller.

                     For example:
                     creator == "users/alice@example.com"
                     shared == true
                     starred == true
                     title.contains("weekly report")
                     folder == "foo/bar"
                pageSize:
                  type: integer
                  title: page_size
                  format: int32
                  description: |-
                    The maximum number of saved queries to return. The service may return
                     fewer. Defaults to 10; values above 1000 are coerced to 1000.
                pageToken:
                  type: string
                  title: page_token
                  description: |-
                    A page token from a previous SearchSavedQueries call. Keep every other
                     parameter the same as the call that returned it.
              title: SearchSavedQueriesRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchSavedQueriesResponse'
  /v1/projects/{project}/savedQueries:searchFolders:
    post:
      tags:
        - SavedQueryService
      summary: SearchSavedQueryFolders
      description: |-
        Search folder paths. A path is returned when it holds at least one saved
         query the caller can read, the same access rule as SearchSavedQueries.
         Permissions required: bb.savedQueries.search on the project
      operationId: SavedQueryService_SearchSavedQueryFolders
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  type: string
                  title: filter
                  description: |-
                    Filter folders by the saved queries they hold. Takes the same fields and
                     syntax as SearchSavedQueries.filter, except `title`. A folder is returned
                     when at least one saved query the caller can read matches.
              title: SearchSavedQueryFoldersRequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchSavedQueryFoldersResponse'
  /v1/projects/{project}/serviceAccounts:
    get:
      tags:
        - ServiceAccountService
      summary: ListServiceAccounts
      description: |-
        Lists service accounts.
         For workspace-level: parent is workspaces/{id}, permission bb.serviceAccounts.list on workspace.
         For project-level: parent is projects/{project}, permission bb.serviceAccounts.list on project.
      operationId: ServiceAccountService_ListServiceAccounts
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of service accounts to return. The service may return fewer than
             this value.
             If unspecified, at most 10 service accounts will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListServiceAccounts` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListServiceAccounts` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted service accounts if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter service accounts returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the service account name, support "==" and ".contains()" operator.
             - email: the service account email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@service.bytebase.com"
             email.contains("ed")
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListServiceAccountsResponse'
    post:
      tags:
        - ServiceAccountService
      summary: CreateServiceAccount
      description: |-
        Creates a new service account.
         For workspace-level: parent is workspaces/{id}, permission bb.serviceAccounts.create on workspace.
         For project-level: parent is projects/{project}, permission bb.serviceAccounts.create on project.
      operationId: ServiceAccountService_CreateServiceAccount
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: serviceAccountId
          in: query
          description: |-
            The ID to use for the service account, which will become the final component
             of the service account's email in the format: {service_account_id}@service.bytebase.com
             or {service_account_id}@{project-id}.service.bytebase.com
          required: true
          schema:
            type: string
            title: service_account_id
      requestBody:
        description: The service account to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
              title: service_account
              description: The service account to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
  /v1/projects/{project}/sheets:
    post:
      tags:
        - SheetService
      summary: CreateSheet
      description: |-
        Creates a new SQL sheet.
         Permissions required: bb.sheets.create
      operationId: SheetService_CreateSheet
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        description: The sheet to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Sheet'
              title: sheet
              description: The sheet to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Sheet'
  /v1/projects/{project}/sheets/{sheet}:
    get:
      tags:
        - SheetService
      summary: GetSheet
      description: |-
        Retrieves a SQL sheet by name.
         Permissions required: bb.sheets.get
      operationId: SheetService_GetSheet
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: sheet
          in: path
          description: The sheet id.
          required: true
          schema:
            type: string
        - name: raw
          in: query
          description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
          schema:
            type: boolean
            title: raw
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Sheet'
  /v1/projects/{project}/sheets:batchCreate:
    post:
      tags:
        - SheetService
      summary: BatchCreateSheets
      description: |-
        Creates multiple SQL sheets in a single operation.
         Permissions required: bb.sheets.create
      operationId: SheetService_BatchCreateSheets
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                requests:
                  type: array
                  items:
                    $ref: '#/components/schemas/bytebase.v1.CreateSheetRequest'
                  title: requests
              title: BatchCreateSheetsRequest
              required:
                - requests
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchCreateSheetsResponse'
  /v1/projects/{project}/webhooks/{webhook}:removeWebhook:
    post:
      tags:
        - ProjectService
      summary: RemoveWebhook
      description: |-
        Removes a webhook from a project.
         Permissions required: bb.projects.update
      operationId: ProjectService_RemoveWebhook
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: webhook
          in: path
          description: The webhook id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.Webhook'
                  title: webhook
                  description: The webhook to remove. Identified by its url.
              title: RemoveWebhookRequest
              required:
                - webhook
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects/{project}/webhooks/{webhook}:updateWebhook:
    patch:
      tags:
        - ProjectService
      summary: UpdateWebhook
      description: |-
        Updates an existing webhook configuration.
         Permissions required: bb.projects.update
      operationId: ProjectService_UpdateWebhook
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: webhook
          in: path
          description: The webhook id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the webhook is not found, a new webhook will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: The webhook to modify.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Webhook'
              title: webhook
              description: The webhook to modify.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects/{project}/workloadIdentities:
    get:
      tags:
        - WorkloadIdentityService
      summary: ListWorkloadIdentities
      description: |-
        Lists workload identities.
         For workspace-level: parent is workspaces/{id}, permission bb.workloadIdentities.list on workspace.
         For project-level: parent is projects/{project}, permission bb.workloadIdentities.list on project.
      operationId: WorkloadIdentityService_ListWorkloadIdentities
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of workload identities to return. The service may return fewer than
             this value.
             If unspecified, at most 10 workload identities will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListWorkloadIdentities` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListWorkloadIdentities` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted workload identities if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter workload identities returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the workload identity name, support "==" and ".contains()" operator.
             - email: the workload identity email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@workload.bytebase.com"
             email.contains("ed")
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListWorkloadIdentitiesResponse'
    post:
      tags:
        - WorkloadIdentityService
      summary: CreateWorkloadIdentity
      description: |-
        Creates a new workload identity.
         For workspace-level: parent is workspaces/{id}, permission bb.workloadIdentities.create on workspace.
         For project-level: parent is projects/{project}, permission bb.workloadIdentities.create on project.
      operationId: WorkloadIdentityService_CreateWorkloadIdentity
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
        - name: workloadIdentityId
          in: query
          description: |-
            The ID to use for the workload identity, which will become the final component
             of the workload identity's email in the format: {workload_identity_id}@workload.bytebase.com
             or {workload_identity_id}@{project-id}.workload.bytebase.com
          required: true
          schema:
            type: string
            title: workload_identity_id
      requestBody:
        description: The workload identity to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
              title: workload_identity
              description: The workload identity to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
  /v1/projects/{project}:addWebhook:
    post:
      tags:
        - ProjectService
      summary: AddWebhook
      description: |-
        Adds a webhook to a project for notifications.
         Permissions required: bb.projects.update
      operationId: ProjectService_AddWebhook
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.Webhook'
                  title: webhook
                  description: The webhook to add.
              title: AddWebhookRequest
              required:
                - webhook
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects/{project}:getIamPolicy:
    get:
      tags:
        - ProjectService
      summary: GetIamPolicy
      description: |-
        Retrieves the IAM policy for a project.
         Permissions required: bb.projects.getIamPolicy
      operationId: ProjectService_GetIamPolicy
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IamPolicy'
  /v1/projects/{project}:setIamPolicy:
    post:
      tags:
        - ProjectService
      summary: SetIamPolicy
      description: |-
        Sets the IAM policy for a project.
         Permissions required: bb.projects.setIamPolicy
      operationId: ProjectService_SetIamPolicy
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                policy:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.IamPolicy'
                  title: policy
                etag:
                  type: string
                  title: etag
                  description: |-
                    (OPTIONAL) The current etag of the policy. Equivalent to setting `policy.etag`;
                     supplying both with different values returns INVALID_ARGUMENT.
              title: SetIamPolicyRequest
              required:
                - policy
              additionalProperties: false
              description: Request message for setting an IAM policy.
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IamPolicy'
  /v1/projects/{project}:testWebhook:
    post:
      tags:
        - ProjectService
      summary: TestWebhook
      description: |-
        Tests a webhook by sending a test notification.
         Permissions required: bb.projects.update
      operationId: ProjectService_TestWebhook
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.Webhook'
                  title: webhook
                  description: |-
                    The webhook to test.

                     The url is what gets posted to. Reads do not return a saved webhook's url,
                     so leave url empty and set name to test the one already stored; set url to
                     test a url before saving it.
              title: TestWebhookRequest
              required:
                - webhook
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TestWebhookResponse'
  /v1/projects/{project}:undelete:
    post:
      tags:
        - ProjectService
      summary: UndeleteProject
      description: |-
        Restores a soft-deleted project.
         Permissions required: bb.projects.undelete
      operationId: ProjectService_UndeleteProject
      parameters:
        - name: project
          in: path
          description: The project id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Project'
  /v1/projects:batchDelete:
    post:
      tags:
        - ProjectService
      summary: BatchDeleteProjects
      description: |-
        Deletes multiple projects in a single operation.
         Permissions required: bb.projects.delete
      operationId: ProjectService_BatchDeleteProjects
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.BatchDeleteProjectsRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/projects:batchGet:
    get:
      tags:
        - ProjectService
      summary: BatchGetProjects
      description: |-
        BatchGetProjects retrieves multiple projects by their names.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.projects.get (on each named project)
      operationId: ProjectService_BatchGetProjects
      parameters:
        - name: names
          in: query
          description: |-
            The names of projects to retrieve.
             Format: projects/{project}
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetProjectsResponse'
  /v1/projects:search:
    post:
      tags:
        - ProjectService
      summary: SearchProjects
      description: |-
        Searches for projects with advanced filtering capabilities.
         Permissions required: bb.projects.get (or project-level bb.projects.get for specific projects)
      operationId: ProjectService_SearchProjects
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.SearchProjectsRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.SearchProjectsResponse'
  /v1/reviewConfigs:
    get:
      tags:
        - ReviewConfigService
      summary: ListReviewConfigs
      description: |-
        Lists all SQL review configurations.
         Permissions required: bb.reviewConfigs.list
      operationId: ReviewConfigService_ListReviewConfigs
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListReviewConfigsResponse'
    post:
      tags:
        - ReviewConfigService
      summary: CreateReviewConfig
      description: |-
        Creates a new SQL review configuration.
         Permissions required: bb.reviewConfigs.create
      operationId: ReviewConfigService_CreateReviewConfig
      requestBody:
        description: The SQL review config to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
              title: review_config
              description: The SQL review config to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
  /v1/reviewConfigs/{reviewConfig}:
    get:
      tags:
        - ReviewConfigService
      summary: GetReviewConfig
      description: |-
        Retrieves a SQL review configuration by name.
         Permissions required: bb.reviewConfigs.get
      operationId: ReviewConfigService_GetReviewConfig
      parameters:
        - name: reviewConfig
          in: path
          description: The reviewConfig id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
    delete:
      tags:
        - ReviewConfigService
      summary: DeleteReviewConfig
      description: |-
        Deletes a SQL review configuration.
         Permissions required: bb.reviewConfigs.delete
      operationId: ReviewConfigService_DeleteReviewConfig
      parameters:
        - name: reviewConfig
          in: path
          description: The reviewConfig id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - ReviewConfigService
      summary: UpdateReviewConfig
      description: |-
        Updates a SQL review configuration.
         Permissions required: bb.reviewConfigs.update
         When allow_missing=true, also requires: bb.reviewConfigs.create
      operationId: ReviewConfigService_UpdateReviewConfig
      parameters:
        - name: reviewConfig
          in: path
          description: The reviewConfig id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the config is not found, a new config will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The SQL review config to update.

           The name field is used to identify the SQL review config to update.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
              title: review_config
              description: |-
                The SQL review config to update.

                 The name field is used to identify the SQL review config to update.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
  /v1/roles:
    get:
      tags:
        - RoleService
      summary: ListRoles
      description: |-
        Lists roles in the workspace.
         Permissions required: bb.roles.list
      operationId: RoleService_ListRoles
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListRolesResponse'
    post:
      tags:
        - RoleService
      summary: CreateRole
      description: |-
        Creates a new custom role.
         Permissions required: bb.roles.create
      operationId: RoleService_CreateRole
      parameters:
        - name: roleId
          in: query
          description: |-
            The ID to use for the role, which will become the final component
             of the role's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][A-Z][0-9]/.
          required: true
          schema:
            type: string
            title: role_id
      requestBody:
        description: The role to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Role'
              title: role
              description: The role to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Role'
  /v1/roles/{role}:
    get:
      tags:
        - RoleService
      summary: GetRole
      description: |-
        Retrieves a role by name.
         Permissions required: bb.roles.get
      operationId: RoleService_GetRole
      parameters:
        - name: role
          in: path
          description: The role id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Role'
    delete:
      tags:
        - RoleService
      summary: DeleteRole
      description: |-
        Deletes a custom role.
         Permissions required: bb.roles.delete
      operationId: RoleService_DeleteRole
      parameters:
        - name: role
          in: path
          description: The role id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - RoleService
      summary: UpdateRole
      description: |-
        Updates a role's properties.
         Permissions required: bb.roles.update
         When allow_missing=true, also requires: bb.roles.create
      operationId: RoleService_UpdateRole
      parameters:
        - name: role
          in: path
          description: The role id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the role is not found, a new role will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: The role to update.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Role'
              title: role
              description: The role to update.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Role'
  /v1/serviceAccounts/{serviceAccount}:
    get:
      tags:
        - ServiceAccountService
      summary: GetServiceAccount
      description: |-
        Gets a service account by name.
         Permissions required: bb.serviceAccounts.get
      operationId: ServiceAccountService_GetServiceAccount
      parameters:
        - name: serviceAccount
          in: path
          description: The serviceAccount id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
    delete:
      tags:
        - ServiceAccountService
      summary: DeleteServiceAccount
      description: |-
        Deletes a service account.
         Permissions required: bb.serviceAccounts.delete
      operationId: ServiceAccountService_DeleteServiceAccount
      parameters:
        - name: serviceAccount
          in: path
          description: The serviceAccount id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - ServiceAccountService
      summary: UpdateServiceAccount
      description: |-
        Updates a service account.
         Permissions required: bb.serviceAccounts.update
      operationId: ServiceAccountService_UpdateServiceAccount
      parameters:
        - name: serviceAccount
          in: path
          description: The serviceAccount id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: |-
            The list of fields to update.
             Supported fields: title, service_key (triggers key rotation)
          schema:
            type: string
      requestBody:
        description: |-
          The service account to update.

           The service account's `name` field is used to identify the service account to update.
           Format: serviceAccounts/{email}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
              title: service_account
              description: |-
                The service account to update.

                 The service account's `name` field is used to identify the service account to update.
                 Format: serviceAccounts/{email}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
  /v1/serviceAccounts/{serviceAccount}:undelete:
    post:
      tags:
        - ServiceAccountService
      summary: UndeleteServiceAccount
      description: |-
        Restores a deleted service account.
         Permissions required: bb.serviceAccounts.undelete
      operationId: ServiceAccountService_UndeleteServiceAccount
      parameters:
        - name: serviceAccount
          in: path
          description: The serviceAccount id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
  /v1/settings:
    get:
      tags:
        - SettingService
      summary: ListSettings
      description: |-
        Lists all workspace settings.
         Permissions required: bb.settings.list
      operationId: SettingService_ListSettings
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListSettingsResponse'
  /v1/settings/{setting}:
    get:
      tags:
        - SettingService
      summary: GetSetting
      description: |-
        Retrieves a workspace setting by name.
         Permissions required: bb.settings.getEnvironment for settings/ENVIRONMENT, bb.settings.getWorkspaceProfile for settings/WORKSPACE_PROFILE, bb.settings.get for the others
      operationId: SettingService_GetSetting
      parameters:
        - name: setting
          in: path
          description: The setting id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Setting'
    patch:
      tags:
        - SettingService
      summary: UpdateSetting
      description: |-
        Updates a workspace setting.
         Permissions required: bb.settings.set
      operationId: SettingService_UpdateSetting
      parameters:
        - name: setting
          in: path
          description: The setting id.
          required: true
          schema:
            type: string
        - name: validateOnly
          in: query
          description: |-
            validate_only is a flag to indicate whether to validate the setting value,
             server would not persist the setting value if it is true.
          schema:
            type: boolean
            title: validate_only
        - name: allowMissing
          in: query
          description: The allowMissing query parameter.
          schema:
            type: boolean
            title: allow_missing
        - name: updateMask
          in: query
          description: Comma-separated field paths in lowerCamelCase (for example, `user.displayName,photo`).
          schema:
            type: string
      requestBody:
        description: The setting to update.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Setting'
              title: setting
              description: The setting to update.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Setting'
  /v1/subscription:
    get:
      tags:
        - SubscriptionService
      summary: GetSubscription
      description: |-
        GetSubscription returns the current subscription.
         If there is no license, we will return a free plan subscription without expiration time.
         If there is expired license, we will return a free plan subscription with the expiration time of the expired license.
      operationId: SubscriptionService_GetSubscription
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Subscription'
  /v1/subscription/checkoutSession/{sessionId}:
    get:
      tags:
        - SubscriptionService
      summary: VerifyCheckoutSession
      description: VerifyCheckoutSession verifies a Stripe Checkout Session status (SaaS only).
      operationId: SubscriptionService_VerifyCheckoutSession
      parameters:
        - name: sessionId
          in: path
          description: |-
            The same Stripe Checkout Session ID PurchaseResponse mints, arriving back
             the other way, so it carries the same classification. VerifyCheckoutSession
             is EXCLUDED, and a refusal of it streams its request to the stdout audit
             log, so leaving this unannotated would write the id into that line while
             the response that produced it was redacted.
          required: true
          schema:
            type: string
            title: session_id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.VerifyCheckoutSessionResponse'
  /v1/subscription/license:
    patch:
      tags:
        - SubscriptionService
      summary: UploadLicense
      description: Uploads an enterprise license (self-hosted only).
      operationId: SubscriptionService_UploadLicense
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.UploadLicenseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Subscription'
  /v1/subscription/paymentInfo:
    get:
      tags:
        - SubscriptionService
      summary: GetPaymentInfo
      description: GetPaymentInfo returns payment details for the current subscription (SaaS only).
      operationId: SubscriptionService_GetPaymentInfo
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PaymentInfo'
  /v1/subscription/plans:
    get:
      tags:
        - SubscriptionService
      summary: ListPurchasePlans
      description: ListPurchasePlans returns available plans for self-service purchase.
      operationId: SubscriptionService_ListPurchasePlans
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListPurchasePlansResponse'
  /v1/subscription:cancelPurchase:
    post:
      tags:
        - SubscriptionService
      summary: CancelPurchase
      description: CancelPurchase cancels an active subscription (SaaS only).
      operationId: SubscriptionService_CancelPurchase
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.CancelPurchaseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PurchaseResponse'
  /v1/subscription:purchase:
    post:
      tags:
        - SubscriptionService
      summary: CreatePurchase
      description: |-
        CreatePurchase creates a new subscription purchase (SaaS only).
         Returns a Stripe Checkout URL for the user to complete payment.
      operationId: SubscriptionService_CreatePurchase
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.CreatePurchaseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PurchaseResponse'
  /v1/subscription:startTrial:
    post:
      tags:
        - SubscriptionService
      summary: StartTrial
      description: StartTrial starts a free trial for an eligible SaaS workspace.
      operationId: SubscriptionService_StartTrial
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.StartTrialRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Subscription'
  /v1/subscription:updatePurchase:
    post:
      tags:
        - SubscriptionService
      summary: UpdatePurchase
      description: |-
        UpdatePurchase updates an existing subscription (SaaS only).
         May return a Stripe Checkout URL if payment method change is needed.
      operationId: SubscriptionService_UpdatePurchase
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bytebase.v1.UpdatePurchaseRequest'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.PurchaseResponse'
  /v1/subscription:vcsProviderUsersExport:
    get:
      tags:
        - SubscriptionService
      summary: ExportVCSProviderUsers
      description: Exports active VCS users as CSV.
      operationId: SubscriptionService_ExportVCSProviderUsers
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ExportVCSProviderUsersResponse'
  /v1/users:
    get:
      tags:
        - UserService
      summary: ListUsers
      description: |-
        List all users.
         Any authenticated user can list users.
         Permissions required: bb.users.list
      operationId: UserService_ListUsers
      parameters:
        - name: pageSize
          in: query
          description: |-
            The maximum number of users to return. The service may return fewer than
             this value.
             If unspecified, at most 10 users will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListUsers` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListUsers` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted users if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter users returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the user name, support "==" and ".contains()" operator.
             - email: the user email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             email == "ed@bytebase.com"
             email.contains("ed")
             state == "DELETED"
             project == "projects/sample-project"
             You can combine filter conditions like:
             name.contains("ed") && project == "projects/sample-project"
             (name == "ed" || email == "ed@bytebase.com") && project == "projects/sample-project"
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListUsersResponse'
    post:
      tags:
        - UserService
      summary: CreateUser
      description: |-
        Creates a user in the caller's workspace (admin action, self-hosted only).
         In SaaS mode, admins should add users via workspace IAM policy instead.
         Permissions required: bb.users.create
      operationId: UserService_CreateUser
      requestBody:
        description: The user to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.User'
              title: user
              description: The user to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/me:
    get:
      tags:
        - UserService
      summary: GetCurrentUser
      description: |-
        Get the current authenticated user.
         Permissions required: None
      operationId: UserService_GetCurrentUser
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:
    get:
      tags:
        - UserService
      summary: GetUser
      description: |-
        Get the user.
         Any authenticated user can get the user.
         Permissions required: bb.users.get
      operationId: UserService_GetUser
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
    delete:
      tags:
        - UserService
      summary: DeleteUser
      description: |-
        Deletes a user. Requires bb.users.delete permission with additional validation: the last remaining workspace admin cannot be deleted.
         Permissions required: bb.users.delete
      operationId: UserService_DeleteUser
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - UserService
      summary: UpdateUser
      description: |-
        Updates a user. Users can update their own profile, or users with bb.users.update permission can update any user.
         Note: Email updates are not supported through this API. Use UpdateEmail instead.
         Permissions required: bb.users.update (or self)
      operationId: UserService_UpdateUser
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the user is not found, a new user will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The user to update.

           The user's `name` field is used to identify the user to update.
           Format: users/{email}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.User'
              title: user
              description: |-
                The user to update.

                 The user's `name` field is used to identify the user to update.
                 Format: users/{email}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:changePassword:
    post:
      tags:
        - UserService
      summary: ChangePassword
      description: |-
        Changes the caller's own password. An administrator resetting someone
         else's password uses UpdateUser with the `password` mask instead — that
         is a different operation with a different audit story, even though both
         end in a new password hash.
         Permissions required: None beyond being signed in as `name`.
      operationId: UserService_ChangePassword
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                newPassword:
                  type: string
                  title: new_password
                  description: |
                    string.max_bytes = 72
                credential:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
                  title: credential
              title: ChangePasswordRequest
              required:
                - newPassword
                - credential
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:confirmRecoveryCodes:
    post:
      tags:
        - UserService
      summary: ConfirmRecoveryCodes
      description: |-
        Promotes the pending recovery codes. During first-time enrollment this is
         also where the pending TOTP secret goes live, so the factor and the codes
         that recover it start existing in the same write.
         Permissions required: None beyond being signed in as `name`.
      operationId: UserService_ConfirmRecoveryCodes
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pendingVersion:
                  allOf:
                    - $ref: '#/components/schemas/google.protobuf.Timestamp'
                  title: pending_version
                  description: |-
                    The pending_version of the codes being confirmed. Confirming promotes
                     exactly the set this version identifies, or nothing.
                credential:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
                  title: credential
                otpCode:
                  type: string
                  title: otp_code
                  maxLength: 64
                  description: |-
                    (OPTIONAL) Required for first-time enrollment, rejected otherwise. A *fresh* code,
                     not the one EnableMFA took.
              title: ConfirmRecoveryCodesRequest
              required:
                - pendingVersion
                - credential
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:disableMFA:
    post:
      tags:
        - UserService
      summary: DisableMFA
      description: |-
        Turns MFA off, clearing the entire MFA config — live and pending state
         alike. Callers may disable their own; an administrator may disable
         another user's with bb.users.update, which is how a locked-out user is
         recovered.
         Permissions required: bb.users.update, unless `name` is the caller's own.
      operationId: UserService_DisableMFA
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                credential:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
                  title: credential
                  description: |-
                    (OPTIONAL) Required for a self-service call against a live factor, and then only
                     otp_code or recovery_code. Unused on an admin-assisted call.
              title: DisableMFARequest
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:enableMFA:
    post:
      tags:
        - UserService
      summary: EnableMFA
      description: |-
        Verifies an otp_code against the pending enrollment. Nothing is written:
         this is the step that catches a mistyped authenticator before the caller
         is shown recovery codes, and promotion happens at ConfirmRecoveryCodes so
         an account is never MFA-required with codes its owner never saved.
         Permissions required: None beyond being signed in as `name`.
         It writes nothing itself, but it is a required step of installing a
         factor on the account, which is why it is denied on the same grounds as
         the promotion it precedes.
      operationId: UserService_EnableMFA
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                otpCode:
                  type: string
                  title: otp_code
                  maxLength: 64
                  description: A code from the authenticator the pending secret was just added to.
                pendingVersion:
                  allOf:
                    - $ref: '#/components/schemas/google.protobuf.Timestamp'
                  title: pending_version
                  description: The pending_version this enrollment was minted with.
                credential:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
                  title: credential
                  description: |-
                    (OPTIONAL) Proof of the *existing* factor, not the new device above. Required for a
                     rotation, and for first-time enrollment on an account with a password.
              title: EnableMFARequest
              required:
                - otpCode
                - pendingVersion
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:regenerateRecoveryCodes:
    post:
      tags:
        - UserService
      summary: RegenerateRecoveryCodes
      description: |-
        Mints a pending recovery-code set beside the live one and returns it.
         The old codes keep working until ConfirmRecoveryCodes promotes these, so
         a caller who closes the page mid-way is not left without any.
         Permissions required: None beyond being signed in as `name`.
      operationId: UserService_RegenerateRecoveryCodes
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.RegenerateRecoveryCodesResponse'
  /v1/users/{user}:requestReauthCode:
    post:
      tags:
        - UserService
      summary: RequestReauthCode
      description: |-
        Sends a one-time code to the caller's own email, usable as
         CredentialProof.email_code. Bytebase Cloud only, and only while the
         account has no live MFA factor. Not AuthService.SendEmailLoginCode: that
         one starts a session, this one proves an existing one.
         Permissions required: None beyond being signed in as `name`.
      operationId: UserService_RequestReauthCode
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
  /v1/users/{user}:startMFAEnrollment:
    post:
      tags:
        - UserService
      summary: StartMFAEnrollment
      description: |-
        Mints a pending TOTP secret and recovery codes for the caller's own
         account and returns them. Nothing goes live until ConfirmRecoveryCodes,
         so an abandoned enrollment leaves the account exactly as it was.
         Permissions required: None beyond being signed in as `name`.
      operationId: UserService_StartMFAEnrollment
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.StartMFAEnrollmentResponse'
  /v1/users/{user}:undelete:
    post:
      tags:
        - UserService
      summary: UndeleteUser
      description: |-
        Restores a deleted user.
         Permissions required: bb.users.undelete
      operationId: UserService_UndeleteUser
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users/{user}:updateEmail:
    post:
      tags:
        - UserService
      summary: UpdateEmail
      description: |-
        Updates a user's email address.
         Permissions required: bb.users.updateEmail
      operationId: UserService_UpdateEmail
      parameters:
        - name: user
          in: path
          description: The user id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  title: email
                  maxLength: 254
                  description: The new email address.
              title: UpdateEmailRequest
              required:
                - email
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.User'
  /v1/users:batchGet:
    get:
      tags:
        - UserService
      summary: BatchGetUsers
      description: |-
        Get the users in batch.
         Any authenticated user can batch get users.
         One resource per requested name, in request order. The first name that
         does not resolve fails the whole call (AIP-231: no partial response).
         Permissions required: bb.users.get
      operationId: UserService_BatchGetUsers
      parameters:
        - name: names
          in: query
          description: |-
            The user names to retrieve.
             Format: users/{email}
          required: true
          schema:
            type: array
            items:
              type: string
            title: names
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.BatchGetUsersResponse'
  /v1/workloadIdentities/{workloadIdentity}:
    get:
      tags:
        - WorkloadIdentityService
      summary: GetWorkloadIdentity
      description: |-
        Gets a workload identity by name.
         Permissions required: bb.workloadIdentities.get
      operationId: WorkloadIdentityService_GetWorkloadIdentity
      parameters:
        - name: workloadIdentity
          in: path
          description: The workloadIdentity id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
    delete:
      tags:
        - WorkloadIdentityService
      summary: DeleteWorkloadIdentity
      description: |-
        Deletes a workload identity.
         Permissions required: bb.workloadIdentities.delete
      operationId: WorkloadIdentityService_DeleteWorkloadIdentity
      parameters:
        - name: workloadIdentity
          in: path
          description: The workloadIdentity id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - WorkloadIdentityService
      summary: UpdateWorkloadIdentity
      description: |-
        Updates a workload identity.
         Permissions required: bb.workloadIdentities.update
      operationId: WorkloadIdentityService_UpdateWorkloadIdentity
      parameters:
        - name: workloadIdentity
          in: path
          description: The workloadIdentity id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: |-
            The list of fields to update.
             Supported fields: title, workload_identity_config
          schema:
            type: string
      requestBody:
        description: |-
          The workload identity to update.

           The workload identity's `name` field is used to identify the workload identity to update.
           Format: workloadIdentities/{email}
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
              title: workload_identity
              description: |-
                The workload identity to update.

                 The workload identity's `name` field is used to identify the workload identity to update.
                 Format: workloadIdentities/{email}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
  /v1/workloadIdentities/{workloadIdentity}:undelete:
    post:
      tags:
        - WorkloadIdentityService
      summary: UndeleteWorkloadIdentity
      description: |-
        Restores a deleted workload identity.
         Permissions required: bb.workloadIdentities.undelete
      operationId: WorkloadIdentityService_UndeleteWorkloadIdentity
      parameters:
        - name: workloadIdentity
          in: path
          description: The workloadIdentity id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
  /v1/workspaces:
    get:
      tags:
        - WorkspaceService
      summary: ListWorkspaces
      description: Lists all workspaces the current user is a member of.
      operationId: WorkspaceService_ListWorkspaces
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListWorkspacesResponse'
  /v1/workspaces/{workspace}:
    get:
      tags:
        - WorkspaceService
      summary: GetWorkspace
      description: |-
        Gets a workspace by name.
         Supports "workspaces/-" to resolve the current workspace:
         - Authenticated: uses the workspace from JWT context
         - Self-hosted unauthenticated: returns the single workspace
         - SaaS unauthenticated: returns minimal response
      operationId: WorkspaceService_GetWorkspace
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Workspace'
    delete:
      tags:
        - WorkspaceService
      summary: DeleteWorkspace
      description: |-
        Deletes a workspace. SaaS only. Cancels any active subscription and
         soft-deletes the workspace so all associated data becomes inaccessible.
         Requires workspace admin permission.
      operationId: WorkspaceService_DeleteWorkspace
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.LoginResponse'
    patch:
      tags:
        - WorkspaceService
      summary: UpdateWorkspace
      description: Updates a workspace. Currently only title can be updated.
      operationId: WorkspaceService_UpdateWorkspace
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.Workspace'
                  title: workspace
                updateMask:
                  allOf:
                    - $ref: '#/components/schemas/google.protobuf.FieldMask'
                  title: update_mask
              title: UpdateWorkspaceRequest
              required:
                - workspace
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Workspace'
  /v1/workspaces/{workspace}/auth/info:
    get:
      tags:
        - AuthService
      summary: GetAuthenticationInfo
      description: |-
        Gets everything the login page renders: the sign-in restrictions and the
         identity providers it offers.
         Permissions required: None
      operationId: AuthService_GetAuthenticationInfo2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AuthenticationInfo'
  /v1/workspaces/{workspace}/databases:
    get:
      tags:
        - DatabaseService
      summary: ListDatabases
      description: |-
        Lists databases in a project, instance, or workspace.
         Permissions required: bb.databases.list (for project or workspace parent), or bb.instances.get (for instance parent)
      operationId: DatabaseService_ListDatabases3
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListDatabases` must
             match the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: filter
          in: query
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - name: the database name, support ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
             - table: filter by the database table, support "==" and ".contains()" operator.
             - labels.{key}: the database label, support "==" and "in" operators.

             For example:
             environment == "environments/{environment resource id}"
             environment == "" (find databases which environment is not set)
             project == "projects/{project resource id}"
             instance == "instances/{instance resource id}"
             instance == "projects/{project resource id}/instances/{instance resource id}"
             name.contains("database name")
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             exclude_unassigned == true
             table == "sample"
             table.contains("sam")
             labels.environment == "production"
             labels.region == "asia"
             labels.region in ["asia", "europe"]

             You can combine filter conditions like:
             environment == "environments/prod" && name.contains("employee")
          schema:
            type: string
            title: filter
        - name: showDeleted
          in: query
          description: Show deleted database if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: orderBy
          in: query
          description: |-
            The order by of databases.
             Support name, project, instance. The default sorting order is ascending.
             For example:
             - order_by = "name" - order by name ascending
             - order_by = "name desc"
             - order_by = "name desc, project asc"
          schema:
            type: string
            title: order_by
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
  /v1/workspaces/{workspace}/idps:
    get:
      tags:
        - IdentityProviderService
      summary: |-
        Lists the identity providers configured for the caller's workspace.
         The login page reads AuthService.GetAuthenticationInfo instead,
         which publishes only the fields a browser needs to start an SSO redirect.
      description: |-
        Returns the same representation as GetIdentityProvider — secrets redacted,
         the rest of the configuration included — so granting
         bb.identityProviders.list conveys configuration read over the whole
         collection, not merely the names in it.
         Permissions required: bb.identityProviders.list
      operationId: IdentityProviderService_ListIdentityProviders2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListIdentityProvidersResponse'
  /v1/workspaces/{workspace}/policies:
    get:
      tags:
        - OrgPolicyService
      summary: ListPolicies
      description: |-
        Lists policies at a specified resource level.
         Permissions required: bb.policies.list
      operationId: OrgPolicyService_ListPolicies
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: policyType
          in: query
          description: Filter by specific policy type.
          schema:
            oneOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
              - type: "null"
            title: policy_type
        - name: showDeleted
          in: query
          description: Show deleted policies if specified.
          schema:
            type: boolean
            title: show_deleted
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
    post:
      tags:
        - OrgPolicyService
      summary: CreatePolicy
      description: |-
        Creates a new organizational policy.
         Permissions required: bb.policies.create
      operationId: OrgPolicyService_CreatePolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type of policy to create.
          schema:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.PolicyType'
            title: type
      requestBody:
        description: The policy to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: The policy to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/workspaces/{workspace}/policies/{policy}:
    get:
      tags:
        - OrgPolicyService
      summary: GetPolicy
      description: |-
        Retrieves a policy by name.
         Permissions required: bb.policies.get
      operationId: OrgPolicyService_GetPolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
    delete:
      tags:
        - OrgPolicyService
      summary: DeletePolicy
      description: |-
        Deletes an organizational policy.
         Permissions required: bb.policies.delete
      operationId: OrgPolicyService_DeletePolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.protobuf.Empty'
    patch:
      tags:
        - OrgPolicyService
      summary: UpdatePolicy
      description: |-
        Updates an existing organizational policy.
         Permissions required: bb.policies.update
      operationId: OrgPolicyService_UpdatePolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: policy
          in: path
          description: The policy id.
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          description: The list of fields to update.
          schema:
            type: string
        - name: allowMissing
          in: query
          description: |-
            If set to true, and the policy is not found, a new policy will be created.
             In this situation, `update_mask` is ignored.
          schema:
            type: boolean
            title: allow_missing
      requestBody:
        description: |-
          The policy to update.

           The policy's `name` field is used to identify the instance to update.
           Format: {resource name}/policies/{policy type}
           Workspace resource name: workspaces/{workspace-id}.
           Environment resource name: environments/environment-id.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Policy'
              title: policy
              description: |-
                The policy to update.

                 The policy's `name` field is used to identify the instance to update.
                 Format: {resource name}/policies/{policy type}
                 Workspace resource name: workspaces/{workspace-id}.
                 Environment resource name: environments/environment-id.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.Policy'
  /v1/workspaces/{workspace}/serviceAccounts:
    get:
      tags:
        - ServiceAccountService
      summary: ListServiceAccounts
      description: |-
        Lists service accounts.
         For workspace-level: parent is workspaces/{id}, permission bb.serviceAccounts.list on workspace.
         For project-level: parent is projects/{project}, permission bb.serviceAccounts.list on project.
      operationId: ServiceAccountService_ListServiceAccounts2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of service accounts to return. The service may return fewer than
             this value.
             If unspecified, at most 10 service accounts will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListServiceAccounts` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListServiceAccounts` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted service accounts if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter service accounts returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the service account name, support "==" and ".contains()" operator.
             - email: the service account email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@service.bytebase.com"
             email.contains("ed")
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListServiceAccountsResponse'
    post:
      tags:
        - ServiceAccountService
      summary: CreateServiceAccount
      description: |-
        Creates a new service account.
         For workspace-level: parent is workspaces/{id}, permission bb.serviceAccounts.create on workspace.
         For project-level: parent is projects/{project}, permission bb.serviceAccounts.create on project.
      operationId: ServiceAccountService_CreateServiceAccount2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: serviceAccountId
          in: query
          description: |-
            The ID to use for the service account, which will become the final component
             of the service account's email in the format: {service_account_id}@service.bytebase.com
             or {service_account_id}@{project-id}.service.bytebase.com
          required: true
          schema:
            type: string
            title: service_account_id
      requestBody:
        description: The service account to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
              title: service_account
              description: The service account to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
  /v1/workspaces/{workspace}/settings/EMAIL:test:
    post:
      tags:
        - SettingService
      summary: TestEmailSetting
      description: |-
        Sends a test email using the provided config (without persisting).
         Permissions required: bb.settings.set
      operationId: SettingService_TestEmailSetting
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                emailSetting:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.EmailSetting'
                  title: email_setting
                to:
                  type: string
                  title: to
              title: TestEmailSettingRequest
              required:
                - emailSetting
                - to
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.TestEmailSettingResponse'
  /v1/workspaces/{workspace}/workloadIdentities:
    get:
      tags:
        - WorkloadIdentityService
      summary: ListWorkloadIdentities
      description: |-
        Lists workload identities.
         For workspace-level: parent is workspaces/{id}, permission bb.workloadIdentities.list on workspace.
         For project-level: parent is projects/{project}, permission bb.workloadIdentities.list on project.
      operationId: WorkloadIdentityService_ListWorkloadIdentities2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: pageSize
          in: query
          description: |-
            The maximum number of workload identities to return. The service may return fewer than
             this value.
             If unspecified, at most 10 workload identities will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
          schema:
            type: integer
            title: page_size
            format: int32
        - name: pageToken
          in: query
          description: |-
            A page token, received from a previous `ListWorkloadIdentities` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListWorkloadIdentities` must match
             the call that provided the page token.
          schema:
            type: string
            title: page_token
        - name: showDeleted
          in: query
          description: Show deleted workload identities if specified.
          schema:
            type: boolean
            title: show_deleted
        - name: filter
          in: query
          description: |-
            Filter is used to filter workload identities returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the workload identity name, support "==" and ".contains()" operator.
             - email: the workload identity email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@workload.bytebase.com"
             email.contains("ed")
          schema:
            type: string
            title: filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.ListWorkloadIdentitiesResponse'
    post:
      tags:
        - WorkloadIdentityService
      summary: CreateWorkloadIdentity
      description: |-
        Creates a new workload identity.
         For workspace-level: parent is workspaces/{id}, permission bb.workloadIdentities.create on workspace.
         For project-level: parent is projects/{project}, permission bb.workloadIdentities.create on project.
      operationId: WorkloadIdentityService_CreateWorkloadIdentity2
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
        - name: workloadIdentityId
          in: query
          description: |-
            The ID to use for the workload identity, which will become the final component
             of the workload identity's email in the format: {workload_identity_id}@workload.bytebase.com
             or {workload_identity_id}@{project-id}.workload.bytebase.com
          required: true
          schema:
            type: string
            title: workload_identity_id
      requestBody:
        description: The workload identity to create.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
              title: workload_identity
              description: The workload identity to create.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
  /v1/workspaces/{workspace}:getIamPolicy:
    get:
      tags:
        - WorkspaceService
      summary: GetIamPolicy
      description: |-
        Retrieves IAM policy for the workspace.
         Permissions required: bb.workspaces.getIamPolicy
      operationId: WorkspaceService_GetIamPolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IamPolicy'
  /v1/workspaces/{workspace}:leave:
    post:
      tags:
        - WorkspaceService
      summary: LeaveWorkspace
      description: |-
        Removes the calling user from a workspace and switches to the next
         available workspace. Available to any workspace member. Fails if the
         caller is the last workspace admin.
      operationId: WorkspaceService_LeaveWorkspace
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.LoginResponse'
  /v1/workspaces/{workspace}:rotateDirectorySyncToken:
    post:
      tags:
        - WorkspaceService
      summary: RotateDirectorySyncToken
      description: |-
        Mints a new directory sync (SCIM) token, immediately invalidating the
         previous one. The plaintext token is returned exactly once and cannot be
         retrieved afterwards; only its hash is stored. Callers that lose it must
         rotate again and update their identity provider.
         Permissions required: bb.workspaces.rotateDirectorySyncToken
      operationId: WorkspaceService_RotateDirectorySyncToken
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.RotateDirectorySyncTokenResponse'
  /v1/workspaces/{workspace}:setIamPolicy:
    post:
      tags:
        - WorkspaceService
      summary: SetIamPolicy
      description: |-
        Sets IAM policy for the workspace.
         Permissions required: bb.workspaces.setIamPolicy
      operationId: WorkspaceService_SetIamPolicy
      parameters:
        - name: workspace
          in: path
          description: The workspace id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                policy:
                  allOf:
                    - $ref: '#/components/schemas/bytebase.v1.IamPolicy'
                  title: policy
                etag:
                  type: string
                  title: etag
                  description: |-
                    (OPTIONAL) The current etag of the policy. Equivalent to setting `policy.etag`;
                     supplying both with different values returns INVALID_ARGUMENT.
              title: SetIamPolicyRequest
              required:
                - policy
              additionalProperties: false
              description: Request message for setting an IAM policy.
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.IamPolicy'
  /v1:adminExecute:
    get:
      tags:
        - SQLService
      summary: AdminExecute
      description: |-
        Executes SQL with admin privileges via streaming connection.
         Permissions required: bb.sql.admin
      operationId: SQLService_AdminExecute
      parameters:
        - name: name
          in: query
          description: |-
            The name is the instance name to execute the query against.
             Format: instances/{instance}/databases/{databaseName} or
             projects/{project}/instances/{instance}/databases/{databaseName}
          required: true
          schema:
            type: string
            title: name
        - name: statement
          in: query
          description: The SQL statement to execute.
          schema:
            type: string
            title: statement
        - name: limit
          in: query
          description: The maximum number of rows to return.
          schema:
            type: integer
            title: limit
            format: int32
        - name: schema
          in: query
          description: |-
            The default schema to execute the statement. Equals to the current schema
             in Oracle and search path in Postgres.
          schema:
            type: string
            title: schema
        - name: container
          in: query
          description: |-
            Container is the container name to execute the query against, used for
             CosmosDB only.
          schema:
            type: string
            title: container
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bytebase.v1.AdminExecuteResponse'
components:
  schemas:
    bytebase.v1.AIChatMessage:
      type: object
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AIChatMessageRole'
          title: role
          description: The role of the message sender.
        content:
          type:
            - string
            - "null"
          title: content
          description: The text content of the message. Optional for assistant messages that only contain tool calls.
        toolCalls:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AIChatToolCall'
          title: tool_calls
          description: Tool calls made by the assistant. Only present in assistant messages.
        toolCallId:
          type:
            - string
            - "null"
          title: tool_call_id
          description: The ID of the tool call this message is responding to. Only present in tool messages.
      title: AIChatMessage
      additionalProperties: false
      description: A single message in the conversation.
    bytebase.v1.AIChatMessageRole:
      type: string
      title: AIChatMessageRole
      enum:
        - AI_CHAT_MESSAGE_ROLE_UNSPECIFIED
        - AI_CHAT_MESSAGE_ROLE_SYSTEM
        - AI_CHAT_MESSAGE_ROLE_USER
        - AI_CHAT_MESSAGE_ROLE_ASSISTANT
        - AI_CHAT_MESSAGE_ROLE_TOOL
      description: Role of a chat message.
    bytebase.v1.AIChatRequest:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AIChatMessage'
          title: messages
          description: The conversation messages.
        toolDefinitions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AIChatToolDefinition'
          title: tool_definitions
          description: The tool definitions available to the AI.
      title: AIChatRequest
      additionalProperties: false
      description: Request message for AIService.Chat.
    bytebase.v1.AIChatResponse:
      type: object
      properties:
        content:
          type:
            - string
            - "null"
          title: content
          description: The text content of the AI response. Optional when the response only contains tool calls.
        toolCalls:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AIChatToolCall'
          title: tool_calls
          description: Tool calls the AI wants to make.
        usage:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.AIChatUsage'
            - type: "null"
          title: usage
          description: Token usage for this provider call, when available.
        stopReason:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AIChatResponse.StopReason'
          title: stop_reason
          description: Why the model stopped. A truncated or blocked response can still carry content.
      title: AIChatResponse
      additionalProperties: false
      description: Response message for AIService.Chat.
    bytebase.v1.AIChatResponse.StopReason:
      type: string
      title: StopReason
      enum:
        - STOP_REASON_UNSPECIFIED
        - TURN_COMPLETED
        - TOKEN_LIMIT
        - BLOCKED
        - MALFORMED_TOOL_CALL
        - OTHER
      description: Why the model stopped generating a response.
    bytebase.v1.AIChatToolCall:
      type: object
      properties:
        id:
          type: string
          title: id
          description: The unique ID of this tool call.
        name:
          type: string
          title: name
          description: The name of the tool to call.
        arguments:
          type: string
          title: arguments
          description: The JSON-encoded arguments to pass to the tool.
        metadata:
          type:
            - string
            - "null"
          title: metadata
          description: |-
            Opaque provider-specific metadata (e.g., Gemini thought_signature).
             Frontend must echo this back unchanged when sending tool results.
      title: AIChatToolCall
      additionalProperties: false
      description: A tool call made by the AI.
    bytebase.v1.AIChatToolDefinition:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of the tool.
        description:
          type: string
          title: description
          description: A description of what the tool does.
        parametersSchema:
          type: string
          title: parameters_schema
          description: The JSON Schema describing the tool's parameters.
      title: AIChatToolDefinition
      additionalProperties: false
      description: A tool definition that the AI can invoke.
    bytebase.v1.AIChatUsage:
      type: object
      properties:
        totalTokens:
          type: integer
          title: total_tokens
          format: int32
          description: Total tokens used by the provider call.
        inputTokens:
          type:
            - integer
            - "null"
          title: input_tokens
          format: int32
          description: Input tokens used by the provider call, including cached input.
        outputTokens:
          type:
            - integer
            - "null"
          title: output_tokens
          format: int32
          description: Output tokens used by the provider call, including reasoning tokens.
        cachedInputTokens:
          type:
            - integer
            - "null"
          title: cached_input_tokens
          format: int32
          description: Input tokens read from cache. This is a subset of input_tokens.
      title: AIChatUsage
      additionalProperties: false
      description: Token usage for a single AI provider call.
    bytebase.v1.AISetting:
      type: object
      properties:
        enabled:
          type: boolean
          title: enabled
        provider:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AISetting.Provider'
          title: provider
        endpoint:
          type: string
          title: endpoint
        apiKey:
          type: string
          title: api_key
        model:
          type: string
          title: model
        version:
          type: string
          title: version
        sqlReviewEnabled:
          type: boolean
          title: sql_review_enabled
          description: |-
            Whether the AI SQL review may run. It is off by default and is a consent
             of its own beside `enabled`: a review sends the statements of a change to
             the provider, and can send the schema of its target databases and their
             table statistics.
      title: AISetting
      additionalProperties: false
    bytebase.v1.AISetting.Provider:
      type: string
      title: Provider
      enum:
        - PROVIDER_UNSPECIFIED
        - OPEN_AI
        - CLAUDE
        - GEMINI
        - AZURE_OPENAI
    bytebase.v1.AccessGrant:
      type: object
      anyOf:
        - type: object
          properties:
            expireTime:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.Timestamp'
              title: expire_time
              description: The expiration time of the access grant.
          title: expire_time
        - type: object
          properties:
            ttl:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.Duration'
              title: ttl
              description: |-
                Input only. The time-to-live duration for the access grant.
                 The server computes `expire_time` from this value at activation time.
              writeOnly: true
          title: ttl
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - expireTime
              - required:
                  - ttl
          - not:
              oneOf:
                - required:
                    - expireTime
                - required:
                    - ttl
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the access grant, generated by the server.
             Format: projects/{project}/accessGrants/{access_grant}
             The {access_grant} segment is a server-generated unique ID.
        creator:
          type: string
          title: creator
          description: |-
            The creator of the access grant, the caller who requested it.
             Format: users/{email}
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AccessGrant.Status'
          title: status
          description: |-
            The status of the access grant.
             An ACTIVE grant with `expire_time` in the past is effectively expired
             and no longer authorizes access. Use `expire_time` to determine
             whether an ACTIVE grant has expired.
          readOnly: true
        issue:
          type: string
          title: issue
          description: |-
            The issue associated with the access grant.
             Can be empty.
             Format: projects/{project}/issues/{issue}
          readOnly: true
        targets:
          type: array
          items:
            type: string
          title: targets
          description: |-
            The target databases for this access grant.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        query:
          type: string
          title: query
          description: The query permission granted.
        unmask:
          type: boolean
          title: unmask
          description: Whether the grant allows unmasking sensitive data.
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        reason:
          type: string
          title: reason
        export:
          type: boolean
          title: export
          description: |-
            Whether the grant allows exporting the query result.
             An active grant with export=true grants bb.sql.export for this query until the grant expires.
        schema:
          type: string
          title: schema
          description: The default schema to execute the query.
        container:
          type: string
          title: container
          description: The container name to execute the query against, used for CosmosDB only.
      title: AccessGrant
      required:
        - targets
    bytebase.v1.AccessGrant.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - PENDING
        - ACTIVE
        - REVOKED
      description: The status of the access grant.
    bytebase.v1.ActivateAccessGrantRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the access grant to activate.
             Format: projects/{project}/accessGrants/{access_grant}
      title: ActivateAccessGrantRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.Activity:
      type: object
      title: Activity
      additionalProperties: false
      description: Activity types for webhook notifications.
    bytebase.v1.Activity.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - ISSUE_CREATED
        - ISSUE_APPROVAL_REQUESTED
        - ISSUE_SENT_BACK
        - PIPELINE_FAILED
        - PIPELINE_COMPLETED
        - ISSUE_APPROVED
      description: Activity type enumeration.
    bytebase.v1.ActuatorInfo:
      type: object
      properties:
        version:
          type: string
          title: version
          description: The Bytebase server version.
          readOnly: true
        gitCommit:
          type: string
          title: git_commit
          description: The git commit hash of the build.
          readOnly: true
        saas:
          type: boolean
          title: saas
          description: Whether the Bytebase instance is running in SaaS mode where some features cannot be edited by users.
          readOnly: true
        externalUrl:
          type: string
          title: external_url
          description: The external URL where users or webhook callbacks access Bytebase.
          readOnly: true
        lastActiveTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: last_active_time
          description: The last time any API call was made, refreshed on each request.
          readOnly: true
        workspace:
          type: string
          title: workspace
          description: |-
            The unique identifier for the workspace.
             Format: workspaces/{id}
          readOnly: true
        unlicensedFeatures:
          type: array
          items:
            type: string
            readOnly: true
          title: unlicensed_features
          description: List of features that are not licensed.
          readOnly: true
        activatedInstanceCount:
          type: integer
          title: activated_instance_count
          format: int32
          description: The number of activated database instances.
          readOnly: true
        totalInstanceCount:
          type: integer
          title: total_instance_count
          format: int32
          description: The total number of database instances.
          readOnly: true
        externalUrlFromFlag:
          type: boolean
          title: external_url_from_flag
          description: Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
          readOnly: true
        replicaCount:
          type: integer
          title: replica_count
          format: int32
          description: The number of active replicas (servers sharing the same database).
          readOnly: true
        defaultProject:
          type: string
          title: default_project
          description: |-
            The default project for unassigned databases.
             Format: projects/{id}
          readOnly: true
        userCountInIam:
          type: integer
          title: user_count_in_iam
          format: int32
          description: The number of users in the workspace IAM (for seat limit display).
          readOnly: true
        activeVcsUserCount:
          type: integer
          title: active_vcs_user_count
          format: int32
          description: The number of active VCS users seen in the active window.
          readOnly: true
        sample:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SampleInfo'
          title: sample
          description: Sample setup availability and provisioned resources.
          readOnly: true
        mcpSetting:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.MCPSetting'
          title: mcp_setting
          description: The MCP (Model Context Protocol) setting in the current workspace.
          readOnly: true
        aiEnabled:
          type: boolean
          title: ai_enabled
          description: Whether the workspace AI setting enables the AI agent.
          readOnly: true
        aiSqlReviewEnabled:
          type: boolean
          title: ai_sql_review_enabled
          description: |-
            Whether the workspace AI setting switches the AI SQL review on. A review
             also needs `ai_enabled`.
          readOnly: true
      title: ActuatorInfo
      additionalProperties: false
      description: |-
        System information and configuration for the Bytebase instance.
         Actuator concept is similar to the Spring Boot Actuator.
    bytebase.v1.AddDataSourceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance to add a data source to.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        dataSource:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource'
          title: data_source
          description: |-
            Identified by data source ID.
             Only READ_ONLY data source can be added.
        validateOnly:
          type: boolean
          title: validate_only
          description: Validate only also tests the data source connection.
      title: AddDataSourceRequest
      required:
        - name
        - dataSource
      additionalProperties: false
    bytebase.v1.AddWebhookRequest:
      type: object
      properties:
        project:
          type: string
          title: project
          description: |-
            The name of the project to add the webhook to.
             Format: projects/{project}
        webhook:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Webhook'
          title: webhook
          description: The webhook to add.
      title: AddWebhookRequest
      required:
        - project
        - webhook
      additionalProperties: false
    bytebase.v1.AdminExecuteRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name is the instance name to execute the query against.
             Format: instances/{instance}/databases/{databaseName} or
             projects/{project}/instances/{instance}/databases/{databaseName}
        statement:
          type: string
          title: statement
          description: The SQL statement to execute.
        limit:
          type: integer
          title: limit
          format: int32
          description: The maximum number of rows to return.
        schema:
          type:
            - string
            - "null"
          title: schema
          description: |-
            The default schema to execute the statement. Equals to the current schema
             in Oracle and search path in Postgres.
        container:
          type:
            - string
            - "null"
          title: container
          description: |-
            Container is the container name to execute the query against, used for
             CosmosDB only.
      title: AdminExecuteRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.AdminExecuteResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryResult'
          title: results
          description: The query results.
      title: AdminExecuteResponse
      additionalProperties: false
    bytebase.v1.Advice:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Advice.Level'
          title: status
          description: The advice level.
        code:
          type: integer
          title: code
          format: int32
          description: The advice code.
        title:
          type: string
          title: title
          description: The advice title.
        content:
          type: string
          title: content
          description: The advice content.
        startPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: start_position
          description: |-
            The start_position is inclusive and the end_position is exclusive.
             TODO: use range instead
        endPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: end_position
        ruleType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Advice.RuleType'
          title: rule_type
          description: The type of linting rule that generated this advice.
      title: Advice
      additionalProperties: false
    bytebase.v1.Advice.Level:
      type: string
      title: Level
      enum:
        - ADVICE_LEVEL_UNSPECIFIED
        - SUCCESS
        - WARNING
        - ERROR
      description: Level represents the severity level of the advice.
    bytebase.v1.Advice.RuleType:
      type: string
      title: RuleType
      enum:
        - RULE_TYPE_UNSPECIFIED
        - PARSER_BASED
        - AI_POWERED
      description: RuleType indicates the source of the linting rule.
    bytebase.v1.Algorithm:
      type: object
      anyOf:
        - type: object
          properties:
            fullMask:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Algorithm.FullMask'
              title: full_mask
          title: full_mask
        - type: object
          properties:
            innerOuterMask:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Algorithm.InnerOuterMask'
              title: inner_outer_mask
          title: inner_outer_mask
        - type: object
          properties:
            md5Mask:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Algorithm.MD5Mask'
              title: md5_mask
          title: md5_mask
        - type: object
          properties:
            rangeMask:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Algorithm.RangeMask'
              title: range_mask
          title: range_mask
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - fullMask
              - required:
                  - innerOuterMask
              - required:
                  - md5Mask
              - required:
                  - rangeMask
          - not:
              oneOf:
                - required:
                    - fullMask
                - required:
                    - innerOuterMask
                - required:
                    - md5Mask
                - required:
                    - rangeMask
      title: Algorithm
    bytebase.v1.Algorithm.FullMask:
      type: object
      properties:
        substitution:
          type: string
          title: substitution
          description: |-
            substitution is the string used to replace the original value, the
             max length of the string is 16 bytes.
      title: FullMask
      additionalProperties: false
    bytebase.v1.Algorithm.InnerOuterMask:
      type: object
      properties:
        prefixLen:
          type: integer
          title: prefix_len
          format: int32
        suffixLen:
          type: integer
          title: suffix_len
          format: int32
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Algorithm.InnerOuterMask.MaskType'
          title: type
        substitution:
          type: string
          title: substitution
      title: InnerOuterMask
      additionalProperties: false
    bytebase.v1.Algorithm.InnerOuterMask.MaskType:
      type: string
      title: MaskType
      enum:
        - MASK_TYPE_UNSPECIFIED
        - INNER
        - OUTER
    bytebase.v1.Algorithm.MD5Mask:
      type: object
      properties:
        salt:
          type: string
          title: salt
          description: salt is the salt value to generate a different hash that with the word alone.
      title: MD5Mask
      additionalProperties: false
    bytebase.v1.Algorithm.RangeMask:
      type: object
      properties:
        slices:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Algorithm.RangeMask.Slice'
          title: slices
          description: |-
            We store it as a repeated field to face the fact that the original value may have multiple parts should be masked.
             But frontend can be started with a single rule easily.
      title: RangeMask
      additionalProperties: false
    bytebase.v1.Algorithm.RangeMask.Slice:
      type: object
      properties:
        start:
          type: integer
          title: start
          format: int32
          description: |-
            start is the start character index (0-based) of the original value, should be less than end.
             Uses character indices (not byte offsets) for display-oriented masking.
             Example: For "你好world", character index 2 refers to 'w' (the 3rd character).
        end:
          type: integer
          title: end
          format: int32
          description: |-
            end is the end character index (exclusive) of the original value.
             Uses character indices (not byte offsets) for display-oriented masking.
        substitution:
          type: string
          title: substitution
          description: substitution is the string used to replace the OriginalValue[start:end).
      title: Slice
      additionalProperties: false
    bytebase.v1.Announcement:
      type: object
      properties:
        text:
          type: string
          title: text
          description: The text of announcement
        link:
          type: string
          title: link
          description: The optional link, user can follow the link to check extra details
        theme:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Announcement.AnnouncementTheme'
          title: theme
          description: |-
            Banner colors. Built-in presets (info/warning/critical) are a
             frontend-only concept that seeds these colors; the store only holds them.
      title: Announcement
      additionalProperties: false
    bytebase.v1.Announcement.AnnouncementTheme:
      type: object
      properties:
        background:
          allOf:
            - $ref: '#/components/schemas/google.type.Color'
          title: background
        text:
          allOf:
            - $ref: '#/components/schemas/google.type.Color'
          title: text
      title: AnnouncementTheme
      additionalProperties: false
    bytebase.v1.AppIMSetting:
      type: object
      properties:
        settings:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AppIMSetting.IMSetting'
          title: settings
      title: AppIMSetting
      additionalProperties: false
    bytebase.v1.AppIMSetting.DingTalk:
      type: object
      properties:
        clientId:
          type: string
          title: client_id
          writeOnly: true
        clientSecret:
          type: string
          title: client_secret
          writeOnly: true
        robotCode:
          type: string
          title: robot_code
          writeOnly: true
      title: DingTalk
      additionalProperties: false
    bytebase.v1.AppIMSetting.Feishu:
      type: object
      properties:
        appId:
          type: string
          title: app_id
          writeOnly: true
        appSecret:
          type: string
          title: app_secret
          writeOnly: true
      title: Feishu
      additionalProperties: false
    bytebase.v1.AppIMSetting.IMSetting:
      type: object
      anyOf:
        - type: object
          properties:
            dingtalk:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.DingTalk'
              title: dingtalk
          title: dingtalk
        - type: object
          properties:
            feishu:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Feishu'
              title: feishu
          title: feishu
        - type: object
          properties:
            lark:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Lark'
              title: lark
          title: lark
        - type: object
          properties:
            slack:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Slack'
              title: slack
          title: slack
        - type: object
          properties:
            teams:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Teams'
              title: teams
          title: teams
        - type: object
          properties:
            wecom:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Wecom'
              title: wecom
          title: wecom
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - dingtalk
              - required:
                  - feishu
              - required:
                  - lark
              - required:
                  - slack
              - required:
                  - teams
              - required:
                  - wecom
          - not:
              oneOf:
                - required:
                    - dingtalk
                - required:
                    - feishu
                - required:
                    - lark
                - required:
                    - slack
                - required:
                    - teams
                - required:
                    - wecom
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WebhookType'
          title: type
      title: IMSetting
    bytebase.v1.AppIMSetting.Lark:
      type: object
      properties:
        appId:
          type: string
          title: app_id
          writeOnly: true
        appSecret:
          type: string
          title: app_secret
          writeOnly: true
      title: Lark
      additionalProperties: false
    bytebase.v1.AppIMSetting.Slack:
      type: object
      properties:
        token:
          type: string
          title: token
          writeOnly: true
      title: Slack
      additionalProperties: false
    bytebase.v1.AppIMSetting.Teams:
      type: object
      properties:
        tenantId:
          type: string
          title: tenant_id
          description: Azure AD tenant ID (Directory ID).
          writeOnly: true
        clientId:
          type: string
          title: client_id
          description: Azure AD application (client) ID.
          writeOnly: true
        clientSecret:
          type: string
          title: client_secret
          description: Azure AD client secret.
          writeOnly: true
      title: Teams
      additionalProperties: false
    bytebase.v1.AppIMSetting.Wecom:
      type: object
      properties:
        corpId:
          type: string
          title: corp_id
          writeOnly: true
        agentId:
          type: string
          title: agent_id
          writeOnly: true
        secret:
          type: string
          title: secret
          writeOnly: true
      title: Wecom
      additionalProperties: false
    bytebase.v1.ApprovalFlow:
      type: object
      properties:
        roles:
          type: array
          items:
            type: string
          title: roles
          description: The roles required for approval in order.
      title: ApprovalFlow
      additionalProperties: false
    bytebase.v1.ApprovalStatus:
      type: string
      title: ApprovalStatus
      enum:
        - APPROVAL_STATUS_UNSPECIFIED
        - CHECKING
        - PENDING
        - APPROVED
        - REJECTED
        - SKIPPED
      description: |-
        Approval workflow status for an issue or a plan.
         Lives at the top level so both plan_service.proto and issue_service.proto
         can reference it without a circular import.
    bytebase.v1.ApprovalTemplate:
      type: object
      properties:
        flow:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ApprovalFlow'
          title: flow
          description: The approval flow definition.
        title:
          type: string
          title: title
          description: The title of the approval template.
        description:
          type: string
          title: description
          description: The description of the approval template.
      title: ApprovalTemplate
      additionalProperties: false
    bytebase.v1.ApproveIssueRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue to add an approver.
             Format: projects/{project}/issues/{issue}
        comment:
          type: string
          title: comment
          description: The comment explaining the approval decision.
      title: ApproveIssueRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.AuditBehavior:
      type: string
      title: AuditBehavior
      enum:
        - AUDIT_BEHAVIOR_UNSPECIFIED
        - SENSITIVE
        - OMIT
      description: |-
        What an audit payload may carry for a field. One enum rather than a bool per
         behavior, because a field has exactly one classification.
    bytebase.v1.AuditData:
      type: object
      properties:
        policyDelta:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PolicyDelta'
          title: policy_delta
          description: Changes to IAM policies.
      title: AuditData
      additionalProperties: false
      description: Additional audit data specific to certain operations.
    bytebase.v1.AuditLog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the log.
             Formats:
             - projects/{project}/auditLogs/{uid}
             - workspaces/{workspace}/auditLogs/{uid}
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          description: The timestamp when the audit log was created.
          readOnly: true
        actor:
          type: string
          title: actor
          description: |-
            The principal who performed the action.
             Formats: users/{email}, serviceAccounts/{email}, or workloadIdentities/{email}
        method:
          type: string
          title: method
          description: |-
            The method or action being audited.
             For example: /bytebase.v1.SQLService/Query or bb.project.repository.push
        severity:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AuditLog.Severity'
          title: severity
          description: The severity level of this audit log entry.
        resource:
          type: string
          title: resource
          description: The resource associated with this audit log.
        request:
          type: string
          title: request
          description: The request payload in JSON format.
        response:
          type: string
          title: response
          description: |-
            The response payload in JSON format.
             Some fields may be omitted if they are too large or contain sensitive information.
        status:
          allOf:
            - $ref: '#/components/schemas/google.rpc.Status'
          title: status
          description: The status of the operation.
        latency:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: latency
          description: The duration of the operation.
        serviceData:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Any'
          title: service_data
          description: Service-specific metadata about the request, response, and activities.
        requestMetadata:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.RequestMetadata'
          title: request_metadata
          description: Metadata about the request context.
        mcpDelegation:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.MCPDelegation'
          title: mcp_delegation
          description: |-
            MCP delegation provenance. Present exactly when the audited call arrived
             through the MCP server's delegated credential; never set for public API
             calls. Presence of this message is the MCP-origin marker.
          readOnly: true
      title: AuditLog
      additionalProperties: false
      description: Audit log entry recording system activity or API call.
    bytebase.v1.AuditLog.Severity:
      type: string
      title: Severity
      enum:
        - SEVERITY_UNSPECIFIED
        - DEBUG
        - INFO
        - NOTICE
        - WARNING
        - ERROR
        - CRITICAL
        - ALERT
        - EMERGENCY
      description: Severity level for audit log entries.
    bytebase.v1.AuthMethod:
      type: string
      title: AuthMethod
      enum:
        - AUTH_METHOD_UNSPECIFIED
        - IAM
        - CUSTOM
      description: Authorization method for RPC calls.
    bytebase.v1.AuthenticationInfo:
      type: object
      properties:
        workspace:
          type: string
          title: workspace
          description: |-
            The workspace used for authentication, when one can be resolved.
             Format: workspaces/{workspace}
          readOnly: true
        restriction:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Restriction'
          title: restriction
          description: The effective authentication restrictions.
          readOnly: true
        identityProviders:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.LoginIdentityProvider'
          title: identity_providers
          description: The identity providers the login page renders, in display order.
          readOnly: true
      title: AuthenticationInfo
      additionalProperties: false
    bytebase.v1.AuthorizationRequest:
      type: object
      properties:
        endpoint:
          type: string
          title: endpoint
          description: |-
            The OAuth2 auth_url, or the authorization endpoint from the OIDC issuer's
             discovery document.
        clientId:
          type: string
          title: client_id
          description: The OAuth2 or OIDC client identifier.
        scopes:
          type: array
          items:
            type: string
          title: scopes
          description: The scopes to request.
      title: AuthorizationRequest
      additionalProperties: false
      description: AuthorizationRequest is what a browser needs to start an SSO redirect.
    bytebase.v1.BatchCancelTaskRunsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The task name for the taskRuns.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
             Use `projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/-` to cancel task runs under the same stage.
        taskRuns:
          type: array
          items:
            type: string
          title: task_runs
          description: |-
            The taskRuns to cancel.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
      title: BatchCancelTaskRunsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.BatchCancelTaskRunsResponse:
      type: object
      title: BatchCancelTaskRunsResponse
      additionalProperties: false
    bytebase.v1.BatchCreateRevisionsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource shared by all revisions being created.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        requests:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CreateRevisionRequest'
          title: requests
          description: |-
            The request message specifying the revisions to create.
             A maximum of 100 revisions can be created in a batch.
      title: BatchCreateRevisionsRequest
      required:
        - parent
        - requests
      additionalProperties: false
    bytebase.v1.BatchCreateRevisionsResponse:
      type: object
      properties:
        revisions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Revision'
          title: revisions
          description: The created revisions.
      title: BatchCreateRevisionsResponse
      additionalProperties: false
    bytebase.v1.BatchCreateSheetsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where all sheets will be created.
             Format: projects/{project}
        requests:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CreateSheetRequest'
          title: requests
      title: BatchCreateSheetsRequest
      required:
        - parent
        - requests
      additionalProperties: false
    bytebase.v1.BatchCreateSheetsResponse:
      type: object
      properties:
        sheets:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Sheet'
          title: sheets
      title: BatchCreateSheetsResponse
      additionalProperties: false
    bytebase.v1.BatchDeleteProjectsRequest:
      type: object
      properties:
        names:
          type: array
          items:
            type: string
          title: names
          description: |-
            The names of the projects to delete.
             Format: projects/{project}
        purge:
          type: boolean
          title: purge
          description: |-
            If set to true, permanently purge the soft-deleted projects and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted projects.
             All projects must already be soft-deleted for this to work.
             When purge=true, all databases will be moved to the default project before deletion.
             When purge=false (soft delete/archive), the projects and their databases/issues remain unchanged.
      title: BatchDeleteProjectsRequest
      required:
        - names
      additionalProperties: false
    bytebase.v1.BatchDeparseRequest:
      type: object
      properties:
        expressions:
          type: array
          items:
            $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: expressions
          description: The CEL expression ASTs to deparse.
      title: BatchDeparseRequest
      additionalProperties: false
      description: Request message for batch deparsing CEL expressions.
    bytebase.v1.BatchDeparseResponse:
      type: object
      properties:
        expressions:
          type: array
          items:
            type: string
          title: expressions
          description: The deparsed CEL expressions as strings.
      title: BatchDeparseResponse
      additionalProperties: false
      description: Response message for batch deparsing CEL expressions.
    bytebase.v1.BatchGetDatabasesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource shared by all databases being retrieved.
             - projects/{project}: batch get databases in a project;
             - instances/{instance}: batch get databases in an instance;
             - projects/{project}/instances/{instance}: batch get databases in a project instance;
             Use "-" as wildcard to batch get databases across parent.
        names:
          type: array
          items:
            type: string
          title: names
          description: The list of database names to retrieve.
      title: BatchGetDatabasesRequest
      required:
        - parent
        - names
      additionalProperties: false
    bytebase.v1.BatchGetDatabasesResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Database'
          title: databases
          description: One database per requested name, in the same order as `names`.
      title: BatchGetDatabasesResponse
      additionalProperties: false
    bytebase.v1.BatchGetGroupsRequest:
      type: object
      properties:
        names:
          type: array
          items:
            type: string
          title: names
          description: |-
            The group names to retrieve.
             Format: groups/{email}
      title: BatchGetGroupsRequest
      required:
        - names
      additionalProperties: false
      description: Request message for batch getting groups.
    bytebase.v1.BatchGetGroupsResponse:
      type: object
      properties:
        groups:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Group'
          title: groups
          description: One group per requested name, in the same order as `names`.
      title: BatchGetGroupsResponse
      additionalProperties: false
      description: Response message for batch getting groups.
    bytebase.v1.BatchGetProjectsRequest:
      type: object
      properties:
        names:
          type: array
          items:
            type: string
          title: names
          description: |-
            The names of projects to retrieve.
             Format: projects/{project}
      title: BatchGetProjectsRequest
      required:
        - names
      additionalProperties: false
    bytebase.v1.BatchGetProjectsResponse:
      type: object
      properties:
        projects:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Project'
          title: projects
          description: One project per requested name, in the same order as `names`.
      title: BatchGetProjectsResponse
      additionalProperties: false
    bytebase.v1.BatchGetUsersRequest:
      type: object
      properties:
        names:
          type: array
          items:
            type: string
          title: names
          description: |-
            The user names to retrieve.
             Format: users/{email}
      title: BatchGetUsersRequest
      required:
        - names
      additionalProperties: false
    bytebase.v1.BatchGetUsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.User'
          title: users
          description: One user per requested name, in the same order as `names`.
      title: BatchGetUsersResponse
      additionalProperties: false
    bytebase.v1.BatchParseRequest:
      type: object
      properties:
        expressions:
          type: array
          items:
            type: string
          title: expressions
          description: The CEL expression strings to parse.
      title: BatchParseRequest
      additionalProperties: false
      description: Request message for batch parsing CEL expressions.
    bytebase.v1.BatchParseResponse:
      type: object
      properties:
        expressions:
          type: array
          items:
            $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: expressions
          description: The parsed CEL expressions as AST.
      title: BatchParseResponse
      additionalProperties: false
      description: Response message for batch parsing CEL expressions.
    bytebase.v1.BatchRunTasksRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The stage name for the tasks.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
        tasks:
          type: array
          items:
            type: string
          title: tasks
          description: |-
            The tasks to run.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
        runTime:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: run_time
          description: The task run should run after run_time.
        skipPriorBackup:
          type: boolean
          title: skip_prior_backup
          description: If true, skip prior backup for this run even if the task has prior backup enabled.
      title: BatchRunTasksRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.BatchRunTasksResponse:
      type: object
      title: BatchRunTasksResponse
      additionalProperties: false
    bytebase.v1.BatchSkipTasksRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The stage name for the tasks.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
        tasks:
          type: array
          items:
            type: string
          title: tasks
          description: |-
            The tasks to skip.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
        reason:
          type: string
          title: reason
          maxLength: 1000
          description: The reason for skipping the tasks.
      title: BatchSkipTasksRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.BatchSkipTasksResponse:
      type: object
      title: BatchSkipTasksResponse
      additionalProperties: false
    bytebase.v1.BatchSyncDatabasesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource shared by all databases being updated.
             Format: instances/{instance} or projects/{project}/instances/{instance}
             If the operation spans parents, a dash (-) may be accepted as a wildcard.
        names:
          type: array
          items:
            type: string
          title: names
          description: The list of database names to sync.
      title: BatchSyncDatabasesRequest
      required:
        - names
      additionalProperties: false
    bytebase.v1.BatchSyncDatabasesResponse:
      type: object
      title: BatchSyncDatabasesResponse
      additionalProperties: false
    bytebase.v1.BatchSyncInstancesRequest:
      type: object
      properties:
        parent:
          type:
            - string
            - "null"
          title: parent
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, all targets must be workspace
             instances; otherwise, every target must belong to this project collection.
        requests:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SyncInstanceRequest'
          title: requests
          description: |-
            The request message specifying the instances to sync.
             A maximum of 1000 instances can be synced in a batch.
      title: BatchSyncInstancesRequest
      required:
        - requests
      additionalProperties: false
    bytebase.v1.BatchSyncInstancesResponse:
      type: object
      title: BatchSyncInstancesResponse
      additionalProperties: false
    bytebase.v1.BatchUpdateDatabasesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource shared by all databases being updated.
             Format: instances/{instance} or projects/{project}/instances/{instance}
             If the operation spans parents, a dash (-) may be accepted as a wildcard.
             We only support updating the project of databases for now.
        requests:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.UpdateDatabaseRequest'
          title: requests
          description: |-
            The request message specifying the resources to update.
             A maximum of 1000 databases can be modified in a batch.
      title: BatchUpdateDatabasesRequest
      required:
        - requests
      additionalProperties: false
    bytebase.v1.BatchUpdateDatabasesResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Database'
          title: databases
          description: Databases updated.
      title: BatchUpdateDatabasesResponse
      additionalProperties: false
    bytebase.v1.BatchUpdateInstancesRequest:
      type: object
      properties:
        parent:
          type:
            - string
            - "null"
          title: parent
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, all targets must be workspace
             instances; otherwise, every target must belong to this project collection.
        requests:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.UpdateInstanceRequest'
          title: requests
          description: The request message specifying the resources to update.
      title: BatchUpdateInstancesRequest
      required:
        - requests
      additionalProperties: false
    bytebase.v1.BatchUpdateInstancesResponse:
      type: object
      properties:
        instances:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Instance'
          title: instances
      title: BatchUpdateInstancesResponse
      additionalProperties: false
    bytebase.v1.BatchUpdateIssuesStatusRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource shared by all issues being updated.
             Format: projects/{project}
             If the operation spans parents, a dash (-) may be accepted as a wildcard.
             We only support updating the status of databases for now.
        issues:
          type: array
          items:
            type: string
          title: issues
          description: |-
            The list of issues to update.
             Format: projects/{project}/issues/{issue}
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
          title: status
          description: The new status.
        reason:
          type: string
          title: reason
          description: The reason for the status change.
      title: BatchUpdateIssuesStatusRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.BatchUpdateIssuesStatusResponse:
      type: object
      title: BatchUpdateIssuesStatusResponse
      additionalProperties: false
    bytebase.v1.BillingInterval:
      type: string
      title: BillingInterval
      enum:
        - BILLING_INTERVAL_UNSPECIFIED
        - MONTH
        - YEAR
    bytebase.v1.Binding:
      type: object
      properties:
        role:
          type: string
          title: role
          description: |-
            The role that is assigned to the members.
             Format: roles/{role}
        members:
          type: array
          items:
            type: string
          title: members
          description: |-
            Specifies the principals requesting access for a Bytebase resource.
             For users, the member should be: user:{email}
             For groups, the member should be: group:{email}
             For service accounts, the member should be: serviceAccount:{email}
             For workload identities, the member should be: workloadIdentity:{email}
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: |-
            The condition that is associated with this binding, only used in the project IAM policy.
             If the condition evaluates to true, then this binding applies to the current request.
             If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Support variables:
             resource.database: the canonical database full name in "instances/{instance}/databases/{database}" or "projects/{project}/instances/{instance}/databases/{database}" format, used by any role with SQL Editor read (e.g. "roles/sqlEditorUser", "roles/sqlEditorReadUser"), export (bb.sql.export, e.g. "roles/sqlEditorExporter") or write (bb.sql.ddl / bb.sql.dml) access, support "==" operator.
             resource.schema_name: the schema name, used by any role with SQL Editor read, export (bb.sql.export) or write (bb.sql.ddl / bb.sql.dml) access; for writes it is evaluated per write-target table, support "==" operator.
             resource.table_name: the table name, used by any role with SQL Editor read, export (bb.sql.export) or write (bb.sql.ddl / bb.sql.dml) access; for writes it is evaluated per write-target table, support "==" operator.
             resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
             request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.

             Known limitations of table/schema-scoped DDL/DML grants:
             - The scope only gates the write target, not the read sources of a write: e.g. `INSERT INTO granted_table SELECT * FROM other_table` may read `other_table` without a grant on it, so a table-scoped write grant is not an exfiltration boundary.
             - It must be paired with a database/project-level read grant: a table-scoped grant alone does not satisfy the SQL Editor query method permission (bb.databases.get).
             - A resource.schema_name-scoped grant only authorizes a write whose schema is unambiguous — qualify the table (schema.table) or select the schema for the SQL Editor session. An unqualified write whose effective schema cannot be determined ahead of execution is denied (qualify it, or use a table-only grant).
             - Multi-statement batches are authorized at the database level: an earlier statement can rebind the session's default schema or database mid-batch, so per-table/schema scoping is dropped and a table/schema-scoped grant requires a database-level grant. The database-level check is still per target database — a qualified cross-database write is gated by a grant on its own database, not the request database — but an unqualified write whose session default is rebound mid-batch is evaluated against the database it literally names, so qualify cross-database writes or run them as single statements.
             - A write target in a different project than the SQL-Editor session's database is denied: the per-target check evaluates the session project's IAM policy, so a cross-project write is failed closed (to write it, open the SQL Editor on a database in the target project).
             - Enforcement is on the statement's literal write target; writes routed elsewhere by a view/synonym, or into a temporary schema (e.g. pg_temp), are evaluated against what the statement names, not the ultimate base object.
             - Write-target gating uses an ALLOWLIST of statement types the resolver models. It does NOT cover every syntactically-identifiable cross-database write; statement types off the allowlist are authorized against the request database. The allowlist is:
                 - Modeled table/data writes (per-table/schema-scopable): INSERT/UPDATE/DELETE/TRUNCATE/MERGE, LOAD DATA, IMPORT INTO, CREATE TABLE AS / SELECT INTO, and table-level CREATE/DROP/ALTER/RENAME/index.
                 - Modeled non-table object DDL (gated at the DATABASE level by the object's own explicit database/schema qualifier; an unqualified name keeps the request-database check): CREATE/ALTER/DROP of view, procedure/function/routine, trigger, sequence, synonym, type, and (Oracle) package and cluster; plus Oracle ALTER/DROP MATERIALIZED VIEW (Oracle CREATE MATERIALIZED VIEW is not modeled — see below).
               NOT modeled (these fall back to the request-database check, so a qualified cross-database one is authorized against the request database): MySQL CREATE TRIGGER and CREATE/ALTER/DROP EVENT (bare-string AST names); MSSQL ALTER of view/procedure/function/trigger (no ALTER node in the grammar); Oracle CREATE MATERIALIZED VIEW and the niche object DDL — dimension, attribute dimension, hierarchy, analytic view, JSON duality view, materialized zonemap, operator, in-memory join group, property graph, vector index, index type, domain; COPY ... FROM; and engine-specific bulk-load / deprecated text writes. A structural "write-target object database" extraction layer to remove this allowlist dependence is tracked as a follow-up.
                 - Out of scope (read sources / indirect effects): the tables a write READS (INSERT … SELECT, MERGE … USING, CREATE TABLE AS … SELECT) and objects reached indirectly via views/synonyms/function bodies/triggers are NOT gated.
               Invariant: for a statement ON the modeled allowlist that explicitly names a different database as its write target, the ACL uses that target database, not the request database. Statement types OFF the allowlist are authorized against the request database.

             For example:
             resource.database == "instances/local-pg/databases/postgres" && resource.schema_name in ["public","another_schema"]
             resource.database == "instances/local-pg/databases/bytebase" && resource.schema_name == "public" && resource.table_name in ["audit_log"]
             resource.database == "instances/local-pg/databases/postgres" && resource.environment_id in ["test"]
             request.time < timestamp("2025-04-26T11:24:48.655Z")
        parsedExpr:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: parsed_expr
          description: The parsed expression of the condition.
          readOnly: true
      title: Binding
      additionalProperties: false
      description: Binding associates members with a role and optional conditions.
    bytebase.v1.BindingDelta:
      type: object
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.BindingDelta.Action'
          title: action
          description: The action that was performed on a Binding.
        role:
          type: string
          title: role
          description: |-
            Role that is assigned to `members`.
             For example, `roles/projectOwner`.
        member:
          type: string
          title: member
          description: Follows the same format of Binding.members.
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: The condition that is associated with this binding.
      title: BindingDelta
      additionalProperties: false
      description: A single change to a binding.
    bytebase.v1.BindingDelta.Action:
      type: string
      title: Action
      enum:
        - ACTION_UNSPECIFIED
        - ADD
        - REMOVE
      description: Type of action performed on a binding.
    bytebase.v1.BoundingBox:
      type: object
      properties:
        xmin:
          type: number
          title: xmin
          format: double
          description: Minimum X coordinate
        ymin:
          type: number
          title: ymin
          format: double
          description: Minimum Y coordinate
        xmax:
          type: number
          title: xmax
          format: double
          description: Maximum X coordinate
        ymax:
          type: number
          title: ymax
          format: double
          description: Maximum Y coordinate
      title: BoundingBox
      additionalProperties: false
      description: BoundingBox defines the spatial bounds for GEOMETRY spatial indexes.
    bytebase.v1.CancelPlanCheckRunRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the plan check run to cancel.
             Format: projects/{project}/plans/{plan}/planCheckRun
      title: CancelPlanCheckRunRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.CancelPlanCheckRunResponse:
      type: object
      title: CancelPlanCheckRunResponse
      additionalProperties: false
    bytebase.v1.CancelPurchaseRequest:
      type: object
      properties:
        feedback:
          type: string
          title: feedback
          description: |-
            Reason the customer is canceling. Maps to Stripe's cancellation_details.feedback.
             Valid Stripe values: "customer_service", "low_quality", "missing_features",
             "switched_service", "too_complex", "too_expensive", "unused", "other".
             Required.
        comment:
          type: string
          title: comment
          description: Optional free-form comment. Max 500 chars (Stripe limit).
      title: CancelPurchaseRequest
      additionalProperties: false
    bytebase.v1.ChangePasswordRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
        newPassword:
          type: string
          title: new_password
          description: |
            string.max_bytes = 72
        credential:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
          title: credential
      title: ChangePasswordRequest
      required:
        - name
        - newPassword
        - credential
      additionalProperties: false
    bytebase.v1.Changelog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}'
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Changelog.Status'
          title: status
        schema:
          type: string
          title: schema
        schemaSize:
          type: string
          title: schema_size
          format: int64
        taskRun:
          type: string
          title: task_run
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
        planTitle:
          type: string
          title: plan_title
          description: |-
            The title of the plan associated with this changelog's task run.
             This field is populated by deriving the plan from task_run for display purposes.
          readOnly: true
      title: Changelog
      additionalProperties: false
    bytebase.v1.Changelog.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - PENDING
        - DONE
        - FAILED
    bytebase.v1.ChangelogView:
      type: string
      title: ChangelogView
      enum:
        - CHANGELOG_VIEW_UNSPECIFIED
        - CHANGELOG_VIEW_BASIC
        - CHANGELOG_VIEW_FULL
    bytebase.v1.CheckConstraintMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a check constraint.
        expression:
          type: string
          title: expression
          description: The expression is the expression of a check constraint.
      title: CheckConstraintMetadata
      additionalProperties: false
      description: CheckConstraintMetadata is the metadata for check constraints.
    bytebase.v1.CheckReleaseRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        release:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Release'
          title: release
          description: The release to check.
        targets:
          type: array
          items:
            type: string
          title: targets
          description: |-
            The targets to dry-run the release.
             Can be database or databaseGroup.
             Format:
             projects/{project}/databaseGroups/{databaseGroup}
             instances/{instance}/databases/{database}
             projects/{project}/instances/{instance}/databases/{database}
        customRules:
          type: string
          title: custom_rules
          description: |-
            Custom linting rules in natural language for AI-powered validation.
             Each rule should be a clear statement describing the desired schema constraint.
             Example: "All tables must have a primary key"
             Example: "VARCHAR columns should specify a maximum length"
        vcsUser:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.VCSUser'
          title: vcs_user
          description: |-
            The non-bot VCS pull request or merge request creator observed by bytebase-release.
             If absent, Bytebase skips VCS user tracking and VCS user limit enforcement.
      title: CheckReleaseRequest
      required:
        - parent
        - release
      additionalProperties: false
    bytebase.v1.CheckReleaseResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CheckReleaseResponse.CheckResult'
          title: results
          description: The check results for each file and target combination.
        affectedRows:
          type: string
          title: affected_rows
          format: int64
          description: The total affected rows across all checks.
        riskLevel:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.RiskLevel'
          title: risk_level
          description: The aggregated risk level of the check.
      title: CheckReleaseResponse
      additionalProperties: false
    bytebase.v1.CheckReleaseResponse.CheckResult:
      type: object
      properties:
        file:
          type: string
          title: file
          description: The file path that is being checked.
        target:
          type: string
          title: target
          description: |-
            The target that the check is performed on.
             Should be a database.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        advices:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Advice'
          title: advices
          description: The list of advice for the file and the target.
        affectedRows:
          type: string
          title: affected_rows
          format: int64
          description: The count of affected rows of the statement on the target.
        riskLevel:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.RiskLevel'
          title: risk_level
          description: The risk level of the statement on the target.
      title: CheckResult
      additionalProperties: false
      description: Check result for a single release file on a target database.
    bytebase.v1.ColumnCatalog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The column name.
        semanticType:
          type: string
          title: semantic_type
          description: The semantic type describing the data purpose.
        labels:
          type: object
          title: labels
          additionalProperties:
            type: string
            title: value
          description: User-defined labels for this column.
        classification:
          type: string
          title: classification
          description: The data classification level for this column.
        objectSchema:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
            - type: "null"
          title: object_schema
          description: Object schema for complex column types like JSON.
      title: ColumnCatalog
      additionalProperties: false
      description: Column metadata within a table.
    bytebase.v1.ColumnMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a column.
        position:
          type: integer
          title: position
          format: int32
          description: The position is the position in columns.
        hasDefault:
          type: boolean
          title: has_default
        default:
          type: string
          title: default
          description: The default value of column.
        defaultOnNull:
          type: boolean
          title: default_on_null
          description: |-
            Oracle specific metadata.
             The default_on_null is the default on null of a column.
        onUpdate:
          type: string
          title: on_update
          description: |-
            The on_update is the on update action of a column.
             For MySQL like databases, it's only supported for TIMESTAMP columns with
             CURRENT_TIMESTAMP as on update value.
        nullable:
          type: boolean
          title: nullable
          description: The nullable is the nullable of a column.
        type:
          type: string
          title: type
          description: The type is the type of a column.
        characterSet:
          type: string
          title: character_set
          description: The character_set is the character_set of a column.
        collation:
          type: string
          title: collation
          description: The collation is the collation of a column.
        comment:
          type: string
          title: comment
          description: The comment is the comment of a column.
        generation:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata'
          title: generation
          description: The generation is the generation of a column.
        isIdentity:
          type: boolean
          title: is_identity
        identityGeneration:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
          title: identity_generation
          description: The identity_generation is for identity columns, PG only.
        identitySeed:
          type: string
          title: identity_seed
          format: int64
          description: The identity_seed is for identity columns, MSSQL only.
        identityIncrement:
          type: string
          title: identity_increment
          format: int64
          description: The identity_increment is for identity columns, MSSQL only.
        defaultConstraintName:
          type: string
          title: default_constraint_name
          description: |-
            The default_constraint_name is the name of the default constraint, MSSQL only.
             In MSSQL, default values are implemented as named constraints. When modifying or
             dropping a column's default value, you must reference the constraint by name.
             This field stores the actual constraint name from the database.

             Example: A column definition like:
               CREATE TABLE employees (
                 status NVARCHAR(20) DEFAULT 'active'
               )

             Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
             or a user-defined name if specified:
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status

             To modify the default, you must first drop the existing constraint by name:
               ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
               ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status

             This field is populated when syncing from the database. When empty (e.g., when parsing
             from SQL files), the system cannot automatically drop the constraint.
        srid:
          type:
            - integer
            - "null"
          title: srid
          description: |-
            The spatial reference system identifier of a spatial column, MySQL 8.0 only.
             Unset means the column declares no SRID; presence carries the explicit SRID,
             including the valid SRID 0. SRS_IDs are unsigned 32-bit (custom SRSs may exceed
             int32).
        isInvisible:
          type: boolean
          title: is_invisible
          description: Whether the column is invisible (hidden from SELECT *), MySQL 8.0.23+ only.
      title: ColumnMetadata
      additionalProperties: false
      description: ColumnMetadata is the metadata for columns.
    bytebase.v1.ColumnMetadata.IdentityGeneration:
      type: string
      title: IdentityGeneration
      enum:
        - IDENTITY_GENERATION_UNSPECIFIED
        - ALWAYS
        - BY_DEFAULT
    bytebase.v1.CompositeTypeAttribute:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of the attribute.
        type:
          type: string
          title: type
          description: The attribute type. User-defined types are always schema-qualified.
        collation:
          type: string
          title: collation
          description: |-
            The non-default collation of the attribute as an emit-ready SQL
             identifier reference (quoted as needed, schema-qualified when outside
             pg_catalog), empty otherwise. e.g. `"C"` or `locale.en_us`.
        comment:
          type: string
          title: comment
          description: The comment describing the attribute.
      title: CompositeTypeAttribute
      additionalProperties: false
    bytebase.v1.CompositeTypeMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of the composite type.
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CompositeTypeAttribute'
          title: attributes
          description: The ordered attributes of the composite type.
        comment:
          type: string
          title: comment
          description: The comment describing the composite type.
      title: CompositeTypeMetadata
      additionalProperties: false
    bytebase.v1.ConfirmRecoveryCodesRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
        pendingVersion:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: pending_version
          description: |-
            The pending_version of the codes being confirmed. Confirming promotes
             exactly the set this version identifies, or nothing.
        credential:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
          title: credential
        otpCode:
          type: string
          title: otp_code
          maxLength: 64
          description: |-
            (OPTIONAL) Required for first-time enrollment, rejected otherwise. A *fresh* code,
             not the one EnableMFA took.
      title: ConfirmRecoveryCodesRequest
      required:
        - name
        - pendingVersion
        - credential
      additionalProperties: false
    bytebase.v1.CreateAccessGrantRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project for the access grant.
             Format: projects/{project}
        accessGrant:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AccessGrant'
          title: access_grant
          description: The access grant to create.
      title: CreateAccessGrantRequest
      required:
        - parent
        - accessGrant
      additionalProperties: false
    bytebase.v1.CreateDatabaseGroupRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where this database group will be created.
             Format: projects/{project}
        databaseGroup:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
          title: database_group
          description: The database group to create.
        databaseGroupId:
          type: string
          title: database_group_id
          description: |-
            The ID to use for the database group, which will become the final component of
             the database group's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
        validateOnly:
          type: boolean
          title: validate_only
          description: If set, validate the create request and preview the full database group response, but do not actually create it.
      title: CreateDatabaseGroupRequest
      required:
        - parent
        - databaseGroup
      additionalProperties: false
      description: Request message for creating a database group.
    bytebase.v1.CreateGroupRequest:
      type: object
      properties:
        group:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Group'
          title: group
          description: The group to create.
        groupEmail:
          type: string
          title: group_email
          description: |-
            The email to use for the group, which will become the final component
             of the group's resource name.
      title: CreateGroupRequest
      required:
        - group
        - groupEmail
      additionalProperties: false
      description: Request message for creating a group.
    bytebase.v1.CreateIdentityProviderRequest:
      type: object
      properties:
        identityProvider:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
          title: identity_provider
          description: The identity provider to create.
        identityProviderId:
          type: string
          title: identity_provider_id
          description: |-
            The ID to use for the identity provider, which will become the final component of
             the identity provider's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
        validateOnly:
          type: boolean
          title: validate_only
          description: If set to true, the request will be validated without actually creating the identity provider.
      title: CreateIdentityProviderRequest
      required:
        - identityProvider
      additionalProperties: false
    bytebase.v1.CreateInstanceRequest:
      type: object
      properties:
        parent:
          type:
            - string
            - "null"
          title: parent
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, the instance is created in the
             workspace collection.
        instance:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Instance'
          title: instance
          description: The instance to create.
        instanceId:
          type: string
          title: instance_id
          description: |-
            The ID to use for the instance, which will become the final component of
             the instance's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
        validateOnly:
          type: boolean
          title: validate_only
          description: Validate only also tests the data source connection.
      title: CreateInstanceRequest
      required:
        - instance
      additionalProperties: false
    bytebase.v1.CreateIssueCommentRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The issue name
             Format: projects/{project}/issues/{issue}
        issueComment:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment'
          title: issue_comment
          description: The comment to create.
      title: CreateIssueCommentRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.CreateIssueRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of issues.
             Format: projects/{project}
        issue:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Issue'
          title: issue
          description: The issue to create.
      title: CreateIssueRequest
      required:
        - parent
        - issue
      additionalProperties: false
    bytebase.v1.CreatePlanRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project where this plan will be created.
             Format: projects/{project}
        plan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Plan'
          title: plan
          description: The plan to create.
      title: CreatePlanRequest
      required:
        - parent
        - plan
      additionalProperties: false
    bytebase.v1.CreatePolicyRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where this instance will be created.
             Workspace resource name: workspaces/{workspace-id}.
             Environment resource name: environments/environment-id.
        policy:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Policy'
          title: policy
          description: The policy to create.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PolicyType'
          title: type
          description: The type of policy to create.
      title: CreatePolicyRequest
      required:
        - parent
        - policy
      additionalProperties: false
    bytebase.v1.CreateProjectRequest:
      type: object
      properties:
        project:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Project'
          title: project
          description: The project to create.
        projectId:
          type: string
          title: project_id
          description: |-
            The ID to use for the project, which will become the final component of
             the project's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
      title: CreateProjectRequest
      required:
        - project
      additionalProperties: false
    bytebase.v1.CreatePurchaseRequest:
      type: object
      properties:
        plan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanType'
          title: plan
        interval:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.BillingInterval'
          title: interval
        seats:
          type: integer
          title: seats
          format: int32
      title: CreatePurchaseRequest
      additionalProperties: false
    bytebase.v1.CreateReleaseRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        release:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Release'
          title: release
          description: The release to create.
        releaseIdTemplate:
          type: string
          title: release_id_template
          description: |-
            Template for release ID generation.
             Available variables: {date}, {time}, {timestamp}, {iteration}.
             Example: "release_{date}-RC{iteration}" generates "release_20260119-RC00".
             Default: "release_{date}-RC{iteration}".
        releaseIdTimezone:
          type: string
          title: release_id_timezone
          description: |-
            Timezone for {date} and {time} variables in the template.
             Must be a valid IANA timezone (e.g., "UTC", "America/Los_Angeles").
             Default: "UTC".
      title: CreateReleaseRequest
      required:
        - parent
        - release
      additionalProperties: false
    bytebase.v1.CreateReviewConfigRequest:
      type: object
      properties:
        reviewConfig:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
          title: review_config
          description: The SQL review config to create.
      title: CreateReviewConfigRequest
      required:
        - reviewConfig
      additionalProperties: false
    bytebase.v1.CreateRevisionRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}'
        revision:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Revision'
          title: revision
          description: The revision to create.
      title: CreateRevisionRequest
      required:
        - parent
        - revision
      additionalProperties: false
    bytebase.v1.CreateRoleRequest:
      type: object
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Role'
          title: role
          description: The role to create.
        roleId:
          type: string
          title: role_id
          description: |-
            The ID to use for the role, which will become the final component
             of the role's resource name.

             This value should be 4-63 characters, and valid characters
             are /[a-z][A-Z][0-9]/.
      title: CreateRoleRequest
      required:
        - role
        - roleId
      additionalProperties: false
    bytebase.v1.CreateRolloutRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent plan for which this rollout will be created.
             Format: projects/{project}/plans/{plan}
        target:
          type:
            - string
            - "null"
          title: target
          description: |-
            Create the rollout only for the specified target.
             Format: environments/{environment}
             If unspecified, all stages are created.
             If set to "", no stages are created.
      title: CreateRolloutRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.CreateSavedQueryRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The project to create the saved query in.
             Format: projects/{project}
        savedQuery:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SavedQuery'
          title: saved_query
          description: The saved query to create.
      title: CreateSavedQueryRequest
      required:
        - parent
        - savedQuery
      additionalProperties: false
    bytebase.v1.CreateServiceAccountRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where this service account will be created.
             Format: projects/{project} for project-level, workspaces/{id} for workspace-level.
        serviceAccountId:
          type: string
          title: service_account_id
          description: |-
            The ID to use for the service account, which will become the final component
             of the service account's email in the format: {service_account_id}@service.bytebase.com
             or {service_account_id}@{project-id}.service.bytebase.com
        serviceAccount:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
          title: service_account
          description: The service account to create.
      title: CreateServiceAccountRequest
      required:
        - serviceAccountId
        - serviceAccount
      additionalProperties: false
      description: Request message for creating a service account.
    bytebase.v1.CreateSheetRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where this sheet will be created.
             Format: projects/{project}
        sheet:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Sheet'
          title: sheet
          description: The sheet to create.
      title: CreateSheetRequest
      required:
        - parent
        - sheet
      additionalProperties: false
    bytebase.v1.CreateUserRequest:
      type: object
      properties:
        user:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.User'
          title: user
          description: The user to create.
      title: CreateUserRequest
      required:
        - user
      additionalProperties: false
    bytebase.v1.CreateWorkloadIdentityRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource where this workload identity will be created.
             Format: projects/{project} for project-level, workspaces/{id} for workspace-level.
        workloadIdentityId:
          type: string
          title: workload_identity_id
          description: |-
            The ID to use for the workload identity, which will become the final component
             of the workload identity's email in the format: {workload_identity_id}@workload.bytebase.com
             or {workload_identity_id}@{project-id}.workload.bytebase.com
        workloadIdentity:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
          title: workload_identity
          description: The workload identity to create.
      title: CreateWorkloadIdentityRequest
      required:
        - workloadIdentityId
        - workloadIdentity
      additionalProperties: false
      description: Request message for creating a workload identity.
    bytebase.v1.CredentialProof:
      type: object
      anyOf:
        - type: object
          properties:
            currentPassword:
              type: string
              title: current_password
              description: |
                The account's current password. Refused by a factor-touching method
                 while a live MFA factor exists.
                string.max_bytes = 72
          title: current_password
        - type: object
          properties:
            emailCode:
              type: string
              title: email_code
              maxLength: 64
              description: |-
                A one-time code from RequestReauthCode. Bytebase Cloud only, and only
                 while the account has no live MFA factor.
          title: email_code
        - type: object
          properties:
            otpCode:
              type: string
              title: otp_code
              maxLength: 64
              description: A live code from the account's enrolled TOTP authenticator.
          title: otp_code
        - type: object
          properties:
            recoveryCode:
              type: string
              title: recovery_code
              maxLength: 64
              description: A single-use MFA recovery code.
          title: recovery_code
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - currentPassword
              - required:
                  - emailCode
              - required:
                  - otpCode
              - required:
                  - recoveryCode
          - not:
              oneOf:
                - required:
                    - currentPassword
                - required:
                    - emailCode
                - required:
                    - otpCode
                - required:
                    - recoveryCode
      title: CredentialProof
      description: |-
        One proof that the caller currently controls a credential on the account.
         Exactly one field must be set; enforced in the handler.
    bytebase.v1.DataClassificationSetting:
      type: object
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig'
          title: configs
      title: DataClassificationSetting
      additionalProperties: false
    bytebase.v1.DataClassificationSetting.DataClassificationConfig:
      type: object
      properties:
        id:
          type: string
          title: id
          description: id is the uuid for classification. Each project can chose one classification config.
        title:
          type: string
          title: title
        levels:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level'
          title: levels
          description: levels is user defined level list for classification.
        classification:
          type: object
          title: classification
          additionalProperties:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification'
            title: value
          description: |-
            classification is the id - DataClassification map.
             The id should in [0-9]+-[0-9]+-[0-9]+ format.
      title: DataClassificationConfig
      additionalProperties: false
    bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification:
      type: object
      properties:
        id:
          type: string
          title: id
          description: id is the classification id in [0-9]+-[0-9]+-[0-9]+ format.
        title:
          type: string
          title: title
        level:
          type:
            - integer
            - "null"
          title: level
          format: int32
          description: The sensitivity level. Maps to Level.level.
      title: DataClassification
      additionalProperties: false
    bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level:
      type: object
      properties:
        title:
          type: string
          title: title
        level:
          type: integer
          title: level
          format: int32
          description: The numeric level for ordering. Higher = more sensitive.
      title: Level
      additionalProperties: false
    bytebase.v1.DataSource:
      type: object
      anyOf:
        - type: object
          properties:
            awsCredential:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSource.AWSCredential'
              title: aws_credential
          title: aws_credential
        - type: object
          properties:
            azureCredential:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSource.AzureCredential'
              title: azure_credential
          title: azure_credential
        - type: object
          properties:
            gcpCredential:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSource.GCPCredential'
              title: gcp_credential
          title: gcp_credential
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - awsCredential
              - required:
                  - azureCredential
              - required:
                  - gcpCredential
          - not:
              oneOf:
                - required:
                    - awsCredential
                - required:
                    - azureCredential
                - required:
                    - gcpCredential
      properties:
        id:
          type: string
          title: id
          description: The unique identifier for this data source.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceType'
          title: type
          description: The type of data source (ADMIN or READ_ONLY).
        username:
          type: string
          title: username
          description: The username for database authentication.
        password:
          type: string
          title: password
          description: The password for database authentication.
          writeOnly: true
        useSsl:
          type: boolean
          title: use_ssl
          description: Use SSL to connect to the data source. By default, we use system default SSL configuration.
        sslCa:
          type: string
          title: ssl_ca
          description: The SSL certificate authority certificate.
          writeOnly: true
        sslCert:
          type: string
          title: ssl_cert
          description: The SSL client certificate.
          writeOnly: true
        sslKey:
          type: string
          title: ssl_key
          description: The SSL client private key.
          writeOnly: true
        sslCaPath:
          type: string
          title: ssl_ca_path
          description: The local filesystem path to the SSL certificate authority certificate.
          writeOnly: true
        sslCertPath:
          type: string
          title: ssl_cert_path
          description: The local filesystem path to the SSL client certificate.
          writeOnly: true
        sslKeyPath:
          type: string
          title: ssl_key_path
          description: The local filesystem path to the SSL client private key.
          writeOnly: true
        sslCaSet:
          type: boolean
          title: ssl_ca_set
          description: Whether an SSL certificate authority certificate has been configured.
          readOnly: true
        sslCertSet:
          type: boolean
          title: ssl_cert_set
          description: Whether an SSL client certificate has been configured.
          readOnly: true
        sslKeySet:
          type: boolean
          title: ssl_key_set
          description: Whether an SSL client private key has been configured.
          readOnly: true
        sslCaPathSet:
          type: boolean
          title: ssl_ca_path_set
          description: Whether an SSL certificate authority path has been configured.
          readOnly: true
        sslCertPathSet:
          type: boolean
          title: ssl_cert_path_set
          description: Whether an SSL client certificate path has been configured.
          readOnly: true
        sslKeyPathSet:
          type: boolean
          title: ssl_key_path_set
          description: Whether an SSL client private key path has been configured.
          readOnly: true
        verifyTlsCertificate:
          type: boolean
          title: verify_tls_certificate
          description: |-
            verify_tls_certificate enables TLS certificate verification for SSL connections.
             Default is false (no verification) for backward compatibility.
             Set to true for secure connections (recommended for production).
             Only set to false for development or when certificates cannot be properly
             validated (e.g., self-signed certs, VPN environments).
        host:
          type: string
          title: host
          description: The hostname or IP address of the database server.
        port:
          type: string
          title: port
          description: The port number of the database server.
        database:
          type: string
          title: database
          description: The name of the database to connect to.
        srv:
          type: boolean
          title: srv
          description: |-
            srv, authentication_database and replica_set are used for MongoDB.
             srv is a boolean flag that indicates whether the host is a DNS SRV record.
        authenticationDatabase:
          type: string
          title: authentication_database
          description: authentication_database is the database name to authenticate against, which stores the user credentials.
        replicaSet:
          type: string
          title: replica_set
          description: replica_set is used for MongoDB replica set.
        sid:
          type: string
          title: sid
          description: sid and service_name are used for Oracle.
        serviceName:
          type: string
          title: service_name
        sshHost:
          type: string
          title: ssh_host
          description: |-
            Connection over SSH.
             The hostname of the SSH server agent.
             Required.
        sshPort:
          type: string
          title: ssh_port
          description: |-
            The port of the SSH server agent. It's 22 typically.
             Required.
        sshUser:
          type: string
          title: ssh_user
          description: |-
            The user to login the server.
             Required.
        sshPassword:
          type: string
          title: ssh_password
          description: The password to login the server. If it's empty string, no password is required.
          writeOnly: true
        sshPrivateKey:
          type: string
          title: ssh_private_key
          description: The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
          writeOnly: true
        authenticationPrivateKey:
          type: string
          title: authentication_private_key
          description: |-
            PKCS#8 private key in PEM format. If it's empty string, no private key is required.
             Used for authentication when connecting to the data source.
          writeOnly: true
        authenticationPrivateKeyPassphrase:
          type: string
          title: authentication_private_key_passphrase
          description: Passphrase for the encrypted PKCS#8 private key. Only used when the private key is encrypted.
          writeOnly: true
        externalSecret:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret'
          title: external_secret
        authenticationType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource.AuthenticationType'
          title: authentication_type
        cloudSqlIpType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource.CloudSQLIPType'
          title: cloud_sql_ip_type
          description: |-
            cloud_sql_ip_type selects the Cloud SQL IP type for Google Cloud SQL IAM connections.
             CLOUD_SQL_IP_TYPE_UNSPECIFIED is treated as PUBLIC for backward compatibility.
        saslConfig:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SASLConfig'
          title: sasl_config
        additionalAddresses:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DataSource.Address'
          title: additional_addresses
          description: (OPTIONAL) additional_addresses is used for MongoDB replica set.
        directConnection:
          type: boolean
          title: direct_connection
          description: direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
        region:
          type: string
          title: region
          description: region is the location of where the DB is, works for AWS RDS. For example, us-east-1.
        warehouseId:
          type: string
          title: warehouse_id
          description: warehouse_id is used by Databricks.
        masterName:
          type: string
          title: master_name
          description: master_name is the master name used by connecting redis-master via redis sentinel.
        masterUsername:
          type: string
          title: master_username
          description: master_username and master_password are master credentials used by redis sentinel mode.
        masterPassword:
          type: string
          title: master_password
          writeOnly: true
        redisType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource.RedisType'
          title: redis_type
        extraConnectionParameters:
          type: object
          title: extra_connection_parameters
          additionalProperties:
            type: string
            title: value
          description: |-
            Extra connection parameters for the database connection.
             For PostgreSQL HA, this can be used to set target_session_attrs=read-write
        projectId:
          type: string
          title: project_id
          description: |-
            project_id and instance_id are the GCP resource identifiers.
             project_id is used by Spanner and BigQuery; instance_id is used by Spanner.
             For these engines, host and port optionally override the default Google API
             endpoint (e.g. a Private Service Connect endpoint like
             spanner-nonprod.p.googleapis.com).
        instanceId:
          type: string
          title: instance_id
      title: DataSource
    bytebase.v1.DataSource.AWSCredential:
      type: object
      properties:
        accessKeyId:
          type: string
          title: access_key_id
          writeOnly: true
        secretAccessKey:
          type: string
          title: secret_access_key
          writeOnly: true
        sessionToken:
          type: string
          title: session_token
          writeOnly: true
        roleArn:
          type: string
          title: role_arn
          description: |-
            ARN of IAM role to assume for cross-account access.
             See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
          writeOnly: true
        externalId:
          type: string
          title: external_id
          description: |-
            Optional external ID for additional security when assuming role.
             See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
          writeOnly: true
      title: AWSCredential
      additionalProperties: false
    bytebase.v1.DataSource.Address:
      type: object
      properties:
        host:
          type: string
          title: host
        port:
          type: string
          title: port
      title: Address
      additionalProperties: false
    bytebase.v1.DataSource.AuthenticationType:
      type: string
      title: AuthenticationType
      enum:
        - AUTHENTICATION_UNSPECIFIED
        - PASSWORD
        - GOOGLE_CLOUD_SQL_IAM
        - AWS_RDS_IAM
        - AZURE_IAM
    bytebase.v1.DataSource.AzureCredential:
      type: object
      properties:
        tenantId:
          type: string
          title: tenant_id
        clientId:
          type: string
          title: client_id
        clientSecret:
          type: string
          title: client_secret
          writeOnly: true
      title: AzureCredential
      additionalProperties: false
    bytebase.v1.DataSource.CloudSQLIPType:
      type: string
      title: CloudSQLIPType
      enum:
        - CLOUD_SQL_IP_TYPE_UNSPECIFIED
        - PUBLIC
        - PRIVATE
        - PSC
      description: CloudSQLIPType selects which Cloud SQL IP to dial for Google Cloud SQL IAM connections.
    bytebase.v1.DataSource.GCPCredential:
      type: object
      properties:
        content:
          type: string
          title: content
          writeOnly: true
      title: GCPCredential
      additionalProperties: false
    bytebase.v1.DataSource.RedisType:
      type: string
      title: RedisType
      enum:
        - REDIS_TYPE_UNSPECIFIED
        - STANDALONE
        - SENTINEL
        - CLUSTER
    bytebase.v1.DataSourceExternalSecret:
      type: object
      anyOf:
        - type: object
          properties:
            appRole:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption'
              title: app_role
              description: AppRole authentication configuration.
          title: app_role
        - type: object
          properties:
            token:
              type: string
              title: token
              description: |-
                Token for direct authentication. Interpreted according to token_type:
                 the literal token (PLAIN), an environment variable name (ENVIRONMENT),
                 or a file path (FILE).
              writeOnly: true
          title: token
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - appRole
              - required:
                  - token
          - not:
              oneOf:
                - required:
                    - appRole
                - required:
                    - token
      properties:
        secretType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.SecretType'
          title: secret_type
          description: The type of external secret store.
        url:
          type: string
          title: url
          description: The URL of the external secret store.
        authType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AuthType'
          title: auth_type
          description: The authentication method for accessing the secret store.
        tokenType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.TokenType'
          title: token_type
          description: How to interpret the token field when auth_type is TOKEN.
        engineName:
          type: string
          title: engine_name
          description: engine name is the name for secret engine.
        secretName:
          type: string
          title: secret_name
          description: the secret name in the engine to store the password.
        passwordKeyName:
          type: string
          title: password_key_name
          description: the key name for the password.
        skipVaultTlsVerification:
          type: boolean
          title: skip_vault_tls_verification
          description: |-
            TLS configuration for connecting to Vault server.
             These fields are separate from the database TLS configuration in DataSource.
             skip_vault_tls_verification disables TLS certificate verification for Vault connections.
             Default is false (verification enabled) for security.
             Only set to true for development or when certificates cannot be properly validated.
        vaultSslCa:
          type: string
          title: vault_ssl_ca
          description: CA certificate for Vault server verification.
          writeOnly: true
        vaultSslCert:
          type: string
          title: vault_ssl_cert
          description: Client certificate for mutual TLS authentication with Vault.
          writeOnly: true
        vaultSslKey:
          type: string
          title: vault_ssl_key
          description: Client private key for mutual TLS authentication with Vault.
          writeOnly: true
      title: DataSourceExternalSecret
    bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption:
      type: object
      properties:
        roleId:
          type: string
          title: role_id
          description: The role ID for Vault AppRole authentication.
          writeOnly: true
        secretId:
          type: string
          title: secret_id
          description: the secret id for the role without ttl.
          writeOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType'
          title: type
          description: The type of secret for AppRole authentication.
        mountPath:
          type: string
          title: mount_path
          description: The path where the approle auth method is mounted.
      title: AppRoleAuthOption
      additionalProperties: false
    bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType:
      type: string
      title: SecretType
      enum:
        - SECRET_TYPE_UNSPECIFIED
        - PLAIN
        - ENVIRONMENT
    bytebase.v1.DataSourceExternalSecret.AuthType:
      type: string
      title: AuthType
      enum:
        - AUTH_TYPE_UNSPECIFIED
        - TOKEN
        - VAULT_APP_ROLE
    bytebase.v1.DataSourceExternalSecret.SecretType:
      type: string
      title: SecretType
      enum:
        - SECRET_TYPE_UNSPECIFIED
        - VAULT_KV_V2
        - AWS_SECRETS_MANAGER
        - GCP_SECRET_MANAGER
        - AZURE_KEY_VAULT
    bytebase.v1.DataSourceExternalSecret.TokenType:
      type: string
      title: TokenType
      enum:
        - TOKEN_TYPE_UNSPECIFIED
        - PLAIN
        - ENVIRONMENT
        - FILE
    bytebase.v1.DataSourceType:
      type: string
      title: DataSourceType
      enum:
        - DATA_SOURCE_UNSPECIFIED
        - ADMIN
        - READ_ONLY
    bytebase.v1.Database:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
             {database} is the database name in the instance.
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The existence of a database.
          readOnly: true
        successfulSyncTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: successful_sync_time
          description: The latest synchronization time.
          readOnly: true
        project:
          type: string
          title: project
          description: |-
            The project for a database.
             Format: projects/{project}
        release:
          type: string
          title: release
          description: |-
            The release that was last applied to this database.
             Format: projects/{project}/releases/{release_id}
             Example: projects/my-project/releases/release_20260115-RC00
          readOnly: true
        environment:
          type:
            - string
            - "null"
          title: environment
          description: |-
            (OPTIONAL) The environment resource.
             Format: environments/prod where prod is the environment resource ID.
        effectiveEnvironment:
          type:
            - string
            - "null"
          title: effective_environment
          description: |-
            The effective environment based on environment tag above and environment
             tag on the instance. Inheritance follows
             https://cloud.google.com/resource-manager/docs/tags/tags-overview.
          readOnly: true
        labels:
          type: object
          title: labels
          additionalProperties:
            type: string
            title: value
          description: Labels will be used for deployment and policy control.
        instanceResource:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.InstanceResource'
          title: instance_resource
          description: The instance resource.
          readOnly: true
        backupAvailable:
          type: boolean
          title: backup_available
          description: The database is available for DML prior backup.
          readOnly: true
        syncStatus:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SyncStatus'
          title: sync_status
          description: The sync status of the database.
          readOnly: true
        syncError:
          type: string
          title: sync_error
          description: The error message if sync failed.
          readOnly: true
      title: Database
      additionalProperties: false
    bytebase.v1.DatabaseCatalog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database catalog.
             Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog
        schemas:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SchemaCatalog'
          title: schemas
          description: The schemas in the database.
      title: DatabaseCatalog
      additionalProperties: false
      description: Catalog metadata for a database including schemas, tables, and columns.
    bytebase.v1.DatabaseChangeMode:
      type: string
      title: DatabaseChangeMode
      enum:
        - DATABASE_CHANGE_MODE_UNSPECIFIED
        - PIPELINE
        - EDITOR
    bytebase.v1.DatabaseGroup:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database group.
             Format: projects/{project}/databaseGroups/{databaseGroup}
        title:
          type: string
          title: title
          maxLength: 200
          description: The short name used in actual databases specified by users.
        databaseExpr:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: database_expr
          description: |-
            The condition that is associated with this database group.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Support variables:
             resource.environment_id: the environment resource id. Support "==", "!=", "in [XX]", "!(in [xx])" operations.
             resource.instance_id: the instance resource id. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
             resource.database_name: the database name. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
             resource.database_labels: the database labels. Support map access operations.
             All variables should join with "&&" condition.

             For example:
             resource.environment_id == "test" && resource.database_name.startsWith("sample_")
             resource.database_labels["tenant"] == "tenant1"
        matchedDatabases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DatabaseGroup.Database'
          title: matched_databases
          description: The list of databases that match the database group condition.
          readOnly: true
      title: DatabaseGroup
      required:
        - title
      additionalProperties: false
      description: A group of databases matched by expressions.
    bytebase.v1.DatabaseGroup.Database:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The resource name of the database.
             Format: instances/{instance}/databases/{database}
      title: Database
      additionalProperties: false
      description: A database within a database group.
    bytebase.v1.DatabaseGroupView:
      type: string
      title: DatabaseGroupView
      enum:
        - DATABASE_GROUP_VIEW_UNSPECIFIED
        - DATABASE_GROUP_VIEW_BASIC
        - DATABASE_GROUP_VIEW_FULL
      description: View options for database group responses.
    bytebase.v1.DatabaseMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The database metadata name.

             Format: instances/{instance}/databases/{database}/metadata or projects/{project}/instances/{instance}/databases/{database}/metadata
        schemas:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SchemaMetadata'
          title: schemas
          description: The schemas is the list of schemas in a database.
        characterSet:
          type: string
          title: character_set
          description: The character_set is the character set of a database.
        collation:
          type: string
          title: collation
          description: The collation is the collation of a database.
        extensions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ExtensionMetadata'
          title: extensions
          description: The extensions is the list of extensions in a database.
        owner:
          type: string
          title: owner
          description: The owner of the database.
        searchPath:
          type: string
          title: search_path
          description: The search_path is the search path of a PostgreSQL database.
      title: DatabaseMetadata
      additionalProperties: false
      description: DatabaseMetadata is the metadata for databases.
    bytebase.v1.DatabaseSDLSchema:
      type: object
      properties:
        schema:
          type: string
          title: schema
          format: byte
          description: |-
            The SDL schema content.
             - For SINGLE_FILE format: contains the complete SDL schema as a text string.
             - For MULTI_FILE format: contains the ZIP archive as binary data.
        contentType:
          type: string
          title: content_type
          description: |-
            The MIME type of the schema content.
             Indicates how the client should interpret the schema field.
             Examples:
             - "text/plain; charset=utf-8" for SINGLE_FILE format
             - "application/zip" for MULTI_FILE format
          readOnly: true
      title: DatabaseSDLSchema
      additionalProperties: false
      description: DatabaseSDLSchema contains the schema in SDL format.
    bytebase.v1.DatabaseSchema:
      type: object
      properties:
        schema:
          type: string
          title: schema
          description: The schema dump from database.
      title: DatabaseSchema
      additionalProperties: false
      description: DatabaseSchema is the metadata for databases.
    bytebase.v1.DeleteDatabaseGroupRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database group to delete.
             Format: projects/{project}/databaseGroups/{databaseGroup}
      title: DeleteDatabaseGroupRequest
      required:
        - name
      additionalProperties: false
      description: Request message for deleting a database group.
    bytebase.v1.DeleteGroupRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the group to delete.
             Format: groups/{email}
      title: DeleteGroupRequest
      required:
        - name
      additionalProperties: false
      description: Request message for deleting a group.
    bytebase.v1.DeleteIdentityProviderRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the identity provider to delete.
             Format: idps/{identity_provider}
      title: DeleteIdentityProviderRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteInstanceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance to delete.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        force:
          type: boolean
          title: force
          description: |-
            If set to true, a workspace instance's databases are moved to the default
             project before the instance is soft-deleted. Project instances reject this
             option because their databases must remain in the owning project.
        purge:
          type: boolean
          title: purge
          description: |-
            If set to true, permanently purge the soft-deleted instance and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted instances.
             The instance must already be soft-deleted for this to work.
      title: DeleteInstanceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeletePolicyRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The policy's `name` field is used to identify the instance to update.
             Format: {resource name}/policies/{policy type}
             Workspace resource name: workspaces/{workspace-id}.
             Environment resource name: environments/environment-id.
      title: DeletePolicyRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteProjectRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the project to delete.
             Format: projects/{project}
        purge:
          type: boolean
          title: purge
          description: |-
            If set to true, permanently purge the soft-deleted project and all related resources.
             This operation is irreversible. Following AIP-165, this should only be used for
             administrative cleanup of old soft-deleted projects.
             The project must already be soft-deleted for this to work.
             When purge=true, all databases will be moved to the default project before deletion.
             When purge=false (soft delete/archive), the project and its databases/issues remain unchanged.
      title: DeleteProjectRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteReleaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the release to delete.
             Format: projects/{project}/releases/{release}
      title: DeleteReleaseRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteReviewConfigRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the SQL review config to delete.
             Format: reviewConfigs/{reviewConfig}
      title: DeleteReviewConfigRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteRevisionRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the revision to delete.
             Format: instances/{instance}/databases/{database}/revisions/{revision} or projects/{project}/instances/{instance}/databases/{database}/revisions/{revision}
      title: DeleteRevisionRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteRoleRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the role to delete.
             Format: roles/{role}
      title: DeleteRoleRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteSavedQueryRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/savedQueries/{savedQuery}'
      title: DeleteSavedQueryRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteServiceAccountRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the service account to delete.
             Format: serviceAccounts/{email}
      title: DeleteServiceAccountRequest
      required:
        - name
      additionalProperties: false
      description: Request message for deleting a service account.
    bytebase.v1.DeleteUserRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the user to delete.
             Format: users/{email}
      title: DeleteUserRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DeleteWorkloadIdentityRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the workload identity to delete.
             Format: workloadIdentities/{email}
      title: DeleteWorkloadIdentityRequest
      required:
        - name
      additionalProperties: false
      description: Request message for deleting a workload identity.
    bytebase.v1.DeleteWorkspaceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: workspaces/{workspace}'
      title: DeleteWorkspaceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.DependencyColumn:
      type: object
      properties:
        schema:
          type: string
          title: schema
          description: The schema is the schema of a reference column.
        table:
          type: string
          title: table
          description: The table is the table of a reference column.
        column:
          type: string
          title: column
          description: The column is the name of a reference column.
      title: DependencyColumn
      additionalProperties: false
      description: DependencyColumn is the metadata for dependency columns.
    bytebase.v1.DependencyTable:
      type: object
      properties:
        schema:
          type: string
          title: schema
          description: The schema is the schema of a reference table.
        table:
          type: string
          title: table
          description: The table is the name of a reference table.
      title: DependencyTable
      additionalProperties: false
    bytebase.v1.DiffMetadataRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The database whose current schema is the diff source.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        targetMetadata:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
          title: target_metadata
          description: |-
            The metadata of the target schema. The source metadata and the engine are
             read from the database, so only the target travels in the request.
             Must describe the COMPLETE target schema: the diff runs against the full
             stored source, so any object omitted from the target (for example by a
             truncated metadata fetch) is treated as dropped.
      title: DiffMetadataRequest
      required:
        - name
        - targetMetadata
      additionalProperties: false
    bytebase.v1.DiffMetadataResponse:
      type: object
      properties:
        diff:
          type: string
          title: diff
          description: The generated migration statements.
      title: DiffMetadataResponse
      additionalProperties: false
    bytebase.v1.DiffSchemaRequest:
      type: object
      anyOf:
        - type: object
          properties:
            changelog:
              type: string
              title: changelog
              description: |-
                The resource name of the changelog
                 Format:
                 instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
          title: changelog
        - type: object
          properties:
            schema:
              type: string
              title: schema
              description: The target schema.
          title: schema
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - changelog
              - required:
                  - schema
          - not:
              oneOf:
                - required:
                    - changelog
                - required:
                    - schema
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database or changelog.
             Format:
             database: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
             changelog: instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
      title: DiffSchemaRequest
      required:
        - name
    bytebase.v1.DiffSchemaResponse:
      type: object
      properties:
        diff:
          type: string
          title: diff
      title: DiffSchemaResponse
      additionalProperties: false
    bytebase.v1.DimensionConstraint:
      type: object
      properties:
        dimension:
          type: string
          title: dimension
          description: Dimension name/type (X, Y, Z, M, etc.)
        minValue:
          type: number
          title: min_value
          format: double
          description: Minimum value for this dimension
        maxValue:
          type: number
          title: max_value
          format: double
          description: Maximum value for this dimension
        tolerance:
          type: number
          title: tolerance
          format: double
          description: Tolerance for this dimension
      title: DimensionConstraint
      additionalProperties: false
      description: DimensionConstraint defines constraints for a spatial dimension.
    bytebase.v1.DimensionalConfig:
      type: object
      properties:
        dimensions:
          type: integer
          title: dimensions
          format: int32
          description: Number of dimensions (2-4, default 2)
        dataType:
          type: string
          title: data_type
          description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
        srid:
          type: integer
          title: srid
          format: int32
          description: Spatial reference system identifier (SRID)
        constraints:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DimensionConstraint'
          title: constraints
          description: Coordinate system constraints
      title: DimensionalConfig
      additionalProperties: false
      description: DimensionalConfig defines dimensional and constraint parameters for spatial indexes.
    bytebase.v1.DisableMFARequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: |-
            Format: users/{email}. The caller's own, or another user's with
             bb.users.update.
        credential:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
          title: credential
          description: |-
            (OPTIONAL) Required for a self-service call against a live factor, and then only
             otp_code or recovery_code. Unused on an admin-assisted call.
      title: DisableMFARequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.EmailSetting:
      type: object
      anyOf:
        - type: object
          properties:
            smtp:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.EmailSetting.SMTPConfig'
              title: smtp
          title: smtp
      unevaluatedProperties: false
      properties:
        from:
          type: string
          title: from
        fromName:
          type: string
          title: from_name
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.EmailSetting.Type'
          title: type
      title: EmailSetting
    bytebase.v1.EmailSetting.SMTPConfig:
      type: object
      properties:
        host:
          type: string
          title: host
        port:
          type: integer
          title: port
          format: int32
        username:
          type: string
          title: username
        password:
          type: string
          title: password
          writeOnly: true
        encryption:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.EmailSetting.SMTPConfig.Encryption'
          title: encryption
        authentication:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.EmailSetting.SMTPConfig.Authentication'
          title: authentication
      title: SMTPConfig
      additionalProperties: false
    bytebase.v1.EmailSetting.SMTPConfig.Authentication:
      type: string
      title: Authentication
      enum:
        - AUTHENTICATION_UNSPECIFIED
        - AUTHENTICATION_NONE
        - PLAIN
        - LOGIN
        - CRAM_MD5
    bytebase.v1.EmailSetting.SMTPConfig.Encryption:
      type: string
      title: Encryption
      enum:
        - ENCRYPTION_UNSPECIFIED
        - ENCRYPTION_NONE
        - STARTTLS
        - SSL_TLS
    bytebase.v1.EmailSetting.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - SMTP
    bytebase.v1.EnableMFARequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
        otpCode:
          type: string
          title: otp_code
          maxLength: 64
          description: A code from the authenticator the pending secret was just added to.
        pendingVersion:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: pending_version
          description: The pending_version this enrollment was minted with.
        credential:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.CredentialProof'
          title: credential
          description: |-
            (OPTIONAL) Proof of the *existing* factor, not the new device above. Required for a
             rotation, and for first-time enrollment on an account with a password.
      title: EnableMFARequest
      required:
        - name
        - otpCode
        - pendingVersion
      additionalProperties: false
    bytebase.v1.Engine:
      type: string
      title: Engine
      enum:
        - ENGINE_UNSPECIFIED
        - CLICKHOUSE
        - MYSQL
        - POSTGRES
        - SNOWFLAKE
        - TIDB
        - MONGODB
        - REDIS
        - ORACLE
        - SPANNER
        - MSSQL
        - REDSHIFT
        - MARIADB
        - OCEANBASE
        - STARROCKS
        - DORIS
        - HIVE
        - ELASTICSEARCH
        - BIGQUERY
        - DYNAMODB
        - DATABRICKS
        - COCKROACHDB
        - COSMOSDB
        - TRINO
        - CASSANDRA
      description: Database engine type.
    bytebase.v1.EnumTypeMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of a type.
        values:
          type: array
          items:
            type: string
          title: values
          description: The enum values of a type.
        comment:
          type: string
          title: comment
          description: The comment describing the enum type.
        skipDump:
          type: boolean
          title: skip_dump
          description: Whether to skip this enum type during schema dump operations.
      title: EnumTypeMetadata
      additionalProperties: false
    bytebase.v1.EnvironmentSetting:
      type: object
      properties:
        environments:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.EnvironmentSetting.Environment'
          title: environments
      title: EnvironmentSetting
      additionalProperties: false
    bytebase.v1.EnvironmentSetting.Environment:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The resource name of the environment.
             Format: environments/{environment}.
             Output only.
          readOnly: true
        id:
          type: string
          title: id
          description: |-
            The resource id of the environment.
             This value should be 4-63 characters, and valid characters
             are /[a-z][0-9]-/.
        title:
          type: string
          title: title
          description: The display name of the environment.
        tags:
          type: object
          title: tags
          additionalProperties:
            type: string
            title: value
        color:
          allOf:
            - $ref: '#/components/schemas/google.type.Color'
          title: color
      title: Environment
      additionalProperties: false
    bytebase.v1.EventMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of the event.
        definition:
          type: string
          title: definition
          description: The schedule of the event.
        timeZone:
          type: string
          title: time_zone
          description: The time zone of the event.
        sqlMode:
          type: string
          title: sql_mode
          description: The SQL mode setting for the event.
        characterSetClient:
          type: string
          title: character_set_client
          description: The character set used by the client creating the event.
        collationConnection:
          type: string
          title: collation_connection
          description: The collation used for the connection when creating the event.
        comment:
          type: string
          title: comment
          description: The comment is the comment of an event.
      title: EventMetadata
      additionalProperties: false
    bytebase.v1.ExchangeTokenRequest:
      type: object
      properties:
        token:
          type: string
          title: token
          maxLength: 65536
          description: External OIDC token (JWT) from CI/CD platform.
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            Workload Identity email for identifying which identity to authenticate as.
             Format: {name}@workload.bytebase.com
      title: ExchangeTokenRequest
      additionalProperties: false
    bytebase.v1.ExchangeTokenResponse:
      type: object
      properties:
        accessToken:
          type: string
          title: access_token
          description: Bytebase access token.
      title: ExchangeTokenResponse
      additionalProperties: false
    bytebase.v1.ExportAuditLogsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
        filter:
          type: string
          title: filter
          description: |-
            The filter of the log. It should be a valid CEL expression.
             Check the filter field in the SearchAuditLogsRequest message.
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of the log.
             Only support order by create_time. The default sorting order is ascending.
             For example:
              - order_by = "create_time asc"
              - order_by = "create_time desc"
        format:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ExportFormat'
          title: format
          description: The export format.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of logs to return.
             The service may return fewer than this value.
             If unspecified, at most 10 log entries will be returned.
             The maximum value is 5000; values above 5000 will be coerced to 5000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ExportAuditLogs` call.
             Provide this to retrieve the subsequent page.
      title: ExportAuditLogsRequest
      required:
        - parent
      additionalProperties: false
      description: Request message for exporting audit logs.
    bytebase.v1.ExportAuditLogsResponse:
      type: object
      properties:
        content:
          type: string
          title: content
          format: byte
          description: The exported audit log content in the requested format.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token to retrieve next page of log entities.
             Pass this value in the page_token field in the subsequent call
             to retrieve the next page of log entities.
      title: ExportAuditLogsResponse
      additionalProperties: false
      description: Response message for exporting audit logs.
    bytebase.v1.ExportDestination:
      type: string
      title: ExportDestination
      enum:
        - EXPORT_DESTINATION_UNSPECIFIED
        - DOWNLOAD
        - SHAREPOINT
      description: Where an export goes. Values are added as destinations are supported.
    bytebase.v1.ExportFormat:
      type: string
      title: ExportFormat
      enum:
        - FORMAT_UNSPECIFIED
        - CSV
        - JSON
        - SQL
        - XLSX
      description: Data export format.
    bytebase.v1.ExportRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name is the resource name to execute the export against.
             Format: instances/{instance}/databases/{database} or
             projects/{project}/instances/{instance}/databases/{database}
        statement:
          type: string
          title: statement
          description: The SQL statement to execute.
        limit:
          type: integer
          title: limit
          format: int32
          description: The maximum number of rows to return.
        format:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ExportFormat'
          title: format
          description: The export format.
        admin:
          type: boolean
          title: admin
          description: |-
            The admin is used for workspace owner and DBA for exporting data from SQL
             Editor Admin mode. The exported data is not masked.
        password:
          type: string
          title: password
          description: The zip password provide by users.
        dataSourceId:
          type: string
          title: data_source_id
          description: |-
            The id of data source.
             If omitted, Export resolves the data source server-side by using the
             single read-only data source when exactly one exists, or the admin data
             source otherwise. It can also be set explicitly to export from the admin
             data source or a specific read-only data source.
        schema:
          type:
            - string
            - "null"
          title: schema
          description: |-
            The default schema to search objects. Equals to the current schema in
             Oracle and search path in Postgres.
        container:
          type:
            - string
            - "null"
          title: container
          description: |-
            Container is the container name to execute the query against, used for
             CosmosDB only.
        destination:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ExportDestination'
          title: destination
          description: |-
            Where the export goes. A destination the workspace query data policy
             does not allow is rejected with FAILED_PRECONDITION.
      title: ExportRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.ExportResponse:
      type: object
      properties:
        content:
          type: string
          title: content
          format: byte
          description: The export file content.
        appliedAccessGrant:
          type: string
          title: applied_access_grant
          description: |-
            The just-in-time access grant applied to this export, if any.
             Format: projects/{project}/accessGrants/{accessGrant}.
             Empty when the user was authorized through normal ACL rather than a grant.
        uri:
          type: string
          title: uri
          description: |-
            Set when the export was sent to an export destination: the absolute
             location of the folder or key prefix created for this export, for example
             https://… for SharePoint or s3://bucket/prefix for S3. content is then empty.
      title: ExportResponse
      additionalProperties: false
    bytebase.v1.ExportSetting:
      type: object
      properties:
        sharepoint:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SharePointSetting'
          title: sharepoint
          description: Unset when SharePoint is not configured.
      title: ExportSetting
      additionalProperties: false
      description: ExportSetting holds each export destination provider's credentials.
    bytebase.v1.ExportVCSProviderUsersRequest:
      type: object
      title: ExportVCSProviderUsersRequest
      additionalProperties: false
    bytebase.v1.ExportVCSProviderUsersResponse:
      type: object
      properties:
        content:
          type: string
          title: content
          format: byte
      title: ExportVCSProviderUsersResponse
      additionalProperties: false
    bytebase.v1.ExtensionMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of an extension.
        schema:
          type: string
          title: schema
          description: |-
            The schema is the extension that is installed to. But the extension usage
             is not limited to the schema.
        version:
          type: string
          title: version
          description: The version is the version of an extension.
        description:
          type: string
          title: description
          description: The description is the description of an extension.
      title: ExtensionMetadata
      additionalProperties: false
      description: ExtensionMetadata is the metadata for extensions.
    bytebase.v1.ExternalTableMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a external table.
        externalServerName:
          type: string
          title: external_server_name
          description: The external_server_name is the name of the external server.
        externalDatabaseName:
          type: string
          title: external_database_name
          description: The external_database_name is the name of the external database.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
          title: columns
          description: The columns is the ordered list of columns in a foreign table.
      title: ExternalTableMetadata
      additionalProperties: false
    bytebase.v1.FieldMapping:
      type: object
      properties:
        identifier:
          type: string
          title: identifier
          description: Identifier is the field name of the unique identifier in 3rd-party idp user info. Required.
        displayName:
          type: string
          title: display_name
          description: DisplayName is the field name of display name in 3rd-party idp user info. Optional.
        phone:
          type: string
          title: phone
          description: Phone is the field name of primary phone in 3rd-party idp user info. Optional.
        groups:
          type: string
          title: groups
          description: |-
            Groups is the field name of groups in 3rd-party idp user info. Optional.
             Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/
      title: FieldMapping
      additionalProperties: false
      description: |-
        FieldMapping saves the field names from user info API of identity provider.
         As we save all raw json string of user info response data into `principal.idp_user_info`,
         we can extract the relevant data based with `FieldMapping`.
    bytebase.v1.ForeignKeyMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a foreign key.
        columns:
          type: array
          items:
            type: string
          title: columns
          description: The columns are the ordered referencing columns of a foreign key.
        referencedSchema:
          type: string
          title: referenced_schema
          description: |-
            The referenced_schema is the referenced schema name of a foreign key.
             It is an empty string for databases without such concept such as MySQL.
        referencedTable:
          type: string
          title: referenced_table
          description: The referenced_table is the referenced table name of a foreign key.
        referencedColumns:
          type: array
          items:
            type: string
          title: referenced_columns
          description: The referenced_columns are the ordered referenced columns of a foreign key.
        onDelete:
          type: string
          title: on_delete
          description: The on_delete is the on delete action of a foreign key.
        onUpdate:
          type: string
          title: on_update
          description: The on_update is the on update action of a foreign key.
        matchType:
          type: string
          title: match_type
          description: |-
            The match_type is the match type of a foreign key.
             The match_type is the PostgreSQL specific field.
             It's empty string for other databases.
      title: ForeignKeyMetadata
      additionalProperties: false
      description: ForeignKeyMetadata is the metadata for foreign keys.
    bytebase.v1.FunctionMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a function.
        definition:
          type: string
          title: definition
          description: The definition is the definition of a function.
        signature:
          type: string
          title: signature
          description: |-
            The signature is the name with the number and type of input arguments the
             function takes.
        characterSetClient:
          type: string
          title: character_set_client
          description: MySQL specific metadata.
        collationConnection:
          type: string
          title: collation_connection
        databaseCollation:
          type: string
          title: database_collation
        sqlMode:
          type: string
          title: sql_mode
        comment:
          type: string
          title: comment
        dependencyTables:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DependencyTable'
          title: dependency_tables
          description: |-
            The dependency_tables is the list of dependency tables of a function.
             For PostgreSQL, it's the list of tables that the function depends on the return type definition.
        skipDump:
          type: boolean
          title: skip_dump
      title: FunctionMetadata
      additionalProperties: false
      description: FunctionMetadata is the metadata for functions.
    bytebase.v1.GenerationMetadata:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
          title: type
        expression:
          type: string
          title: expression
      title: GenerationMetadata
      additionalProperties: false
    bytebase.v1.GenerationMetadata.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - VIRTUAL
        - STORED
    bytebase.v1.GetAccessGrantRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the access grant to retrieve.
             Format: projects/{project}/accessGrants/{access_grant}
      title: GetAccessGrantRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetActuatorInfoRequest:
      type: object
      title: GetActuatorInfoRequest
      additionalProperties: false
      description: Request message for getting actuator information.
    bytebase.v1.GetAuthenticationInfoRequest:
      type: object
      properties:
        workspace:
          type: string
          title: workspace
          description: |-
            Optional. The workspace whose authentication policy should be returned.
             Format: workspaces/{workspace}
             When unset, self-hosted resolves the singleton workspace and SaaS uses
             the deployment-level defaults.
      title: GetAuthenticationInfoRequest
      additionalProperties: false
    bytebase.v1.GetChangelogRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the changelog to retrieve.
             Format: instances/{instance}/databases/{database}/changelogs/{changelog} or projects/{project}/instances/{instance}/databases/{database}/changelogs/{changelog}
        view:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
          title: view
      title: GetChangelogRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetDatabaseCatalogRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database catalog to retrieve.
             Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog
      title: GetDatabaseCatalogRequest
      required:
        - name
      additionalProperties: false
      description: Request message for getting a database catalog.
    bytebase.v1.GetDatabaseGroupRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database group to retrieve.
             Format: projects/{project}/databaseGroups/{databaseGroup}
        view:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
          title: view
          description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
      title: GetDatabaseGroupRequest
      required:
        - name
      additionalProperties: false
      description: Request message for getting a database group.
    bytebase.v1.GetDatabaseMetadataRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database to retrieve metadata.
             Format: instances/{instance}/databases/{database}/metadata or projects/{project}/instances/{instance}/databases/{database}/metadata
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - schema: the schema name, support "==" operator.
             - table: the table name, support "==" and ".contains()" operator.

             For example:
             schema == "schema-a"
             table == "table-a"
             table.contains("table-a")
             schema == "schema-a" && table.contains("sample")
             The filter is used to search for tables containing "sample" in the schema "schemas/schema-a".
             The column masking level will only be returned when a table filter is used.
        limit:
          type: integer
          title: limit
          format: int32
          description: |-
            Limit the response size of returned table metadata per schema.
             For example, if the database has 3 schemas, and each schema has 100 tables,
             if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
             Default 0, means no limit.
      title: GetDatabaseMetadataRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetDatabaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database to retrieve.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
      title: GetDatabaseRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetDatabaseSDLSchemaRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database to retrieve SDL schema.
             Format: instances/{instance}/databases/{database}/sdlSchema or projects/{project}/instances/{instance}/databases/{database}/sdlSchema
        format:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat'
          title: format
          description: The format of the SDL schema output.
      title: GetDatabaseSDLSchemaRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat:
      type: string
      title: SDLFormat
      enum:
        - SDL_FORMAT_UNSPECIFIED
        - SINGLE_FILE
        - MULTI_FILE
      description: SDLFormat specifies the output format for SDL schema.
    bytebase.v1.GetDatabaseSchemaRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database to retrieve schema.
             Format: instances/{instance}/databases/{database}/schema or projects/{project}/instances/{instance}/databases/{database}/schema
      title: GetDatabaseSchemaRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetGroupRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the group to retrieve.
             Format: groups/{email}
      title: GetGroupRequest
      required:
        - name
      additionalProperties: false
      description: Request message for getting a group.
    bytebase.v1.GetIamPolicyRequest:
      type: object
      properties:
        resource:
          type: string
          title: resource
          description: |-
            The name of the resource to get the IAM policy.
             Format: projects/{project}
             Format: workspaces/{workspace}
      title: GetIamPolicyRequest
      required:
        - resource
      additionalProperties: false
      description: Request message for getting an IAM policy.
    bytebase.v1.GetIdentityProviderRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the identity provider to retrieve.
             Format: idps/{idp}
      title: GetIdentityProviderRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetInstanceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance to retrieve.
             Format: instances/{instance} or projects/{project}/instances/{instance}
      title: GetInstanceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetIssueRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue to retrieve.
             Format: projects/{project}/issues/{issue}
        force:
          type: boolean
          title: force
          description: If set to true, bypass cache and fetch the latest data.
      title: GetIssueRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetPaymentInfoRequest:
      type: object
      title: GetPaymentInfoRequest
      additionalProperties: false
    bytebase.v1.GetPlanCheckRunRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the plan check run to retrieve.
             Format: projects/{project}/plans/{plan}/planCheckRun
      title: GetPlanCheckRunRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetPlanRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the plan to retrieve.
             Format: projects/{project}/plans/{plan}
      title: GetPlanRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetPolicyRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the policy to retrieve.
             Format: {resource type}/{resource id}/policies/{policy type}
      title: GetPolicyRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetProjectRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the project to retrieve.
             Format: projects/{project}
      title: GetProjectRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetQueryHistoryRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the query history to retrieve.
             Format: projects/{project}/queryHistories/{id}
      title: GetQueryHistoryRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetReleaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/releases/{release}'
      title: GetReleaseRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetReviewConfigRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the SQL review config to retrieve.
             Format: reviewConfigs/{reviewConfig}
      title: GetReviewConfigRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetReviewRunRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the review run to retrieve.
             Format: projects/{project}/issues/{issue}/reviewRuns/{reviewRun}
      title: GetReviewRunRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetRevisionRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the revision.
             Format: instances/{instance}/databases/{database}/revisions/{revision} or projects/{project}/instances/{instance}/databases/{database}/revisions/{revision}
      title: GetRevisionRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetRoleRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the role to retrieve.
             Format: roles/{role}
      title: GetRoleRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetRolloutRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the rollout to retrieve.
             This is the rollout resource name, which is the plan name plus /rollout suffix.
             Format: projects/{project}/plans/{plan}/rollout
      title: GetRolloutRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetSavedQueryPolicyRequest:
      type: object
      properties:
        resource:
          type: string
          title: resource
          description: 'Format: projects/{project}/savedQueries/{savedQuery}'
      title: GetSavedQueryPolicyRequest
      required:
        - resource
      additionalProperties: false
    bytebase.v1.GetSavedQueryRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/savedQueries/{savedQuery}'
      title: GetSavedQueryRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetSchemaStringRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.GetSchemaStringRequest.ObjectType'
          title: type
        schema:
          type: string
          title: schema
          description: It's empty for DATABASE.
        object:
          type: string
          title: object
          description: It's empty for DATABASE and SCHEMA.
        metadata:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
          title: metadata
          description: |-
            If use the metadata to generate the schema string, the type is OBJECT_TYPE_UNSPECIFIED.
             Also the schema and object are empty.
      title: GetSchemaStringRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetSchemaStringRequest.ObjectType:
      type: string
      title: ObjectType
      enum:
        - OBJECT_TYPE_UNSPECIFIED
        - DATABASE
        - SCHEMA
        - TABLE
        - VIEW
        - MATERIALIZED_VIEW
        - FUNCTION
        - PROCEDURE
        - SEQUENCE
    bytebase.v1.GetSchemaStringResponse:
      type: object
      properties:
        schemaString:
          type: string
          title: schema_string
      title: GetSchemaStringResponse
      additionalProperties: false
    bytebase.v1.GetServiceAccountRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the service account to retrieve.
             Format: serviceAccounts/{email}
      title: GetServiceAccountRequest
      required:
        - name
      additionalProperties: false
      description: Request message for getting a service account.
    bytebase.v1.GetSettingRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The resource name of the setting.
      title: GetSettingRequest
      required:
        - name
      additionalProperties: false
      description: The request message for getting a setting.
    bytebase.v1.GetSettingResponse:
      type: object
      properties:
        setting:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Setting'
          title: setting
      title: GetSettingResponse
      additionalProperties: false
      description: The response message for getting a setting.
    bytebase.v1.GetSheetRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the sheet to retrieve.
             Format: projects/{project}/sheets/{sheet}
        raw:
          type: boolean
          title: raw
          description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
      title: GetSheetRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetSubscriptionRequest:
      type: object
      title: GetSubscriptionRequest
      additionalProperties: false
    bytebase.v1.GetTaskRunLogRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
      title: GetTaskRunLogRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.GetTaskRunRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
      title: GetTaskRunRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetTaskRunSessionRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
      title: GetTaskRunSessionRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.GetUserRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the user to retrieve.
             Format: users/{email}
      title: GetUserRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.GetWorkloadIdentityRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the workload identity to retrieve.
             Format: workloadIdentities/{email}
      title: GetWorkloadIdentityRequest
      required:
        - name
      additionalProperties: false
      description: Request message for getting a workload identity.
    bytebase.v1.GetWorkspaceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The workspace name, format: workspaces/{workspace}.
             Use "workspaces/-" to get the current/default workspace.
      title: GetWorkspaceRequest
      additionalProperties: false
    bytebase.v1.GridLevel:
      type: object
      properties:
        level:
          type: integer
          title: level
          format: int32
          description: Grid level number (1-4 for SQL Server)
        density:
          type: string
          title: density
          description: Grid density (LOW, MEDIUM, HIGH)
      title: GridLevel
      additionalProperties: false
      description: GridLevel defines a tessellation grid level with its density.
    bytebase.v1.Group:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the group to retrieve.
             Format: groups/{group}, the group should be email or uuid.
          readOnly: true
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title of the group.
        description:
          type: string
          title: description
          maxLength: 1000
          description: The description of the group.
        members:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.GroupMember'
          title: members
          description: The members of the group.
        source:
          type: string
          title: source
          description: The source system where the group originated (e.g., Entra ID for SCIM sync).
        email:
          type: string
          title: email
          description: The unique email for the group.
      title: Group
      additionalProperties: false
      description: A group of users within the workspace.
    bytebase.v1.GroupMember:
      type: object
      properties:
        member:
          type: string
          title: member
          description: |-
            Member is the principal who belong to this group.

             Format: users/hello@world.com
        role:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.GroupMember.Role'
          title: role
          description: The member's role in the group.
      title: GroupMember
      additionalProperties: false
      description: A member of a group with a role.
    bytebase.v1.GroupMember.Role:
      type: string
      title: Role
      enum:
        - ROLE_UNSPECIFIED
        - OWNER
        - MEMBER
      description: The role of a group member.
    bytebase.v1.IamPolicy:
      type: object
      properties:
        bindings:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Binding'
          title: bindings
          description: |-
            Collection of binding.
             A binding binds one or more project members to a single project role.
        etag:
          type: string
          title: etag
          description: |-
            The current etag of the policy, returned by GetIamPolicy and SetIamPolicy.
             Sending it back on SetIamPolicy makes the write conditional: if the policy
             changed since the read, the call returns ABORTED. Omitting it applies the
             write unconditionally, overwriting any concurrent change (AIP-154).
      title: IamPolicy
      additionalProperties: false
      description: IAM policy that binds members to roles.
    bytebase.v1.IdentityProvider:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the identity provider.
             Format: idps/{idp}
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title of the identity provider.
        domain:
          type: string
          title: domain
          description: The domain for email matching when using this identity provider.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProviderType'
          title: type
          description: The type of identity provider protocol.
        config:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProviderConfig'
          title: config
          description: The configuration details for the identity provider.
      title: IdentityProvider
      additionalProperties: false
    bytebase.v1.IdentityProviderConfig:
      type: object
      anyOf:
        - type: object
          properties:
            ldapConfig:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderConfig'
              title: ldap_config
              description: LDAP protocol configuration.
          title: ldap_config
        - type: object
          properties:
            oauth2Config:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderConfig'
              title: oauth2_config
              description: OAuth2 protocol configuration.
          title: oauth2_config
        - type: object
          properties:
            oidcConfig:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderConfig'
              title: oidc_config
              description: OIDC protocol configuration.
          title: oidc_config
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - ldapConfig
              - required:
                  - oauth2Config
              - required:
                  - oidcConfig
          - not:
              oneOf:
                - required:
                    - ldapConfig
                - required:
                    - oauth2Config
                - required:
                    - oidcConfig
      title: IdentityProviderConfig
    bytebase.v1.IdentityProviderContext:
      type: object
      anyOf:
        - type: object
          properties:
            oauth2Context:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderContext'
              title: oauth2_context
              description: OAuth2 authentication context.
          title: oauth2_context
        - type: object
          properties:
            oidcContext:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderContext'
              title: oidc_context
              description: OpenID Connect authentication context.
          title: oidc_context
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - oauth2Context
              - required:
                  - oidcContext
          - not:
              oneOf:
                - required:
                    - oauth2Context
                - required:
                    - oidcContext
      title: IdentityProviderContext
      description: Context for identity provider authentication.
    bytebase.v1.IdentityProviderType:
      type: string
      title: IdentityProviderType
      enum:
        - IDENTITY_PROVIDER_TYPE_UNSPECIFIED
        - OAUTH2
        - OIDC
        - LDAP
    bytebase.v1.IndexMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of an index.
        expressions:
          type: array
          items:
            type: string
          title: expressions
          description: |-
            The expressions are the ordered columns or expressions of an index.
             This could refer to a column or an expression.
        keyLength:
          type: array
          items:
            type: string
            format: int64
          title: key_length
          description: |-
            The key_lengths are the ordered key lengths of an index.
             If the key length is not specified, it's -1.
        descending:
          type: array
          items:
            type: boolean
          title: descending
          description: The descending is the ordered descending of an index.
        type:
          type: string
          title: type
          description: The type is the type of an index.
        unique:
          type: boolean
          title: unique
          description: The unique is whether the index is unique.
        primary:
          type: boolean
          title: primary
          description: The primary is whether the index is a primary key index.
        visible:
          type: boolean
          title: visible
          description: The visible is whether the index is visible.
        comment:
          type: string
          title: comment
          description: The comment is the comment of an index.
        definition:
          type: string
          title: definition
          description: The definition of an index.
        parentIndexSchema:
          type: string
          title: parent_index_schema
          description: The schema name of the parent index.
        parentIndexName:
          type: string
          title: parent_index_name
          description: The index name of the parent index.
        granularity:
          type: string
          title: granularity
          format: int64
          description: The number of granules in the block. It's a ClickHouse specific field.
        isConstraint:
          type: boolean
          title: is_constraint
          description: |-
            It's a PostgreSQL specific field.
             The unique constraint and unique index are not the same thing in PostgreSQL.
        spatialConfig:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SpatialIndexConfig'
          title: spatial_config
          description: Spatial index configuration for spatial databases like SQL Server, PostgreSQL with PostGIS, etc.
        opclassNames:
          type: array
          items:
            type: string
          title: opclass_names
          description: |-
            https://www.postgresql.org/docs/current/catalog-pg-opclass.html
             Name of the operator class for each column. (PostgreSQL specific).
        opclassDefaults:
          type: array
          items:
            type: boolean
          title: opclass_defaults
          description: True if the operator class is the default. (PostgreSQL specific).
      title: IndexMetadata
      additionalProperties: false
      description: IndexMetadata is the metadata for indexes.
    bytebase.v1.Instance:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The lifecycle state of the instance.
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title of the instance.
        engine:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Engine'
          title: engine
          description: The database engine type.
        engineVersion:
          type: string
          title: engine_version
          description: The version of the database engine.
          readOnly: true
        externalLink:
          type: string
          title: external_link
          description: External URL to the database instance console.
        dataSources:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DataSource'
          title: data_sources
          description: Data source configurations for connecting to the instance.
        environment:
          type:
            - string
            - "null"
          title: environment
          description: |-
            (OPTIONAL) The environment resource.
             Format: environments/prod where prod is the environment resource ID.
        activation:
          type: boolean
          title: activation
          description: Whether the instance is activated for use.
        roles:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.InstanceRole'
          title: roles
          description: Database roles available in this instance.
          readOnly: true
        syncInterval:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: sync_interval
          description: How often the instance is synced.
        syncDatabases:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SyncDatabases'
          title: sync_databases
          description: |-
            Enable sync for following databases.
             Not set means sync all schemas & databases.
        lastSyncTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: last_sync_time
          description: The last time the instance was synced.
          readOnly: true
        labels:
          type: object
          title: labels
          additionalProperties:
            type: string
            title: value
          description: |-
            Labels are key-value pairs that can be attached to the instance.
             For example, { "org_group": "infrastructure", "environment": "production" }
      title: Instance
      additionalProperties: false
    bytebase.v1.InstanceResource:
      type: object
      properties:
        title:
          type: string
          title: title
          description: The display title of the instance.
        engine:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Engine'
          title: engine
          description: The database engine type.
        engineVersion:
          type: string
          title: engine_version
          description: The version of the database engine.
          readOnly: true
        dataSources:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DataSource'
          title: data_sources
          description: Data source configurations for the instance.
        activation:
          type: boolean
          title: activation
          description: Whether the instance is activated.
        name:
          type: string
          title: name
          description: |-
            The name of the instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        environment:
          type:
            - string
            - "null"
          title: environment
          description: |-
            The environment resource.
             Format: environments/prod where prod is the environment resource ID.
      title: InstanceResource
      additionalProperties: false
    bytebase.v1.InstanceRole:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the role.
             Format: instances/{instance}/roles/{role} or projects/{project}/instances/{instance}/roles/{role}
             The role name is the unique name for the role.
        roleName:
          type: string
          title: role_name
          description: The role name. It's unique within the instance.
        password:
          type:
            - string
            - "null"
          title: password
          description: The role password.
          writeOnly: true
        connectionLimit:
          type:
            - integer
            - "null"
          title: connection_limit
          format: int32
          description: The connection count limit for this role.
        validUntil:
          type:
            - string
            - "null"
          title: valid_until
          description: The expiration for the role's password.
        attribute:
          type:
            - string
            - "null"
          title: attribute
          description: |-
            The role attribute.
             For PostgreSQL, it contains super_user, no_inherit, create_role, create_db, can_login, replication, and bypass_rls. Docs: https://www.postgresql.org/docs/current/role-attributes.html
             For MySQL, it's the global privileges as GRANT statements, which means it only contains "GRANT ... ON *.* TO ...". Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html
      title: InstanceRole
      additionalProperties: false
      description: InstanceRole is the API message for instance role.
    bytebase.v1.Issue:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue.
             Format: projects/{project}/issues/{issue}
        title:
          type: string
          title: title
          maxLength: 200
          description: The title of the issue.
        description:
          type: string
          title: description
          maxLength: 10000
          description: The description of the issue.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Issue.Type'
          title: type
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
          title: status
          description: The status of the issue.
        approvers:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Issue.Approver'
          title: approvers
        approvalTemplate:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ApprovalTemplate'
          title: approval_template
          description: The approval template for the issue.
        creator:
          type: string
          title: creator
          description: 'Format: users/hello@world.com'
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        plan:
          type: string
          title: plan
          description: |-
            The plan associated with the issue.
             Can be empty.
             Format: projects/{project}/plans/{plan}
        roleGrant:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.RoleGrant'
          title: role_grant
          description: Used if the issue type is ROLE_GRANT.
        riskLevel:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.RiskLevel'
          title: risk_level
          description: The risk level of the issue.
        labels:
          type: array
          items:
            type: string
          title: labels
          description: Labels attached to the issue for categorization and filtering.
        approvalStatus:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ApprovalStatus'
          title: approval_status
          description: The overall approval status for the issue.
          readOnly: true
        accessGrant:
          type: string
          title: access_grant
          description: |-
            The access grant associated with this issue.
             Format: projects/{project}/accessGrants/{access_grant}
          readOnly: true
        draft:
          type: boolean
          title: draft
          description: (OPTIONAL) Whether this issue is a Draft Review Issue.
      title: Issue
      additionalProperties: false
    bytebase.v1.Issue.Approver:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Issue.Approver.Status'
          title: status
          description: The new status.
        principal:
          type: string
          title: principal
          description: 'Format: users/hello@world.com'
      title: Approver
      additionalProperties: false
      description: Approvers and their approval status for the issue.
    bytebase.v1.Issue.Approver.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - PENDING
        - APPROVED
        - REJECTED
      description: The approval status of an approver.
    bytebase.v1.Issue.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - DATABASE_CHANGE
        - ROLE_GRANT
        - ACCESS_GRANT
      description: The type of issue.
    bytebase.v1.IssueComment:
      type: object
      anyOf:
        - type: object
          properties:
            approval:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment.Approval'
              title: approval
              description: Approval event.
          title: approval
        - type: object
          properties:
            issueUpdate:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment.IssueUpdate'
              title: issue_update
              description: Issue update event.
          title: issue_update
        - type: object
          properties:
            planUpdate:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment.PlanUpdate'
              title: plan_update
              description: Plan update event.
          title: plan_update
        - type: object
          properties:
            reviewRunCompletion:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment.ReviewRunCompletion'
              title: review_run_completion
              description: Review run completion event.
          title: review_run_completion
        - type: object
          properties:
            reviewSubmission:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.IssueComment.ReviewSubmission'
              title: review_submission
              description: Review submission event.
          title: review_submission
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - approval
              - required:
                  - issueUpdate
              - required:
                  - planUpdate
              - required:
                  - reviewRunCompletion
              - required:
                  - reviewSubmission
          - not:
              oneOf:
                - required:
                    - approval
                - required:
                    - issueUpdate
                - required:
                    - planUpdate
                - required:
                    - reviewRunCompletion
                - required:
                    - reviewSubmission
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/issues/{issue}/issueComments/{issueComment-uid}'
        comment:
          type: string
          title: comment
          maxLength: 65536
          description: The text content of the comment.
        payload:
          type: string
          title: payload
          description: 'TODO: use struct message instead.'
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        creator:
          type: string
          title: creator
          description: 'Format: users/{email}'
          readOnly: true
        root:
          type:
            - string
            - "null"
          title: root
          description: |-
            (IMMUTABLE) The thread root's name, set only on replies. Immutable after creation.
             Format: projects/{project}/issues/{issue}/issueComments/{issueComment}
             Must name a thread root in the same issue, never a general comment or reply.
        threadState:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment.ThreadState'
            - type: "null"
          title: thread_state
          description: |-
            Present only on thread roots. Set OPEN on create to start a thread; an
             anchored root starts one without it. Omit root, thread_state, and
             statement_anchor to create a general comment.
             Update through the thread_state field mask to resolve or reopen.
             Adding a reply does not reopen a resolved thread.
        statementAnchor:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.StatementAnchor'
          title: statement_anchor
          description: |-
            (IMMUTABLE) Optional source context on a root or reply. A reply's anchor must share
             the root's spec and sheet_sha256 when created; it may narrow the range.
             Cannot be set on events. Immutable after creation, except that a later
             review run reporting a review result again moves the result to its
             statement in the SQL that run reviewed.
        reviewMetadata:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment.ReviewMetadata'
          title: review_metadata
          description: |-
            Present on review results, the comments the review executor posts.
             Never accepted on create or update.
          readOnly: true
      title: IssueComment
      description: A comment on an issue.
    bytebase.v1.IssueComment.Approval:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment.Approval.Status'
          title: status
          description: The approval status.
      title: Approval
      additionalProperties: false
      description: Approval event information.
    bytebase.v1.IssueComment.Approval.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - PENDING
        - APPROVED
        - REJECTED
      description: Approval status values.
    bytebase.v1.IssueComment.IssueUpdate:
      type: object
      properties:
        fromTitle:
          type:
            - string
            - "null"
          title: from_title
        toTitle:
          type:
            - string
            - "null"
          title: to_title
        fromDescription:
          type:
            - string
            - "null"
          title: from_description
        toDescription:
          type:
            - string
            - "null"
          title: to_description
        fromStatus:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
            - type: "null"
          title: from_status
        toStatus:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
            - type: "null"
          title: to_status
        fromLabels:
          type: array
          items:
            type: string
          title: from_labels
        toLabels:
          type: array
          items:
            type: string
          title: to_labels
      title: IssueUpdate
      additionalProperties: false
      description: Issue update event information.
    bytebase.v1.IssueComment.PlanUpdate:
      type: object
      properties:
        fromSpecs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan.Spec'
          title: from_specs
        toSpecs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan.Spec'
          title: to_specs
      title: PlanUpdate
      additionalProperties: false
      description: |-
        Plan update event information (snapshot of plan.config.specs before
         and after a PlanService.UpdatePlan call that mutated specs).
    bytebase.v1.IssueComment.ReviewMetadata:
      type: object
      properties:
        runType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewRun.Type'
          title: run_type
          description: The reviewer that posted the result.
        ruleType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewRuleType'
          title: rule_type
          description: The rule judged against. Set if and only if run_type is RULE.
        priority:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment.ReviewMetadata.Priority'
          title: priority
        targets:
          type: array
          items:
            type: string
          title: targets
          description: |-
            Every database the result applies to, sorted.
             Format: instances/{instance}/databases/{database}
        superseded:
          type: boolean
          title: superseded
          description: |-
            A later run of the same reviewer has completed without reporting the
             result again, whatever its thread state.
        attempt:
          type: string
          title: attempt
          format: int64
          description: |-
            The ReviewRunCompletion.attempt of the run that posted the result. A
             result a later run reports again keeps its thread and its attempt.
      title: ReviewMetadata
      additionalProperties: false
      description: What a review result carries beyond its text.
    bytebase.v1.IssueComment.ReviewMetadata.Priority:
      type: string
      title: Priority
      enum:
        - PRIORITY_UNSPECIFIED
        - P0
        - P1
        - P2
      description: |-
        Priority says what resolving the thread means. It has no bearing on
         blocking, which thread_state alone decides.
    bytebase.v1.IssueComment.ReviewRunCompletion:
      type: object
      properties:
        runType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewRun.Type'
          title: run_type
          description: The reviewer that ran.
        attempt:
          type: string
          title: attempt
          format: int64
          description: |-
            Identifies the run among its reviewer's runs on the issue. The results
             it posted carry the same ReviewMetadata.attempt.
        postedCount:
          type: integer
          title: posted_count
          format: int32
          description: Results the run posted as new threads.
        keptCount:
          type: integer
          title: kept_count
          format: int32
          description: Earlier results the run reported again, which kept their threads.
        supersededCount:
          type: integer
          title: superseded_count
          format: int32
          description: Earlier results the run no longer reports, now superseded.
      title: ReviewRunCompletion
      additionalProperties: false
      description: |-
        A review run completed, and what it did to the results of its reviewer.
         Posted by the reviewer, with no creator.
    bytebase.v1.IssueComment.ReviewSubmission:
      type: object
      title: ReviewSubmission
      additionalProperties: false
      description: Review submission event information.
    bytebase.v1.IssueComment.ThreadState:
      type: string
      title: ThreadState
      enum:
        - THREAD_STATE_UNSPECIFIED
        - OPEN
        - RESOLVED
    bytebase.v1.IssueStatus:
      type: string
      title: IssueStatus
      enum:
        - ISSUE_STATUS_UNSPECIFIED
        - OPEN
        - DONE
        - CANCELED
      description: |-
        The status of an issue.
         Lives at the top level so both plan_service.proto and issue_service.proto
         can reference it without a circular import.
    bytebase.v1.KerberosConfig:
      type: object
      properties:
        primary:
          type: string
          title: primary
          description: The primary component of the Kerberos principal.
        instance:
          type: string
          title: instance
          description: The instance component of the Kerberos principal.
        realm:
          type: string
          title: realm
          description: The Kerberos realm.
        keytab:
          type: string
          title: keytab
          format: byte
          description: The keytab file contents for authentication.
          writeOnly: true
        kdcHost:
          type: string
          title: kdc_host
          description: The hostname of the Key Distribution Center (KDC).
        kdcPort:
          type: string
          title: kdc_port
          description: The port of the Key Distribution Center (KDC).
        kdcTransportProtocol:
          type: string
          title: kdc_transport_protocol
          description: The transport protocol for KDC communication (tcp or udp).
      title: KerberosConfig
      additionalProperties: false
    bytebase.v1.LDAPIdentityProviderConfig:
      type: object
      properties:
        host:
          type: string
          title: host
          description: |-
            Host is the hostname or IP address of the LDAP server, e.g.,
             "ldap.example.com".
        port:
          type: integer
          title: port
          format: int32
          description: |-
            Port is the port number of the LDAP server, e.g., 389. When not set, the
             default port of the corresponding security protocol will be used, i.e. 389
             for StartTLS and 636 for LDAPS.
        skipTlsVerify:
          type: boolean
          title: skip_tls_verify
          description: SkipTLSVerify controls whether to skip TLS certificate verification.
        bindDn:
          type: string
          title: bind_dn
          description: |-
            BindDN is the DN of the user to bind as a service account to perform
             search requests.
        bindPassword:
          type: string
          title: bind_password
          description: BindPassword is the password of the user to bind as a service account.
        baseDn:
          type: string
          title: base_dn
          description: BaseDN is the base DN to search for users, e.g., "ou=users,dc=example,dc=com".
        userFilter:
          type: string
          title: user_filter
          description: UserFilter is the filter to search for users, e.g., "(uid=%s)".
        securityProtocol:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol'
          title: security_protocol
          description: |-
            SecurityProtocol is the security protocol to be used for establishing
             connections with the LDAP server.
        fieldMapping:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.FieldMapping'
          title: field_mapping
          description: |-
            FieldMapping is the mapping of the user attributes returned by the LDAP
             server.
      title: LDAPIdentityProviderConfig
      additionalProperties: false
      description: LDAPIdentityProviderConfig is the structure for LDAP identity provider config.
    bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol:
      type: string
      title: SecurityProtocol
      enum:
        - SECURITY_PROTOCOL_UNSPECIFIED
        - START_TLS
        - LDAPS
    bytebase.v1.LDAPIdentityProviderTestRequestContext:
      type: object
      properties:
        username:
          type: string
          title: username
          description: The username of a directory user, substituted into the user filter.
        password:
          type: string
          title: password
          description: The password of the directory user.
      title: LDAPIdentityProviderTestRequestContext
      additionalProperties: false
    bytebase.v1.Label:
      type: object
      properties:
        value:
          type: string
          title: value
          description: The label value/name.
        color:
          allOf:
            - $ref: '#/components/schemas/google.type.Color'
          title: color
          description: The label color.
        group:
          type: string
          title: group
          description: The group this label belongs to.
      title: Label
      additionalProperties: false
      description: A label for categorizing and organizing issues.
    bytebase.v1.LeaveWorkspaceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: workspaces/{workspace}'
      title: LeaveWorkspaceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.ListAccessGrantsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project of the access grants.
             Format: projects/{project}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: The maximum number of access grants to return.
        pageToken:
          type: string
          title: page_token
          description: A page token from a previous ListAccessGrants call.
        filter:
          type: string
          title: filter
          description: |-
            Filter expression using AIP-160 syntax.
             Supported fields:
             - name: the fullname in "projects/{project}/accessGrants/{access_grant}" format, support "==" operator.
             - creator: the creator name in "users/{email}" format, support "==" operator.
             - status: the access status, support "==" and "in" operator.
             - issue: the access issue fullname, support "==" operator.
             - expire_time: the access expire time in "2006-01-02T15:04:05Z07:00" format, support ">=", ">", "<=" and "<" operator.
             - create_time: the access creation time in "2006-01-02T15:04:05Z07:00" format, support ">=", ">", "<=" and "<" operator.
             - query: the access query, support "==" and ".contains(xx)" operator.
               Equality trims only boundary ASCII space, tab, LF, CR, vertical tab, and form feed.
             - query_hash: supports "==" with a lowercase hexadecimal SHA-256 digest of
               the UTF-8 query after the same boundary trim. Internal whitespace and Unicode
               remain unchanged.
             - schema: execution schema, supports "=="; empty matches only empty or absent values.
             - container: execution container, supports "=="; empty matches only empty or absent values.
             - target: the target database fullname, support "==" operator.
             - unmask: whether the grant allows unmasking sensitive data, support "==" operator with a boolean literal.
             - export: whether the grant allows exporting the query result, support "==" operator with a boolean literal.

             Examples:
             - creator == "users/dev@example.com"
             - status == "ACTIVE"
             - status in ["ACTIVE", "PENDING"]
             - creator == "users/dev@example.com" && status == "ACTIVE"
             - issue == "projects/x/issues/123"
             - status == "ACTIVE" && expire_time > "2024-02-01T00:00:00Z"
             - target == "instances/sample/databases/employee"
             - unmask == true
             - export == true && status == "ACTIVE"
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of access grants.
             Support creator, expire_time, create_time. The default sorting order is ascending.
             For example:
             - order_by = "creator"
             - order_by = "expire_time desc"
             - order_by = "expire_time asc, create_time desc"
      title: ListAccessGrantsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListAccessGrantsResponse:
      type: object
      properties:
        accessGrants:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AccessGrant'
          title: access_grants
          description: The access grants from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListAccessGrantsResponse
      additionalProperties: false
    bytebase.v1.ListChangelogsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent of the changelogs.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of changelogs to return. The service may return fewer
             than this value. If unspecified, at most 10 changelogs will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from the previous call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided must match
             the call that provided the page token.
        view:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ChangelogView'
          title: view
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter changelogs returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - status: the changelog status, support "==" operation. check Changelog.Status for available values.
             - has_schema_snapshot: filters to changelogs with a schema snapshot; only "has_schema_snapshot == true" is supported.
             - create_time: the changelog create time in RFC 3339 format, supports ">=", "<=", or "<" operator.

             Example:
             status == "DONE"
             status == "FAILED"
             has_schema_snapshot == true && create_time < "2024-01-02T00:00:00Z"
      title: ListChangelogsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListChangelogsResponse:
      type: object
      properties:
        changelogs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Changelog'
          title: changelogs
          description: The list of changelogs.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListChangelogsResponse
      additionalProperties: false
    bytebase.v1.ListDatabaseGroupsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource whose database groups are to be listed.
             Format: projects/{project}
        view:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
          title: view
          description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
      title: ListDatabaseGroupsRequest
      required:
        - parent
      additionalProperties: false
      description: Request message for listing database groups.
    bytebase.v1.ListDatabaseGroupsResponse:
      type: object
      properties:
        databaseGroups:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
          title: database_groups
          description: The database groups from the specified request.
      title: ListDatabaseGroupsResponse
      additionalProperties: false
      description: Response message for listing database groups.
    bytebase.v1.ListDatabasesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            - projects/{project}: list databases in a project, require "bb.databases.list" permission.
             - workspaces/{id}: list databases in the workspace, require "bb.databases.list" permission.
             - instances/{instance}: list databases in an instance, require "bb.instances.get" permission.
             - projects/{project}/instances/{instance}: list databases in a project instance, require "bb.instances.get" permission.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListDatabases` must
             match the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter databases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - name: the database name, support ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
             - table: filter by the database table, support "==" and ".contains()" operator.
             - labels.{key}: the database label, support "==" and "in" operators.

             For example:
             environment == "environments/{environment resource id}"
             environment == "" (find databases which environment is not set)
             project == "projects/{project resource id}"
             instance == "instances/{instance resource id}"
             instance == "projects/{project resource id}/instances/{instance resource id}"
             name.contains("database name")
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             exclude_unassigned == true
             table == "sample"
             table.contains("sam")
             labels.environment == "production"
             labels.region == "asia"
             labels.region in ["asia", "europe"]

             You can combine filter conditions like:
             environment == "environments/prod" && name.contains("employee")
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted database if specified.
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of databases.
             Support name, project, instance. The default sorting order is ascending.
             For example:
             - order_by = "name" - order by name ascending
             - order_by = "name desc"
             - order_by = "name desc, project asc"
      title: ListDatabasesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListDatabasesResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Database'
          title: databases
          description: The databases from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListDatabasesResponse
      additionalProperties: false
    bytebase.v1.ListGroupsRequest:
      type: object
      properties:
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of groups to return. The service may return fewer than
             this value.
             If unspecified, at most 10 groups will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListGroups` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListGroups` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter groups returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - title: the group title, support "==" and ".contains()" operator.
             - email: the group email, support "==" and ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.

             For example:
             title == "dba"
             email == "dba@bytebase.com"
             title.contains("dba")
             email.contains("dba")
             project == "projects/sample-project"
             You can combine filter conditions like:
             title.contains("dba") || email.contains("dba")
      title: ListGroupsRequest
      additionalProperties: false
      description: Request message for listing groups.
    bytebase.v1.ListGroupsResponse:
      type: object
      properties:
        groups:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Group'
          title: groups
          description: The groups from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListGroupsResponse
      additionalProperties: false
      description: Response message for listing groups.
    bytebase.v1.ListIdentityProvidersRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          pattern: ^workspaces/[^/]+$
          description: |-
            The parent workspace whose identity providers should be listed. It must be
             the workspace the caller's credential belongs to.
             Format: workspaces/{workspace}
      title: ListIdentityProvidersRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListIdentityProvidersResponse:
      type: object
      properties:
        identityProviders:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
          title: identity_providers
          description: The identity providers from the specified request.
      title: ListIdentityProvidersResponse
      additionalProperties: false
    bytebase.v1.ListInstanceDatabaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        instance:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.Instance'
            - type: "null"
          title: instance
          description: The target instance. We need to set this field if the target instance is not created yet.
      title: ListInstanceDatabaseRequest
      required:
        - name
        - instance
      additionalProperties: false
    bytebase.v1.ListInstanceDatabaseResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            type: string
          title: databases
          description: All database name list in the instance.
      title: ListInstanceDatabaseResponse
      additionalProperties: false
    bytebase.v1.ListInstanceRolesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of roles.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            Not used.
             The maximum number of roles to return. The service may return fewer than
             this value.
             If unspecified, at most 10 roles will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            Not used.
             A page token, received from a previous `ListInstanceRoles` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstanceRoles` must match
             the call that provided the page token.
        refresh:
          type: boolean
          title: refresh
          description: Refresh will refresh and return the latest data.
      title: ListInstanceRolesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListInstanceRolesResponse:
      type: object
      properties:
        roles:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.InstanceRole'
          title: roles
          description: The roles from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListInstanceRolesResponse
      additionalProperties: false
    bytebase.v1.ListInstancesRequest:
      type: object
      properties:
        parent:
          type:
            - string
            - "null"
          title: parent
          description: |-
            The parent, which owns this collection of instances.
             Format: projects/{project}. If omitted, only workspace instances are
             returned. Wildcard project parents are not supported. When set, the
             `project` filter must be omitted or match this parent.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of instances to return. The service may return fewer than
             this value.
             If unspecified, at most 10 instances will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListInstances` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListInstances` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted instances if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter the instance.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - name: the instance name, support "==" and ".contains()" operator.
             - resource_id: the instance id, support "==" and ".contains()" operator.
             - environment: the environment full name in "environments/{id}" format, support "==" operator.
             - state: the instance state, check State enum for values, support "==" operator.
             - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
             - host: the instance host, support "==" and ".contains()" operator.
             - port: the instance port, support "==" and ".contains()" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - labels.{key}: the instance label, support "==" and "in" operators.

             For example:
             name == "sample instance"
             name.contains("sample")
             resource_id == "sample-instance"
             resource_id.contains("sample")
             state == "DELETED"
             environment == "environments/test"
             environment == "" (find instances which environment is not set)
             engine == "MYSQL"
             engine in ["MYSQL", "POSTGRES"]
             !(engine in ["MYSQL", "POSTGRES"])
             host == "127.0.0.1"
             host.contains("127.0")
             port == "54321"
             port.contains("543")
             labels.org_group == "infrastructure"
             labels.environment in ["prod", "production"]
             project == "projects/sample-project"
             You can combine filter conditions like:
             name.contains("sample") && environment == "environments/test"
             host == "127.0.0.1" && port == "54321"
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of instances.
             Support title, environment. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title desc, environment asc"
      title: ListInstancesRequest
      additionalProperties: false
    bytebase.v1.ListInstancesResponse:
      type: object
      properties:
        instances:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Instance'
          title: instances
          description: The instances from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListInstancesResponse
      additionalProperties: false
    bytebase.v1.ListIssueCommentsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{projects}/issues/{issue}'
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of issue comments to return. The service may return fewer than
             this value.
             If unspecified, at most 10 issue comments will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListIssueComments` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListIssueComments` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            CEL filter over events, root comments, and replies.
             Supported: root == null, root == "<comment name>", or root in ["<comment name>", ...].
             Root names must belong to parent. Empty and root == null return the
             timeline (events and root comments); other filters return replies only.
      title: ListIssueCommentsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListIssueCommentsResponse:
      type: object
      properties:
        issueComments:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.IssueComment'
          title: issue_comments
          description: The issue comments from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListIssueCommentsResponse
      additionalProperties: false
    bytebase.v1.ListIssuesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of issues.
             Format: projects/{project}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of issues to return. The service may return fewer than
             this value.
             If unspecified, at most 10 issues will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListIssues` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListIssues` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter issues returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
             - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
             - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
             - labels: the issue labels, support "==" and "in" operator.
             - risk_level: the issue risk level, support "in" operator, check the RiskLevel enum for the values.
             - approval_status: issue approval status, support "==" operator.
             - current_approver: the issue approver, should in "users/{email} format", support "==" operator.

             For example:
             creator == "users/ed@bytebase.com" && status in ["OPEN", "DONE"]
             status == "CANCELED" && type == "DATABASE_CHANGE"
             labels in ["label1", "label2"]
             risk_level in ["HIGH", "MODERATE"]
             create_time >= "2025-01-02T15:04:05Z07:00"
        query:
          type: string
          title: query
          description: Query is the query statement.
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of issues.
             Support:
             - create_time
             - update_time
             The default sorting order is ascending.
             For example:
             - order_by = "create_time desc"
             - order_by = "update_time asc"
      title: ListIssuesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListIssuesResponse:
      type: object
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Issue'
          title: issues
          description: The issues from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListIssuesResponse
      additionalProperties: false
    bytebase.v1.ListPlansRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of plans.
             Format: projects/{project}
             Use "projects/-" to list all plans from all projects.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of plans to return. The service may return fewer than
             this value.
             If unspecified, at most 10 plans will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListPlans` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListPlans` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter plans returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
             - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
             - title: the plan title, support "==" operator for exact match and ".contains()" operator for case-insensitive substring match.
             - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config" or "change_database_config".
             - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
             - has_release: whether a spec references a release, support "==" operator, the value should be "true" or "false".
             - release: the release a spec references, in "projects/{project}/releases/{release}" format, support "==" operator.
             - task_status: the current status of any task in the plan, support "in" operator, the values should be Task.Status values except STATUS_UNSPECIFIED.

             For example:
             creator == "users/ed@bytebase.com" && create_time >= "2025-01-02T15:04:05Z07:00"
             title == "My Plan"
             title.contains("database migration")
             spec_type == "change_database_config"
             state == "ACTIVE"
             has_release == true && task_status in ["FAILED", "RUNNING"]
             release == "projects/my-project/releases/release_20260115-RC00"
      title: ListPlansRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListPlansResponse:
      type: object
      properties:
        plans:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan'
          title: plans
          description: The plans from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListPlansResponse
      additionalProperties: false
    bytebase.v1.ListPoliciesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of policies.
             Format: {resource type}/{resource id}
        policyType:
          oneOf:
            - $ref: '#/components/schemas/bytebase.v1.PolicyType'
            - type: "null"
          title: policy_type
          description: Filter by specific policy type.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted policies if specified.
      title: ListPoliciesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListPoliciesResponse:
      type: object
      properties:
        policies:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Policy'
          title: policies
          description: The policies from the specified request.
      title: ListPoliciesResponse
      additionalProperties: false
    bytebase.v1.ListProjectsRequest:
      type: object
      properties:
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of projects to return. The service may return fewer than
             this value.
             If unspecified, at most 10 projects will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListProjects` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListProjects` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted projects if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter the project.
             Check filter for SearchProjectsRequest for details.
             Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of projects.
             Support title. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title asc"
      title: ListProjectsRequest
      additionalProperties: false
    bytebase.v1.ListProjectsResponse:
      type: object
      properties:
        projects:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Project'
          title: projects
          description: The projects from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListProjectsResponse
      additionalProperties: false
    bytebase.v1.ListPurchasePlansRequest:
      type: object
      title: ListPurchasePlansRequest
      additionalProperties: false
    bytebase.v1.ListPurchasePlansResponse:
      type: object
      properties:
        plans:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PurchasePlan'
          title: plans
      title: ListPurchasePlansResponse
      additionalProperties: false
    bytebase.v1.ListQueryHistoriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project whose query histories are listed.
             Format: projects/{project}
             Use "projects/-" to list query histories across all projects
             (https://google.aip.dev/159); this requires the bb.queryHistories.list
             permission on the workspace.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of histories to return.
             The service may return fewer than this value.
             If unspecified, at most 10 history entries will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListQueryHistories` call.
             Provide this to retrieve the subsequent page.
        filter:
          type: string
          title: filter
          description: |-
            Filter is the filter to apply on the list query histories.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - creator: the user full name in "users/{email}" format, support "==" operator.

             For example:
             creator == "users/{email}"
      title: ListQueryHistoriesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListQueryHistoriesResponse:
      type: object
      properties:
        queryHistories:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryHistory'
          title: query_histories
          description: The list of query histories.
          readOnly: true
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token to retrieve next page of history.
             Pass this value in the page_token field in the subsequent call to
             `ListQueryHistories` method to retrieve the next page of history.
      title: ListQueryHistoriesResponse
      additionalProperties: false
    bytebase.v1.ListReleaseCategoriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
      title: ListReleaseCategoriesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListReleaseCategoriesResponse:
      type: object
      properties:
        categories:
          type: array
          items:
            type: string
          title: categories
          description: The unique category values in the project.
      title: ListReleaseCategoriesResponse
      additionalProperties: false
    bytebase.v1.ListReleasesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of releases to return. The service may return fewer than this value.
             If unspecified, at most 10 releases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListReleases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListReleases` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted releases if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter releases returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - category: release category, support "==" operator.

             For example:
             category == "webapp"
      title: ListReleasesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListReleasesResponse:
      type: object
      properties:
        releases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Release'
          title: releases
          description: The releases from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListReleasesResponse
      additionalProperties: false
    bytebase.v1.ListReviewConfigsRequest:
      type: object
      title: ListReviewConfigsRequest
      additionalProperties: false
    bytebase.v1.ListReviewConfigsResponse:
      type: object
      properties:
        reviewConfigs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
          title: review_configs
          description: The SQL review configs from the specified request.
      title: ListReviewConfigsResponse
      additionalProperties: false
    bytebase.v1.ListRevisionsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent of the revisions.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of revisions to return. The service may return fewer
             than this value. If unspecified, at most 10 revisions will be returned. The
             maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListRevisions` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListRevisions` must
             match the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Whether to include deleted revisions in the results.
      title: ListRevisionsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListRevisionsResponse:
      type: object
      properties:
        revisions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Revision'
          title: revisions
          description: The revisions from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListRevisionsResponse
      additionalProperties: false
    bytebase.v1.ListRolesRequest:
      type: object
      title: ListRolesRequest
      additionalProperties: false
    bytebase.v1.ListRolesResponse:
      type: object
      properties:
        roles:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Role'
          title: roles
          description: The roles from the specified request.
      title: ListRolesResponse
      additionalProperties: false
    bytebase.v1.ListRolloutsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of rollouts.
             Format: projects/{project}
             Use "projects/-" to list all rollouts from all projects.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of rollouts to return. The service may return fewer than
             this value.
             If unspecified, at most 10 rollouts will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListRollouts` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListRollouts` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter rollouts returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
             - task_type: the task type, support "in" operator, check the Task.Type enum for the values.

             For example:
             update_time >= "2025-01-02T15:04:05Z07:00"
             task_type in ["DATABASE_MIGRATE", "DATABASE_CREATE"]
      title: ListRolloutsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListRolloutsResponse:
      type: object
      properties:
        rollouts:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Rollout'
          title: rollouts
          description: The rollouts from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListRolloutsResponse
      additionalProperties: false
    bytebase.v1.ListSavedQueriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The project to list saved queries in, or "projects/-" for every project.
             Format: projects/{project}
        filter:
          type: string
          title: filter
          description: |-
            Filter the result, in CEL. See https://github.com/google/cel-spec

             Supported fields:
             - creator: the creator in "users/{email}" format. Supports "==" and "!=".

             For example:
             creator == "users/alice@example.com"
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of saved queries to return. The service may return
             fewer. Defaults to 10; values above 1000 are coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token from a previous ListSavedQueries call. Keep every other
             parameter the same as the call that returned it.
        orderBy:
          type: string
          title: order_by
          description: |-
            Sort the results, per https://google.aip.dev/132#ordering. Supported
             fields: `update_time`, `create_time`, `title`; append " desc" for
             descending, e.g. "update_time desc" for most recently modified first.
             A modification is a title, content, database, or folder write; sharing
             and stars do not count, and a never-modified saved query counts its
             create time. Empty means `title` ascending. `resource_id` is always
             appended as a final tiebreak so pages stay stable.
      title: ListSavedQueriesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListSavedQueriesResponse:
      type: object
      properties:
        savedQueries:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SavedQuery'
          title: saved_queries
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            Pass to the next ListSavedQueries call to fetch the following page. Empty
             on the last page.
      title: ListSavedQueriesResponse
      additionalProperties: false
    bytebase.v1.ListServiceAccountsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource.
             Format: projects/{project} for project-level, workspaces/{id} for workspace-level.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of service accounts to return. The service may return fewer than
             this value.
             If unspecified, at most 10 service accounts will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListServiceAccounts` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListServiceAccounts` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted service accounts if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter service accounts returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the service account name, support "==" and ".contains()" operator.
             - email: the service account email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@service.bytebase.com"
             email.contains("ed")
      title: ListServiceAccountsRequest
      additionalProperties: false
      description: Request message for listing service accounts.
    bytebase.v1.ListServiceAccountsResponse:
      type: object
      properties:
        serviceAccounts:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
          title: service_accounts
          description: The service accounts from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListServiceAccountsResponse
      additionalProperties: false
      description: Response message for listing service accounts.
    bytebase.v1.ListSettingsRequest:
      type: object
      title: ListSettingsRequest
      additionalProperties: false
    bytebase.v1.ListSettingsResponse:
      type: object
      properties:
        settings:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Setting'
          title: settings
          description: The settings from the specified request.
      title: ListSettingsResponse
      additionalProperties: false
    bytebase.v1.ListTaskRunsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of taskRuns.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
             Use "projects/{project}/plans/{plan}/rollout/stages/-/tasks/-" to list all taskRuns from a rollout.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of task runs to return. The service may return fewer
             than this value.
             If unspecified, at most 1000 task runs will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListTaskRuns` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListTaskRuns` must match
             the call that provided the page token.
      title: ListTaskRunsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.ListTaskRunsResponse:
      type: object
      properties:
        taskRuns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskRun'
          title: task_runs
          description: The taskRuns from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListTaskRunsResponse
      additionalProperties: false
    bytebase.v1.ListUsersRequest:
      type: object
      properties:
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of users to return. The service may return fewer than
             this value.
             If unspecified, at most 10 users will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListUsers` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListUsers` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted users if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter users returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the user name, support "==" and ".contains()" operator.
             - email: the user email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.
             - project: the project full name in "projects/{id}" format, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             email == "ed@bytebase.com"
             email.contains("ed")
             state == "DELETED"
             project == "projects/sample-project"
             You can combine filter conditions like:
             name.contains("ed") && project == "projects/sample-project"
             (name == "ed" || email == "ed@bytebase.com") && project == "projects/sample-project"
      title: ListUsersRequest
      additionalProperties: false
    bytebase.v1.ListUsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.User'
          title: users
          description: The users from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListUsersResponse
      additionalProperties: false
    bytebase.v1.ListWorkloadIdentitiesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent resource.
             Format: projects/{project} for project-level, workspaces/{id} for workspace-level.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of workload identities to return. The service may return fewer than
             this value.
             If unspecified, at most 10 workload identities will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListWorkloadIdentities` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `ListWorkloadIdentities` must match
             the call that provided the page token.
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted workload identities if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter workload identities returned in the list.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - name: the workload identity name, support "==" and ".contains()" operator.
             - email: the workload identity email, support "==" and ".contains()" operator.
             - state: check State enum for values, support "==" operator.

             For example:
             name == "ed"
             name.contains("ed")
             state == "DELETED"
             email == "ed@workload.bytebase.com"
             email.contains("ed")
      title: ListWorkloadIdentitiesRequest
      additionalProperties: false
      description: Request message for listing workload identities.
    bytebase.v1.ListWorkloadIdentitiesResponse:
      type: object
      properties:
        workloadIdentities:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
          title: workload_identities
          description: The workload identities from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: ListWorkloadIdentitiesResponse
      additionalProperties: false
      description: Response message for listing workload identities.
    bytebase.v1.ListWorkspacesRequest:
      type: object
      title: ListWorkspacesRequest
      additionalProperties: false
    bytebase.v1.ListWorkspacesResponse:
      type: object
      properties:
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Workspace'
          title: workspaces
      title: ListWorkspacesResponse
      additionalProperties: false
    bytebase.v1.LoginIdentityProvider:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the identity provider.
             Format: idps/{idp}
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProviderType'
          title: type
          description: The type of identity provider protocol.
        title:
          type: string
          title: title
          description: The display title of the identity provider.
        authorizationRequest:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.AuthorizationRequest'
          title: authorization_request
          description: |-
            The parameters the browser needs to start the authorization redirect.
             Set for OAUTH2 and OIDC, absent for LDAP, whose bind happens server-side.
      title: LoginIdentityProvider
      additionalProperties: false
      description: |-
        LoginIdentityProvider is an identity provider as the login page sees it.
         Deliberately not a view of IdentityProvider: this message is served without
         a credential, so every field it exposes is published by hand and no
         provider configuration reaches it by default.
    bytebase.v1.LoginRequest:
      type: object
      properties:
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            User's email address.
             Bounded so an oversized identity is refused at the edge before any
             handler runs; the login-attempt lockout keys rows by this value.
        password:
          type: string
          title: password
          description: |
            User's password for authentication. Bounded for abuse only: LDAP
             directories may accept passwords beyond bcrypt's 72-byte limit, and the
             local-password path rejects longer inputs itself.
            string.max_bytes = 512
        web:
          type: boolean
          title: web
          description: |-
            If true, sets access token and refresh token as HTTP-only cookies instead of
             returning the token in the response body. Use for browser-based clients.
        idpName:
          type: string
          title: idp_name
          maxLength: 256
          description: |-
            The name of the identity provider.
             Format: idps/{idp}
        idpContext:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProviderContext'
          title: idp_context
          description: The idp_context is used to get the user information from identity provider.
        otpCode:
          type:
            - string
            - "null"
          title: otp_code
          maxLength: 64
          description: The otp_code is used to verify the user's identity by MFA.
        recoveryCode:
          type:
            - string
            - "null"
          title: recovery_code
          maxLength: 64
          description: The recovery_code is used to recovery the user's identity with MFA.
        mfaTempToken:
          type:
            - string
            - "null"
          title: mfa_temp_token
          maxLength: 4096
          description: The mfa_temp_token is used to verify the user's identity by MFA.
        emailCode:
          type:
            - string
            - "null"
          title: email_code
          maxLength: 64
          description: |-
            6-digit code from email for passwordless login/signup.
             Pairs with `email`. Mutually exclusive with `password` and `idp_name`.
        workspace:
          type:
            - string
            - "null"
          title: workspace
          maxLength: 256
          description: |-
            Preferred workspace to land in after login. If the user is a member of this
             workspace, the token is issued for it; otherwise falls back to the default
             resolution (last login workspace → first membership). Typically populated
             from the ?workspace= query parameter in invite links.
             Format: workspaces/{workspace}
      title: LoginRequest
      additionalProperties: false
    bytebase.v1.LoginResponse:
      type: object
      properties:
        token:
          type: string
          title: token
          description: |-
            Access token for authenticated requests.
             Only returned when web=false. For web=true, the token is set as an HTTP-only cookie.
        mfaTempToken:
          type:
            - string
            - "null"
          title: mfa_temp_token
          description: Temporary token for MFA verification.
        requireResetPassword:
          type: boolean
          title: require_reset_password
          description: Whether user must reset password before continuing.
        user:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.User'
          title: user
          description: The user from the successful login.
      title: LoginResponse
      additionalProperties: false
    bytebase.v1.LogoutRequest:
      type: object
      title: LogoutRequest
      additionalProperties: false
      description: Request to logout current user session.
    bytebase.v1.MCPDelegation:
      type: object
      properties:
        scope:
          type: string
          title: scope
          description: |-
            The OAuth2 grant's consented scope, e.g. "mcp:read-only".
             Empty when the grant recorded no scope.
        resource:
          type: string
          title: resource
          description: |-
            The grant's stored MCP resource URI.
             Empty for pre-grant legacy sessions.
        clientId:
          type: string
          title: client_id
          description: |-
            The OAuth2 client the grant was consented to.
             Empty for legacy web-session tokens at /mcp.
        correlationId:
          type: string
          title: correlation_id
          description: |-
            Correlates the audit rows an MCP session produces. Minted at the /mcp
             boundary and session-scoped: the MCP SDK hands tool handlers the
             initialize-time context, so one MCP session carries one correlation ID
             across all of its tool calls.
      title: MCPDelegation
      additionalProperties: false
      description: |-
        Provenance of a call that reached the API through the MCP (Model Context
         Protocol) server's delegated credential. The values are copied verbatim from
         the verified credential's grant state; empty fields record that the grant
         stored nothing (legacy sessions), never a resolved or synthesized value.
    bytebase.v1.MCPDenialReason:
      type: string
      title: MCPDenialReason
      enum:
        - MCP_DENIAL_REASON_UNSPECIFIED
        - MINTS_CREDENTIAL
        - RESETS_CREDENTIAL
        - TAKES_OVER_ACCOUNT
        - ENDS_SESSION
        - ENDS_MEMBERSHIP
        - MINTS_CREDENTIAL_FOR_OTHERS
        - REWRITES_SESSION_BOUNDARY
        - DRIVES_THE_APPROVAL_DECISION
        - ADMINISTERS_THE_WORKSPACE
        - READS_OTHER_USERS_SQL
        - OPENS_AN_ADMIN_CONNECTION
        - SENDS_DATA_TO_A_THIRD_PARTY
        - RETURNS_A_STORED_SECRET
        - REDRAWS_GOVERNANCE_BOUNDARY
      description: |-
        Why an MCP session may not call an RPC. The mechanism, not the wording: each
         value names what its methods actually do, and the serving side turns that
         into a sentence. A denial whose stated reason has drifted from the mechanism
         is worse than a bare refusal, because it is the thing the next reader trusts
         — so a method changing what it does changes its reason here.

         One enum covers both refused classes, and every value belongs to exactly one
         of them: values 1-8 name a mechanism that breaks the MCP boundary, which is
         what FORBIDDEN means, and values 9-14 name a scope decision this phase took,
         which is what EXCLUDED means. The distinction is real and lives on the class
         annotation — a FORBIDDEN mechanism is a durable never, an EXCLUDED scope
         decision is what a future admin-capable ceiling would argue with, one
         population at a time. Splitting it across two enums as well only made the
         nonsense states representable: a method could carry both, or carry the kind
         that contradicts its class. Neither is expressible now, and the one check
         left — the reason belongs to the class it is used on — is a table the gate
         already keeps for the wording.
    bytebase.v1.MCPMethodClass:
      type: string
      title: MCPMethodClass
      enum:
        - MCP_METHOD_CLASS_UNSPECIFIED
        - READ
        - WRITE
        - FORBIDDEN
        - EXCLUDED
      description: |-
        Classification of an RPC for MCP (AI agent) sessions. The effective
         authorization of an MCP session is this classification intersected with the
         caller's own RBAC: it can only ever narrow what the human could do, never
         widen it.
         Every value is enforced, at the gate on the internal MCP chain. READ and
         WRITE are the serving classes the workspace's MCP capability ceiling selects
         between, EXCLUDED and FORBIDDEN are served by no ceiling, and an unclassified
         method is refused rather than served. Annotating a method is therefore a
         change to what an MCP session can reach, taking effect on the next request.
         READ and WRITE methods are also disclosed to workspace admins, as capability
         rows on the Access policy page, so annotating a method changes what the
         product promises as well as what it serves.
    bytebase.v1.MCPSetting:
      type: object
      properties:
        capability:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.MCPSetting.Capability'
          title: capability
          description: |-
            The maximum capability available to MCP sessions in this workspace, acting
             as an admin-set ceiling. Enforced server-side at three points: the /mcp
             endpoint decides whether a connection is admitted at all, the ceiling gate
             on the internal MCP chain decides, per request, which method classes are
             served, and under READ_ONLY the SQL clamp decides, per statement, whether
             it only reads.
      title: MCPSetting
      additionalProperties: false
      description: |-
        MCPSetting is what an MCP (Model Context Protocol) session may do in this
         workspace.
    bytebase.v1.MCPSetting.Capability:
      type: string
      title: Capability
      enum:
        - CAPABILITY_UNSPECIFIED
        - DISABLED
        - READ_ONLY
        - READ_WRITE
      description: |-
        Capability is the ceiling: a session runs at this level or lower.
         Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving
         value.mcp.capability out of the update mask, is rejected.
    bytebase.v1.MaskingExemptionPolicy:
      type: object
      properties:
        exemptions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.MaskingExemptionPolicy.Exemption'
          title: exemptions
      title: MaskingExemptionPolicy
      additionalProperties: false
      description: MaskingExemptionPolicy is the allowlist of users who can access sensitive data.
    bytebase.v1.MaskingExemptionPolicy.Exemption:
      type: object
      properties:
        members:
          type: array
          items:
            type: string
          title: members
          description: |-
            Specifies the principals who are exempt from masking.
             For users, the member should be: user:{email}
             For groups, the member should be: group:{email}
             For service accounts, the member should be: serviceAccount:{email}
             For workload identities, the member should be: workloadIdentity:{email}
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: |-
            The condition that is associated with this exception policy instance.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
             If the condition is empty, means the user can access all databases without expiration.

             Support variables:
             resource.instance_id: the instance resource id. Only support "==" operation.
             resource.database_name: the database name. Only support "==" operation.
             resource.schema_name: the schema name. Only support "==" operation.
             resource.table_name: the table name. Only support "==" operation.
             resource.column_name: the column name. Only support "==" operation.
             request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`
             All variables should join with "&&" condition.

             For example:
             resource.instance_id == "local" && resource.database_name == "employee" && request.time < timestamp("2025-04-30T11:10:39.000Z")
             resource.instance_id == "local" && resource.database_name == "employee"
      title: Exemption
      additionalProperties: false
    bytebase.v1.MaskingReason:
      type: object
      properties:
        semanticTypeId:
          type: string
          title: semantic_type_id
          description: The semantic type that triggered masking (e.g., "SSN", "email", "phone").
        semanticTypeTitle:
          type: string
          title: semantic_type_title
          description: Human-readable semantic type title.
        maskingRuleId:
          type: string
          title: masking_rule_id
          description: The masking rule ID that matched (if applicable).
        algorithm:
          type: string
          title: algorithm
          description: The masking algorithm used.
        context:
          type: string
          title: context
          description: 'Additional context (e.g., "Matched global rule: PII Protection").'
        classificationLevel:
          type: integer
          title: classification_level
          format: int32
          description: The classification level that triggered masking.
        semanticTypeIcon:
          type: string
          title: semantic_type_icon
          description: Icon associated with the semantic type (if any).
      title: MaskingReason
      additionalProperties: false
    bytebase.v1.MaskingRulePolicy:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.MaskingRulePolicy.MaskingRule'
          title: rules
          description: The list of masking rules.
      title: MaskingRulePolicy
      additionalProperties: false
      description: Policy for configuring data masking rules.
    bytebase.v1.MaskingRulePolicy.MaskingRule:
      type: object
      properties:
        id:
          type: string
          title: id
          description: A unique identifier for the rule in UUID format.
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: |-
            The condition for the masking rule.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Support variables:
             resource.environment_id: the environment resource id.
             resource.project_id: the project resource id.
             resource.instance_id: the instance resource id.
             resource.database_name: the database name.
             resource.table_name: the table name.
             resource.column_name: the column name.
             resource.classification_level: the classification level (integer).

             Each variable support following operations:
             ==: the value equals the target.
             !=: the value not equals the target.
             in: the value matches one of the targets.
             !(in): the value not matches any of the targets.
             <, <=, >, >=: numeric comparison (classification_level only).

             For example:
             resource.environment_id == "test" && resource.project_id == "sample-project"
             resource.instance_id == "sample-instance" && resource.database_name == "employee" && resource.table_name in ["table1", "table2"]
             resource.environment_id != "test" || !(resource.project_id in ["poject1", "prject2"])
             resource.instance_id == "sample-instance" && (resource.database_name == "db1" || resource.database_name == "db2")
        semanticType:
          type: string
          title: semantic_type
          description: The semantic type of data to mask (e.g., "SSN", "EMAIL").
      title: MaskingRule
      additionalProperties: false
      description: A rule that defines when and how to mask data.
    bytebase.v1.MaterializedViewMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a materialized view.
        definition:
          type: string
          title: definition
          description: The definition is the definition of a materialized view.
        comment:
          type: string
          title: comment
          description: The comment is the comment of a materialized view.
        dependencyColumns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DependencyColumn'
          title: dependency_columns
          description: |-
            The dependency_columns is the list of dependency columns of a materialized
             view.
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
          title: triggers
          description: The columns is the ordered list of columns in a table.
        indexes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
          title: indexes
          description: The indexes is the list of indexes in a table.
        skipDump:
          type: boolean
          title: skip_dump
      title: MaterializedViewMetadata
      additionalProperties: false
      description: MaterializedViewMetadata is the metadata for materialized views.
    bytebase.v1.MoveMySavedQueriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        sourceFolder:
          type: string
          title: source_folder
          maxLength: 256
          minLength: 1
          description: The folder to move, descendants included, e.g. "a/b".
        targetFolder:
          type: string
          title: target_folder
          maxLength: 256
          description: |-
            Where it lands. A path like "a/b/c"; empty drops the `source_folder`
             prefix, promoting the folder's contents toward the root.
      title: MoveMySavedQueriesRequest
      required:
        - parent
        - sourceFolder
      additionalProperties: false
    bytebase.v1.MoveMySavedQueriesResponse:
      type: object
      properties:
        movedCount:
          type: integer
          title: moved_count
          format: int32
          description: How many moved.
      title: MoveMySavedQueriesResponse
      additionalProperties: false
    bytebase.v1.OAuth2AuthStyle:
      type: string
      title: OAuth2AuthStyle
      enum:
        - OAUTH2_AUTH_STYLE_UNSPECIFIED
        - IN_PARAMS
        - IN_HEADER
    bytebase.v1.OAuth2IdentityProviderConfig:
      type: object
      properties:
        authUrl:
          type: string
          title: auth_url
          description: The authorization endpoint URL for OAuth2 flow.
        tokenUrl:
          type: string
          title: token_url
          description: The token endpoint URL for exchanging authorization code.
        userInfoUrl:
          type: string
          title: user_info_url
          description: The user information endpoint URL.
        clientId:
          type: string
          title: client_id
          description: The OAuth2 client identifier.
        clientSecret:
          type: string
          title: client_secret
          description: The OAuth2 client secret for authentication.
        scopes:
          type: array
          items:
            type: string
          title: scopes
          description: The list of OAuth2 scopes to request.
        fieldMapping:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.FieldMapping'
          title: field_mapping
          description: Mapping configuration for user attributes from OAuth2 response.
        skipTlsVerify:
          type: boolean
          title: skip_tls_verify
          description: Whether to skip TLS certificate verification.
        authStyle:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.OAuth2AuthStyle'
          title: auth_style
          description: The authentication style for client credentials.
      title: OAuth2IdentityProviderConfig
      additionalProperties: false
      description: OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.
    bytebase.v1.OAuth2IdentityProviderContext:
      type: object
      properties:
        code:
          type: string
          title: code
          maxLength: 4096
          description: Authorization code from OAuth2 provider.
      title: OAuth2IdentityProviderContext
      additionalProperties: false
      description: OAuth2 authentication context.
    bytebase.v1.OAuth2IdentityProviderTestRequestContext:
      type: object
      properties:
        code:
          type: string
          title: code
          description: Authorize code from website.
      title: OAuth2IdentityProviderTestRequestContext
      additionalProperties: false
    bytebase.v1.OIDCIdentityProviderConfig:
      type: object
      properties:
        issuer:
          type: string
          title: issuer
          description: The OIDC issuer URL for the identity provider.
        clientId:
          type: string
          title: client_id
          description: The OIDC client identifier.
        clientSecret:
          type: string
          title: client_secret
          description: The OIDC client secret for authentication.
        scopes:
          type: array
          items:
            type: string
          title: scopes
          description: |-
            The scopes that the OIDC provider supports.
             Should be fetched from the well-known configuration file of the OIDC provider.
        fieldMapping:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.FieldMapping'
          title: field_mapping
          description: Mapping configuration for user attributes from OIDC claims.
        skipTlsVerify:
          type: boolean
          title: skip_tls_verify
          description: Whether to skip TLS certificate verification.
        authStyle:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.OAuth2AuthStyle'
          title: auth_style
          description: The authentication style for client credentials.
        authEndpoint:
          type: string
          title: auth_endpoint
          description: |-
            The authorization endpoint of the OIDC provider.
             Should be fetched from the well-known configuration file of the OIDC provider.
          readOnly: true
      title: OIDCIdentityProviderConfig
      additionalProperties: false
      description: OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
    bytebase.v1.OIDCIdentityProviderContext:
      type: object
      properties:
        code:
          type: string
          title: code
          maxLength: 4096
          description: Authorization code from OIDC provider.
      title: OIDCIdentityProviderContext
      additionalProperties: false
      description: OpenID Connect authentication context.
    bytebase.v1.OIDCIdentityProviderTestRequestContext:
      type: object
      properties:
        code:
          type: string
          title: code
          description: Authorize code from OIDC provider.
      title: OIDCIdentityProviderTestRequestContext
      additionalProperties: false
    bytebase.v1.ObjectSchema:
      type: object
      anyOf:
        - type: object
          properties:
            arrayKind:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ObjectSchema.ArrayKind'
              title: array_kind
              description: Array schema.
          title: array_kind
        - type: object
          properties:
            structKind:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ObjectSchema.StructKind'
              title: struct_kind
              description: Struct schema.
          title: struct_kind
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - arrayKind
              - required:
                  - structKind
          - not:
              oneOf:
                - required:
                    - arrayKind
                - required:
                    - structKind
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ObjectSchema.Type'
          title: type
          description: The data type of this object.
        semanticType:
          type: string
          title: semantic_type
          description: The semantic type of this object.
      title: ObjectSchema
      description: Schema definition for object-type columns.
    bytebase.v1.ObjectSchema.ArrayKind:
      type: object
      properties:
        kind:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
          title: kind
          description: The schema of array elements.
      title: ArrayKind
      additionalProperties: false
      description: Array type with element schema.
    bytebase.v1.ObjectSchema.StructKind:
      type: object
      properties:
        properties:
          type: object
          title: properties
          additionalProperties:
            allOf:
              - $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
            title: value
          description: Properties of the struct.
      title: StructKind
      additionalProperties: false
      description: Structure type with named properties.
    bytebase.v1.ObjectSchema.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - STRING
        - NUMBER
        - BOOLEAN
        - OBJECT
        - ARRAY
      description: Object schema data types.
    bytebase.v1.PackageMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a package.
        definition:
          type: string
          title: definition
          description: The definition is the definition of a package.
      title: PackageMetadata
      additionalProperties: false
      description: PackageMetadata is the metadata for packages.
    bytebase.v1.PaymentInfo:
      type: object
      properties:
        totalPrice:
          type: string
          title: total_price
          description: Total amount paid for the current billing period, in the smallest currency unit (e.g. cents).
        currency:
          type: string
          title: currency
        periodStart:
          type: string
          title: period_start
        periodEnd:
          type: string
          title: period_end
        invoiceUrl:
          type: string
          title: invoice_url
          description: Stripe Billing Portal URL for invoice management.
        cancelAtPeriodEnd:
          type: boolean
          title: cancel_at_period_end
          description: Whether the subscription is scheduled to cancel at the end of the current billing period.
        nextPeriodPrice:
          type: string
          title: next_period_price
          description: |-
            Amount that will be charged at the next renewal, in the smallest currency unit (e.g. cents).
             Empty when the subscription will not renew (e.g. scheduled to cancel at period end).
      title: PaymentInfo
      additionalProperties: false
    bytebase.v1.PermissionDeniedDetail:
      type: object
      properties:
        method:
          type: string
          title: method
          description: The API method that was called.
        requiredPermissions:
          type: array
          items:
            type: string
          title: required_permissions
          description: The permissions required but not granted to the user.
        resources:
          type: array
          items:
            type: string
          title: resources
          description: The resources the user was trying to access.
      title: PermissionDeniedDetail
      additionalProperties: false
      description: |-
        PermissionDeniedDetail provides structured information about permission failures.
         Used as error detail when returning CodePermissionDenied errors.
    bytebase.v1.Plan:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the plan.
             `plan` is a system generated ID.
             Format: projects/{project}/plans/{plan}
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The state of the plan.
        issue:
          type: string
          title: issue
          description: |-
            The issue associated with the plan.
             Can be empty.
             Format: projects/{project}/issues/{issue}
          readOnly: true
        title:
          type: string
          title: title
          maxLength: 200
          description: The title of the plan.
        description:
          type: string
          title: description
          maxLength: 10000
          description: The description of the plan.
        specs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan.Spec'
          title: specs
          description: The deployment specs for the plan.
        creator:
          type: string
          title: creator
          description: 'Format: users/hello@world.com'
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        planCheckRunStatusCount:
          type: object
          title: plan_check_run_status_count
          additionalProperties:
            type: integer
            title: value
            format: int32
          description: |-
            The status count of the latest plan check runs.
             Keys are:
             - SUCCESS
             - WARNING
             - ERROR
             - RUNNING
          readOnly: true
        hasRollout:
          type: boolean
          title: has_rollout
          description: Whether the plan has started the rollout.
          readOnly: true
        approvalStatus:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ApprovalStatus'
          title: approval_status
          description: |-
            The approval status of the linked issue.
             Unspecified when no linked issue exists or the linked issue is a draft.
          readOnly: true
        rolloutStageSummaries:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan.RolloutStageSummary'
          title: rollout_stage_summaries
          description: |-
            Per-stage rollout status summary.
             Ordered by environment deployment order. Empty when no rollout exists.
          readOnly: true
        issueStatus:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueStatus'
          title: issue_status
          description: |-
            The lifecycle status of the linked issue.
             Unspecified when no linked issue exists.
          readOnly: true
        lastPlanEditor:
          type: string
          title: last_plan_editor
          description: |-
            The user who last created or updated the Plan specs.
             Format: users/hello@world.com. For legacy Plans without stored attribution,
             this falls back to the Plan creator.
          readOnly: true
      title: Plan
      additionalProperties: false
    bytebase.v1.Plan.ChangeDatabaseConfig:
      type: object
      properties:
        targets:
          type: array
          items:
            type: string
          title: targets
          description: |-
            The list of targets.
             Multi-database format: [instances/{instance-id}/databases/{database-name}].
             Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
        sheet:
          type: string
          title: sheet
          description: |-
            The resource name of the sheet.
             Format: projects/{project}/sheets/{sheet}
        release:
          type: string
          title: release
          description: |-
            The resource name of the release.
             Format: projects/{project}/releases/{release}
        enablePriorBackup:
          type: boolean
          title: enable_prior_backup
          description: If set, a backup of the modified data will be created automatically before any changes are applied.
      title: ChangeDatabaseConfig
      additionalProperties: false
    bytebase.v1.Plan.CreateDatabaseConfig:
      type: object
      properties:
        target:
          type: string
          title: target
          description: |-
            The resource name of the instance on which the database is created.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        database:
          type: string
          title: database
          description: The name of the database to create.
        table:
          type: string
          title: table
          description: |-
            (OPTIONAL) table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.
             For example, in MongoDB, it only creates the database when we first store data in that database.
        characterSet:
          type: string
          title: character_set
          description: (OPTIONAL) character_set is the character set of the database.
        collation:
          type: string
          title: collation
          description: (OPTIONAL) collation is the collation of the database.
        cluster:
          type: string
          title: cluster
          description: (OPTIONAL) cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>".
        owner:
          type: string
          title: owner
          description: (OPTIONAL) owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>".
        environment:
          type: string
          title: environment
          description: |-
            (OPTIONAL) The environment resource.
             Format: environments/prod where prod is the environment resource ID.
      title: CreateDatabaseConfig
      required:
        - target
        - database
      additionalProperties: false
    bytebase.v1.Plan.RolloutStageSummary:
      type: object
      properties:
        stage:
          type: string
          title: stage
          description: |-
            The stage resource name.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
        taskStatusCounts:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Plan.TaskStatusCount'
          title: task_status_counts
          description: Task status counts for this stage.
      title: RolloutStageSummary
      additionalProperties: false
    bytebase.v1.Plan.Spec:
      type: object
      anyOf:
        - type: object
          properties:
            changeDatabaseConfig:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Plan.ChangeDatabaseConfig'
              title: change_database_config
          title: change_database_config
        - type: object
          properties:
            createDatabaseConfig:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Plan.CreateDatabaseConfig'
              title: create_database_config
          title: create_database_config
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - changeDatabaseConfig
              - required:
                  - createDatabaseConfig
          - not:
              oneOf:
                - required:
                    - changeDatabaseConfig
                - required:
                    - createDatabaseConfig
      properties:
        id:
          type: string
          title: id
          description: A UUID4 string that uniquely identifies the Spec.
      title: Spec
    bytebase.v1.Plan.TaskStatusCount:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Task.Status'
          title: status
          description: The task status.
        count:
          type: integer
          title: count
          format: int32
          description: The number of tasks in the status.
      title: TaskStatusCount
      additionalProperties: false
    bytebase.v1.PlanCheckRun:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/planCheckRun'
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Status'
          title: status
        results:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result'
          title: results
        error:
          type: string
          title: error
          description: error is set if the Status is FAILED.
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
      title: PlanCheckRun
      additionalProperties: false
    bytebase.v1.PlanCheckRun.Result:
      type: object
      anyOf:
        - type: object
          properties:
            sqlReviewReport:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.SqlReviewReport'
              title: sql_review_report
          title: sql_review_report
        - type: object
          properties:
            sqlSummaryReport:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.SqlSummaryReport'
              title: sql_summary_report
          title: sql_summary_report
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - sqlReviewReport
              - required:
                  - sqlSummaryReport
          - not:
              oneOf:
                - required:
                    - sqlReviewReport
                - required:
                    - sqlSummaryReport
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Advice.Level'
          title: status
        title:
          type: string
          title: title
        content:
          type: string
          title: content
        code:
          type: integer
          title: code
          format: int32
        target:
          type: string
          title: target
          description: |-
            Target identification for consolidated results.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.Type'
          title: type
      title: Result
    bytebase.v1.PlanCheckRun.Result.SqlReviewReport:
      type: object
      properties:
        startPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: start_position
          description: Position of the SQL statement.
        endPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: end_position
      title: SqlReviewReport
      additionalProperties: false
    bytebase.v1.PlanCheckRun.Result.SqlSummaryReport:
      type: object
      properties:
        statementTypes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.StatementType'
          title: statement_types
          description: statement_types are the types of statements that are found in the sql.
        affectedRows:
          type: string
          title: affected_rows
          format: int64
      title: SqlSummaryReport
      additionalProperties: false
    bytebase.v1.PlanCheckRun.Result.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - STATEMENT_ADVISE
        - STATEMENT_SUMMARY_REPORT
        - GHOST_SYNC
    bytebase.v1.PlanCheckRun.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - RUNNING
        - DONE
        - FAILED
        - CANCELED
    bytebase.v1.PlanConfig:
      type: object
      properties:
        plans:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PlanLimitConfig'
          title: plans
        instanceFeatures:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PlanFeature'
          title: instance_features
      title: PlanConfig
      additionalProperties: false
      description: PlanConfig represents the configuration for all plans loaded from plan.yaml
    bytebase.v1.PlanFeature:
      type: string
      title: PlanFeature
      enum:
        - FEATURE_UNSPECIFIED
        - FEATURE_DATABASE_CHANGE
        - FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL
        - FEATURE_DECLARATIVE_SCHEMA_MIGRATION
        - FEATURE_COMPARE_AND_SYNC_SCHEMA
        - FEATURE_ONLINE_SCHEMA_CHANGE
        - FEATURE_PRE_DEPLOYMENT_SQL_REVIEW
        - FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES
        - FEATURE_ONE_CLICK_DATA_ROLLBACK
        - FEATURE_MULTI_DATABASE_BATCH_CHANGES
        - FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT
        - FEATURE_SCHEDULED_ROLLOUT_TIME
        - FEATURE_DATABASE_CHANGELOG
        - FEATURE_SCHEMA_DRIFT_DETECTION
        - FEATURE_ROLLOUT_POLICY
        - FEATURE_WEB_BASED_SQL_EDITOR
        - FEATURE_SQL_EDITOR_ADMIN_MODE
        - FEATURE_NATURAL_LANGUAGE_TO_SQL
        - FEATURE_AI_QUERY_EXPLANATION
        - FEATURE_AI_QUERY_SUGGESTIONS
        - FEATURE_AUTO_COMPLETE
        - FEATURE_SCHEMA_DIAGRAM
        - FEATURE_SCHEMA_EDITOR
        - FEATURE_DATA_EXPORT
        - FEATURE_DATA_OFFLINE_EXPORT
        - FEATURE_QUERY_HISTORY
        - FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS
        - FEATURE_BATCH_QUERY
        - FEATURE_INSTANCE_READ_ONLY_CONNECTION
        - FEATURE_QUERY_POLICY
        - FEATURE_RESTRICT_COPYING_DATA
        - FEATURE_IAM
        - FEATURE_INSTANCE_SSL_CONNECTION
        - FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL
        - FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION
        - FEATURE_GOOGLE_AND_GITHUB_SSO
        - FEATURE_USER_GROUPS
        - FEATURE_DISALLOW_SELF_SERVICE_SIGNUP
        - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
        - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
        - FEATURE_RISK_ASSESSMENT
        - FEATURE_APPROVAL_WORKFLOW
        - FEATURE_AUDIT_LOG
        - FEATURE_ENTERPRISE_SSO
        - FEATURE_TWO_FA
        - FEATURE_PASSWORD_RESTRICTIONS
        - FEATURE_DISALLOW_PASSWORD_SIGNIN
        - FEATURE_CUSTOM_ROLES
        - FEATURE_REQUEST_ROLE_WORKFLOW
        - FEATURE_JIT
        - FEATURE_DATA_MASKING
        - FEATURE_DATA_CLASSIFICATION
        - FEATURE_SCIM
        - FEATURE_DIRECTORY_SYNC
        - FEATURE_TOKEN_DURATION_CONTROL
        - FEATURE_EXTERNAL_SECRET_MANAGER
        - FEATURE_USER_EMAIL_DOMAIN_RESTRICTION
        - FEATURE_PROJECT_MANAGEMENT
        - FEATURE_ENVIRONMENT_MANAGEMENT
        - FEATURE_IM_NOTIFICATIONS
        - FEATURE_TERRAFORM_PROVIDER
        - FEATURE_DATABASE_GROUPS
        - FEATURE_ENVIRONMENT_TIERS
        - FEATURE_DASHBOARD_ANNOUNCEMENT
        - FEATURE_API_INTEGRATION_GUIDANCE
        - FEATURE_CUSTOM_LOGO
        - FEATURE_WATERMARK
        - FEATURE_ROADMAP_PRIORITIZATION
        - FEATURE_CUSTOM_MSA
        - FEATURE_COMMUNITY_SUPPORT
        - FEATURE_EMAIL_SUPPORT
        - FEATURE_DEDICATED_SUPPORT_WITH_SLA
        - FEATURE_SHAREPOINT_EXPORT
      description: PlanFeature represents the available features in Bytebase
    bytebase.v1.PlanLimitConfig:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanType'
          title: type
        maximumInstanceCount:
          type: integer
          title: maximum_instance_count
          format: int32
        maximumSeatCount:
          type: integer
          title: maximum_seat_count
          format: int32
        features:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PlanFeature'
          title: features
      title: PlanLimitConfig
      additionalProperties: false
      description: PlanLimitConfig represents a single plan's configuration
    bytebase.v1.PlanType:
      type: string
      title: PlanType
      enum:
        - PLAN_TYPE_UNSPECIFIED
        - FREE
        - TEAM
        - ENTERPRISE
    bytebase.v1.Policy:
      type: object
      anyOf:
        - type: object
          properties:
            maskingExemptionPolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.MaskingExemptionPolicy'
              title: masking_exemption_policy
          title: masking_exemption_policy
        - type: object
          properties:
            maskingRulePolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.MaskingRulePolicy'
              title: masking_rule_policy
          title: masking_rule_policy
        - type: object
          properties:
            queryDataPolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.QueryDataPolicy'
              title: query_data_policy
          title: query_data_policy
        - type: object
          properties:
            reviewAiPolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ReviewAIPolicy'
              title: review_ai_policy
          title: review_ai_policy
        - type: object
          properties:
            reviewRulePolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ReviewRulePolicy'
              title: review_rule_policy
          title: review_rule_policy
        - type: object
          properties:
            rolloutPolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.RolloutPolicy'
              title: rollout_policy
          title: rollout_policy
        - type: object
          properties:
            tagPolicy:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.TagPolicy'
              title: tag_policy
          title: tag_policy
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - maskingExemptionPolicy
              - required:
                  - maskingRulePolicy
              - required:
                  - queryDataPolicy
              - required:
                  - reviewAiPolicy
              - required:
                  - reviewRulePolicy
              - required:
                  - rolloutPolicy
              - required:
                  - tagPolicy
          - not:
              oneOf:
                - required:
                    - maskingExemptionPolicy
                - required:
                    - maskingRulePolicy
                - required:
                    - queryDataPolicy
                - required:
                    - reviewAiPolicy
                - required:
                    - reviewRulePolicy
                - required:
                    - rolloutPolicy
                - required:
                    - tagPolicy
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the policy.
             Format: {resource name}/policies/{policy type}
             Workspace resource name: workspaces/{workspace-id}.
             Environment resource name: environments/environment-id.
        inheritFromParent:
          type: boolean
          title: inherit_from_parent
          description: Whether this policy inherits from its parent resource.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PolicyType'
          title: type
          description: The type of policy.
        enforce:
          type: boolean
          title: enforce
          description: Whether the policy is enforced.
        resourceType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PolicyResourceType'
          title: resource_type
          description: The resource type for the policy.
          readOnly: true
      title: Policy
    bytebase.v1.PolicyDelta:
      type: object
      properties:
        bindingDeltas:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.BindingDelta'
          title: binding_deltas
          description: The delta for Bindings between two policies.
      title: PolicyDelta
      additionalProperties: false
      description: Describes changes between two IAM policies.
    bytebase.v1.PolicyResourceType:
      type: string
      title: PolicyResourceType
      enum:
        - RESOURCE_TYPE_UNSPECIFIED
        - WORKSPACE
        - ENVIRONMENT
        - PROJECT
      description: The resource type that a policy can be attached to.
    bytebase.v1.PolicyType:
      type: string
      title: PolicyType
      enum:
        - POLICY_TYPE_UNSPECIFIED
        - MASKING_RULE
        - MASKING_EXEMPTION
        - ROLLOUT_POLICY
        - TAG
        - DATA_QUERY
        - REVIEW_RULE
        - REVIEW_AI
      description: The type of organizational policy.
    bytebase.v1.Position:
      type: object
      properties:
        line:
          type: integer
          title: line
          format: int32
          description: |-
            Line position in a text (one-based).
             First line of the text is line 1.
             A value of 0 indicates the line information is unknown.
        column:
          type: integer
          title: column
          format: int32
          description: "Column position in a text (one-based).\n Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.\n First character of the line is column 1.\n A value of 0 indicates the column information is unknown.\n\n Examples:\n - \"SELECT * FROM t\" - column 8 is '*'\n - \"SELECT 你好 FROM t\" - column 8 is '你' (even though it's at byte offset 7)\n - \"SELECT \U0001F600 FROM t\" - column 8 is '\U0001F600' (even though it's 4 bytes in UTF-8)"
      title: Position
      additionalProperties: false
      description: |-
        Position in a text expressed as one-based line and one-based column.
         We use 1-based numbering to match the majority of industry standards:
         - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)
         - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)
         - Most text editors display 1-based positions to users
         Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),
         but we follow the canonical user-facing standards.

         Handling unknown positions:
         - If the entire position is unknown, leave this field as nil/undefined
         - If only line is known, set line and leave column as 0 (e.g., line=5, column=0)
         - If only column is known (rare), set column and leave line as 0
         Frontends should check for nil/undefined/zero values and handle them appropriately.
    bytebase.v1.PrepareSampleProjectInstanceRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The project that owns the sample instance.
             Format: projects/{project}
      title: PrepareSampleProjectInstanceRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.PreviewTaskRunRollbackRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
      title: PreviewTaskRunRollbackRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.PreviewTaskRunRollbackResponse:
      type: object
      properties:
        statement:
          type: string
          title: statement
          description: The rollback SQL statement that would undo the task run.
      title: PreviewTaskRunRollbackResponse
      additionalProperties: false
    bytebase.v1.ProcedureMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a procedure.
        definition:
          type: string
          title: definition
          description: The definition is the definition of a procedure.
        signature:
          type: string
          title: signature
          description: |-
            The signature is the name with the number and type of input arguments the
             procedure takes.
        characterSetClient:
          type: string
          title: character_set_client
          description: MySQL specific metadata.
        collationConnection:
          type: string
          title: collation_connection
        databaseCollation:
          type: string
          title: database_collation
        sqlMode:
          type: string
          title: sql_mode
        comment:
          type: string
          title: comment
          description: The comment is the comment of a procedure.
        skipDump:
          type: boolean
          title: skip_dump
      title: ProcedureMetadata
      additionalProperties: false
      description: ProcedureMetadata is the metadata for procedures.
    bytebase.v1.Project:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the project.
             Format: projects/{project}
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The lifecycle state of the project.
        title:
          type: string
          title: title
          maxLength: 200
          description: The title or name of a project. It's not unique within the workspace.
        webhooks:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Webhook'
          title: webhooks
          description: The list of webhooks configured for the project.
        dataClassificationConfigId:
          type: string
          title: data_classification_config_id
          description: The data classification configuration ID for the project.
        issueLabels:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Label'
          title: issue_labels
          description: Labels available for tagging issues in this project.
        forceIssueLabels:
          type: boolean
          title: force_issue_labels
          description: Force issue labels to be used when creating an issue.
        enforceIssueTitle:
          type: boolean
          title: enforce_issue_title
          description: Enforce issue title to be created by user instead of generated by Bytebase.
        postgresDatabaseTenantMode:
          type: boolean
          title: postgres_database_tenant_mode
          description: |-
            Whether to enable database tenant mode for PostgreSQL.
             If enabled, issues will include "set role <db_owner>" statement.
        allowSelfApproval:
          type: boolean
          title: allow_self_approval
          description: Whether to allow issue creators to self-approve their own issues.
        executionRetryPolicy:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Project.ExecutionRetryPolicy'
          title: execution_retry_policy
          description: Execution retry policy for task runs.
        ciSamplingSize:
          type: integer
          title: ci_sampling_size
          format: int32
          description: |-
            The maximum number of databases to sample during CI data validation and
             AI review. Without specification, sampling is disabled, resulting in full
             validation.
        parallelTasksPerRollout:
          type: integer
          title: parallel_tasks_per_rollout
          format: int32
          description: The maximum number of parallel tasks allowed during rollout execution.
        labels:
          type: object
          title: labels
          additionalProperties:
            type: string
            title: value
          description: |-
            Labels are key-value pairs that can be attached to the project.
             For example, { "environment": "production", "team": "backend" }
        enforceSqlReview:
          type: boolean
          title: enforce_sql_review
          description: |-
            Whether to enforce SQL review checks to pass before issue creation.
             If enabled, issues cannot be created when SQL review finds errors.
        requireIssueApproval:
          type: boolean
          title: require_issue_approval
          description: Whether to require issue approval before rollout.
        requirePlanCheckNoError:
          type: boolean
          title: require_plan_check_no_error
          description: Whether to require plan check to have no error before rollout.
        allowRequestRole:
          type: boolean
          title: allow_request_role
        allowJustInTimeAccess:
          type: boolean
          title: allow_just_in_time_access
          description: Once enabled, users can request and use the just-in-time access in the SQL Editor.
        allowLastPlanEditorApproval:
          type: boolean
          title: allow_last_plan_editor_approval
          description: Whether to allow the last Plan editor to approve a database change issue.
        exportSetting:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Project.ExportSetting'
          title: export_setting
          description: Export configuration for this project.
      title: Project
      additionalProperties: false
    bytebase.v1.Project.ExecutionRetryPolicy:
      type: object
      properties:
        maximumRetries:
          type: integer
          title: maximum_retries
          format: int32
          description: The maximum number of retries for lock timeout errors.
      title: ExecutionRetryPolicy
      additionalProperties: false
      description: Execution retry policy configuration.
    bytebase.v1.Project.ExportSetting:
      type: object
      properties:
        sharepoint:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SharePointDestination'
          title: sharepoint
          description: Unset when the project has no SharePoint destination.
      title: ExportSetting
      additionalProperties: false
      description: Destinations offered for this project's exports, at most one per provider.
    bytebase.v1.PurchaseBillingMethod:
      type: object
      properties:
        interval:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.BillingInterval'
          title: interval
        discount:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PurchaseDiscount'
          title: discount
      title: PurchaseBillingMethod
      additionalProperties: false
    bytebase.v1.PurchaseDiscount:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PurchaseDiscount.Type'
          title: type
        value:
          type: integer
          title: value
          format: int32
      title: PurchaseDiscount
      additionalProperties: false
    bytebase.v1.PurchaseDiscount.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - PERCENTAGE_OFF
        - FIXED_MONTH_OFF
        - FIXED_PRICE_OFF
    bytebase.v1.PurchasePlan:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanType'
          title: type
        selfServicePurchase:
          type: boolean
          title: self_service_purchase
        additionals:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PurchasePlanAdditional'
          title: additionals
        billingMethods:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PurchaseBillingMethod'
          title: billing_methods
      title: PurchasePlan
      additionalProperties: false
    bytebase.v1.PurchasePlanAdditional:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PurchasePlanAdditional.Type'
          title: type
        unitPrice:
          type: integer
          title: unit_price
          format: int32
          description: Price in USD cents per month.
        freeCount:
          type: integer
          title: free_count
          format: int32
        minimumCount:
          type: integer
          title: minimum_count
          format: int32
        maximumCount:
          type: integer
          title: maximum_count
          format: int32
          description: -1 means unlimited.
      title: PurchasePlanAdditional
      additionalProperties: false
    bytebase.v1.PurchasePlanAdditional.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - USER
    bytebase.v1.PurchaseResponse:
      type: object
      properties:
        paymentUrl:
          type: string
          title: payment_url
          description: |-
            If set, redirect to this Stripe Checkout URL.
             If empty, the update was applied directly using the existing payment method.
        sessionId:
          type: string
          title: session_id
          description: Stripe Checkout Session ID. Used to verify the session after redirect.
      title: PurchaseResponse
      additionalProperties: false
    bytebase.v1.QueryDataPolicy:
      type: object
      properties:
        maximumResultRows:
          type: integer
          title: maximum_result_rows
          format: int32
          description: |-
            Support both project-level and workspace-level.
             The maximum number of rows to return in the SQL editor.
             The default value <= 0, means no limit.
        disableExport:
          type: boolean
          title: disable_export
          description: 'Deprecated: export is controlled by the bb.sql.export permission. Always false; setting it to true is rejected.'
          deprecated: true
        disableCopyData:
          type: boolean
          title: disable_copy_data
          description: |-
            workspace-level policy
             Disable copying query results in the SQL editor.
        allowAdminDataSource:
          type: boolean
          title: allow_admin_data_source
          description: |-
            workspace-level policy
             Allow using the admin data source to query in the SQL editor.
             If true, users can select the admin data source or read-only data source
             If false,
             1. when read-only data source is configured, users're force to use the read-only data source
             2. otherwise fallback to use the admin data source.
        disableDownload:
          type: boolean
          title: disable_download
          description: |-
            workspace-level policy
             Disable the Download export destination. Exports can still go to a
             configured storage destination such as SharePoint.
      title: QueryDataPolicy
      additionalProperties: false
      description: QueryDataPolicy is the policy configuration for querying data in the SQL Editor.
    bytebase.v1.QueryHistory:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name for the query history.
             Format: projects/{project}/queryHistories/{id}
          readOnly: true
        database:
          type: string
          title: database
          description: |-
            The database name to execute the query.
             Format: instances/{instance}/databases/{databaseName} or projects/{project}/instances/{instance}/databases/{databaseName}
          readOnly: true
        creator:
          type: string
          title: creator
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        statement:
          type: string
          title: statement
          readOnly: true
        error:
          type:
            - string
            - "null"
          title: error
          readOnly: true
        duration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: duration
          readOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryHistory.Type'
          title: type
      title: QueryHistory
      additionalProperties: false
    bytebase.v1.QueryHistory.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - QUERY
        - EXPORT
    bytebase.v1.QueryOption:
      type: object
      properties:
        redisRunCommandsOn:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryOption.RedisRunCommandsOn'
          title: redis_run_commands_on
        explainFormat:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryOption.ExplainFormat'
          title: explain_format
          description: |-
            Which explain output the caller wants, for an explain request.

             Leave it unspecified for the engine's own default, which is the only
             output most engines have. Naming a format an engine cannot produce is
             INVALID_ARGUMENT rather than a silent fallback, as is any explain request
             against an engine that has no explain at all.
      title: QueryOption
      additionalProperties: false
    bytebase.v1.QueryOption.ExplainFormat:
      type: string
      title: ExplainFormat
      enum:
        - EXPLAIN_FORMAT_UNSPECIFIED
        - TEXT
        - JSON
        - XML
        - YAML
      description: The output format of a query plan.
    bytebase.v1.QueryOption.RedisRunCommandsOn:
      type: string
      title: RedisRunCommandsOn
      enum:
        - REDIS_RUN_COMMANDS_ON_UNSPECIFIED
        - SINGLE_NODE
        - ALL_NODES
    bytebase.v1.QueryRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name is the database resource name to execute the query against.
             Format: instances/{instance}/databases/{databaseName} or
             projects/{project}/instances/{instance}/databases/{databaseName}
        statement:
          type: string
          title: statement
          description: The SQL statement to execute.
        limit:
          type: integer
          title: limit
          format: int32
          description: The maximum number of rows to return.
        dataSourceId:
          type: string
          title: data_source_id
          description: |-
            The id of data source.
             If omitted, Query resolves the data source server-side by using the single
             read-only data source when exactly one exists, or the admin data source
             otherwise. It can also be set explicitly to query the admin data source or
             a specific read-only data source.
        explain:
          type: boolean
          title: explain
          description: Explain the statement.
        schema:
          type:
            - string
            - "null"
          title: schema
          description: |-
            The default schema to search objects. Equals to the current schema in
             Oracle and search path in Postgres.
        queryOption:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryOption'
          title: query_option
        container:
          type:
            - string
            - "null"
          title: container
          description: |-
            Container is the container name to execute the query against, used for
             CosmosDB only.
      title: QueryRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.QueryResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryResult'
          title: results
          description: The query results.
        appliedAccessGrant:
          type: string
          title: applied_access_grant
          description: |-
            The just-in-time access grant applied to this query, if any.
             Format: projects/{project}/accessGrants/{accessGrant}.
             Empty when the user was authorized through normal ACL rather than a grant.
      title: QueryResponse
      additionalProperties: false
    bytebase.v1.QueryResult:
      type: object
      anyOf:
        - type: object
          properties:
            commandError:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.QueryResult.CommandError'
              title: command_error
          title: command_error
        - type: object
          properties:
            permissionDenied:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.PermissionDeniedDetail'
              title: permission_denied
          title: permission_denied
        - type: object
          properties:
            postgresError:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.QueryResult.PostgresError'
              title: postgres_error
          title: postgres_error
        - type: object
          properties:
            syntaxError:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.QueryResult.SyntaxError'
              title: syntax_error
          title: syntax_error
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - commandError
              - required:
                  - permissionDenied
              - required:
                  - postgresError
              - required:
                  - syntaxError
          - not:
              oneOf:
                - required:
                    - commandError
                - required:
                    - permissionDenied
                - required:
                    - postgresError
                - required:
                    - syntaxError
      properties:
        columnNames:
          type: array
          items:
            type: string
          title: column_names
          description: Column names of the query result.
        columnTypeNames:
          type: array
          items:
            type: string
          title: column_type_names
          description: |-
            Column types of the query result.
             The types come from the Golang SQL driver.
        rows:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryRow'
          title: rows
          description: Rows of the query result.
        rowsCount:
          type: string
          title: rows_count
          format: int64
        error:
          type: string
          title: error
          description: The error message if the query failed.
        latency:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: latency
          description: The time it takes to execute the query.
        statement:
          type: string
          title: statement
          description: The query statement for the result.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryResult.Message'
          title: messages
          description: |-
            Informational or debug messages returned by the database engine during query execution.
             Examples include PostgreSQL's RAISE NOTICE, MSSQL's PRINT, or Oracle's DBMS_OUTPUT.PUT_LINE.
        masked:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.MaskingReason'
          title: masked
          description: Masking reasons for each column (empty for non-masked columns).
        queryPlan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryResult.QueryPlan'
          title: query_plan
          description: Set when the result is a query plan. Unset for any other result.
      title: QueryResult
    bytebase.v1.QueryResult.CommandError:
      type: object
      properties:
        commandType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryResult.CommandError.Type'
          title: command_type
          description: Disallowed command_type.
      title: CommandError
      additionalProperties: false
      description: |-
        Permission denied with resource information or disallowed command_type.
         Either resources or command_type is available.
    bytebase.v1.QueryResult.CommandError.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - DDL
        - DML
        - NON_READ_ONLY
    bytebase.v1.QueryResult.Message:
      type: object
      properties:
        level:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryResult.Message.Level'
          title: level
        content:
          type: string
          title: content
      title: Message
      additionalProperties: false
    bytebase.v1.QueryResult.Message.Level:
      type: string
      title: Level
      enum:
        - LEVEL_UNSPECIFIED
        - INFO
        - WARNING
        - DEBUG
        - LOG
        - NOTICE
        - EXCEPTION
    bytebase.v1.QueryResult.PostgresError:
      type: object
      properties:
        severity:
          type: string
          title: severity
        code:
          type: string
          title: code
        message:
          type: string
          title: message
        detail:
          type: string
          title: detail
        hint:
          type: string
          title: hint
        position:
          type: integer
          title: position
          format: int32
        internalPosition:
          type: integer
          title: internal_position
          format: int32
        internalQuery:
          type: string
          title: internal_query
        where:
          type: string
          title: where
        schemaName:
          type: string
          title: schema_name
        tableName:
          type: string
          title: table_name
        columnName:
          type: string
          title: column_name
        dataTypeName:
          type: string
          title: data_type_name
        constraintName:
          type: string
          title: constraint_name
        file:
          type: string
          title: file
        line:
          type: integer
          title: line
          format: int32
        routine:
          type: string
          title: routine
      title: PostgresError
      additionalProperties: false
      description: |-
        refer https://www.postgresql.org/docs/11/protocol-error-fields.html
         for field description.
    bytebase.v1.QueryResult.QueryPlan:
      type: object
      properties:
        format:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.QueryOption.ExplainFormat'
          title: format
        executed:
          type: boolean
          title: executed
          description: |-
            Whether producing the plan executed the statement, as EXPLAIN ANALYZE
             does.
        content:
          type: string
          title: content
          description: |-
            The plan itself, where the engine states it beside the result rather
             than in the result's rows. BigQuery reports the stages its job ran in
             the job's own statistics, so one result carries the query's data and
             the plan of the run that produced it. Empty when the plan is the rows,
             which is every other engine. Omitted from the audit log, as the rows
             are: the statement is what an audit reads.
      title: QueryPlan
      additionalProperties: false
      description: 'A query plan the result carries: in its rows, or beside them.'
    bytebase.v1.QueryResult.SyntaxError:
      type: object
      properties:
        startPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: start_position
          description: Position information for highlighting in editor
      title: SyntaxError
      additionalProperties: false
      description: Syntax error with position information for editor highlighting
    bytebase.v1.QueryRow:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.RowValue'
          title: values
          description: Row values of the query result.
      title: QueryRow
      additionalProperties: false
    bytebase.v1.Range:
      type: object
      properties:
        start:
          type: integer
          title: start
          format: int32
          description: Start index (inclusive).
        end:
          type: integer
          title: end
          format: int32
          description: End index (exclusive).
      title: Range
      additionalProperties: false
      description: |-
        Range represents a span within a text or sequence.
         Whether the indices are byte offsets or character indices depends on the context.
         Check the documentation of the field using Range for specific semantics.
    bytebase.v1.RefreshRequest:
      type: object
      title: RefreshRequest
      additionalProperties: false
      description: Request to refresh the access token.
    bytebase.v1.RefreshResponse:
      type: object
      title: RefreshResponse
      additionalProperties: false
      description: Response from refreshing the access token.
    bytebase.v1.RegenerateRecoveryCodesRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
      title: RegenerateRecoveryCodesRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.RegenerateRecoveryCodesResponse:
      type: object
      properties:
        recoveryCodes:
          type: array
          items:
            type: string
          title: recovery_codes
          description: The pending recovery codes, shown once for the caller to save.
        pendingVersion:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: pending_version
          description: Identifies this mint; see StartMFAEnrollmentResponse.pending_version.
      title: RegenerateRecoveryCodesResponse
      additionalProperties: false
    bytebase.v1.RejectIssueRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue to add a rejection.
             Format: projects/{project}/issues/{issue}
        comment:
          type: string
          title: comment
          description: The comment explaining the rejection decision.
      title: RejectIssueRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.Release:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/releases/{release}'
          readOnly: true
        category:
          type: string
          title: category
          description: |-
            Category extracted from release name (e.g., "webapp", "analytics").
             Set by Bytebase action during release creation.
        files:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Release.File'
          title: files
          description: The SQL files included in the release.
        vcsSource:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Release.VCSSource'
          title: vcs_source
          description: The version control source of the release.
        creator:
          type: string
          title: creator
          description: 'Format: users/hello@world.com'
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The lifecycle state of the release.
          readOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Release.Type'
          title: type
          description: The type of schema change for all files in this release.
      title: Release
      additionalProperties: false
    bytebase.v1.Release.File:
      type: object
      properties:
        path:
          type: string
          title: path
          description: The path of the file. e.g., `2.2/V0001_create_table.sql`.
        version:
          type: string
          title: version
          description: The version identifier for the file.
        sheet:
          type: string
          title: sheet
          description: |-
            For inputs, we must either use `sheet` or `statement`.
             For outputs, we always use `sheet`. `statement` is the preview of the sheet content.

             The sheet that holds the content.
             Format: projects/{project}/sheets/{sheet}
        statement:
          type: string
          title: statement
          format: byte
          description: The raw SQL statement content.
          writeOnly: true
        sheetSha256:
          type: string
          title: sheet_sha256
          description: The SHA256 hash value of the sheet content or the statement.
          readOnly: true
      title: File
      additionalProperties: false
      description: A SQL file in a release.
    bytebase.v1.Release.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - VERSIONED
        - DECLARATIVE
      description: The type of schema change.
    bytebase.v1.Release.VCSSource:
      type: object
      properties:
        vcsType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.VCSType'
          title: vcs_type
          description: The type of VCS.
        url:
          type: string
          title: url
          description: The url link to the e.g., GitHub commit or pull request.
      title: VCSSource
      additionalProperties: false
      description: Version control system source information.
    bytebase.v1.RemoveDataSourceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance to remove a data source from.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        dataSource:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource'
          title: data_source
          description: |-
            Identified by data source ID.
             Only READ_ONLY data source can be removed.
      title: RemoveDataSourceRequest
      required:
        - name
        - dataSource
      additionalProperties: false
    bytebase.v1.RemoveWebhookRequest:
      type: object
      properties:
        webhook:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Webhook'
          title: webhook
          description: The webhook to remove. Identified by its url.
      title: RemoveWebhookRequest
      required:
        - webhook
      additionalProperties: false
    bytebase.v1.RequestIssueRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue to request a issue.
             Format: projects/{project}/issues/{issue}
        comment:
          type: string
          title: comment
          description: The comment explaining the request.
      title: RequestIssueRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.RequestMetadata:
      type: object
      properties:
        callerIp:
          type: string
          title: caller_ip
          description: The IP address of the request originator.
        callerSuppliedUserAgent:
          type: string
          title: caller_supplied_user_agent
          description: |-
            The user agent string provided by the caller.
             This is supplied by the client and is not authenticated.
      title: RequestMetadata
      additionalProperties: false
      description: Metadata about the incoming request.
    bytebase.v1.RequestPasswordResetRequest:
      type: object
      properties:
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            The email address of the account to reset.
             Bounded so an oversized identity is refused at the edge before any
             handler runs; the login-attempt lockout keys rows by this value.
        workspace:
          type:
            - string
            - "null"
          title: workspace
          maxLength: 256
          description: |-
            Optional workspace context captured at send time, used to locate the EMAIL setting,
             and later (at verify time) for signup gate checks and workspace assignment.
             Unset for SaaS brand-new signup (no workspace exists yet).
             Format: workspaces/{workspace}
      title: RequestPasswordResetRequest
      additionalProperties: false
    bytebase.v1.RequestReauthCodeRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
      title: RequestReauthCodeRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.ResetPasswordRequest:
      type: object
      properties:
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            The email address of the account.
             Bounded so an oversized identity is refused at the edge before any
             handler runs; the login-attempt lockout keys rows by this value.
        code:
          type: string
          title: code
          maxLength: 64
          description: The 6-digit code from the reset email.
        newPassword:
          type: string
          title: new_password
          description: |
            The new password to set.
            string.max_bytes = 72
      title: ResetPasswordRequest
      additionalProperties: false
    bytebase.v1.Restriction:
      type: object
      properties:
        disallowSignup:
          type: boolean
          title: disallow_signup
          description: Whether self-service user signup is disabled.
          readOnly: true
        disallowPasswordSignin:
          type: boolean
          title: disallow_password_signin
          description: Whether password sign-in is disabled for all end users.
          readOnly: true
        passwordRestriction:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
          title: password_restriction
          description: Password complexity and restriction requirements.
          readOnly: true
        allowEmailCodeSignin:
          type: boolean
          title: allow_email_code_signin
          description: Whether email + 6-digit code signin is enabled for this workspace.
          readOnly: true
        passwordResetEnabled:
          type: boolean
          title: password_reset_enabled
          description: |-
            Whether password reset via email is available for this workspace.
             True when the workspace (or deployment) has an email setting configured.
          readOnly: true
      title: Restriction
      additionalProperties: false
    bytebase.v1.RetryIssueApprovalRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the issue whose approval-finding should be retried.
             Format: projects/{project}/issues/{issue}
      title: RetryIssueApprovalRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.ReviewAIPolicy:
      type: object
      properties:
        content:
          type: string
          title: content
          description: The policy text. Must not be blank, at most 64 KiB.
      title: ReviewAIPolicy
      additionalProperties: false
      description: |-
        Natural-language policy for the AI review. Unlike the review rule policy,
         both levels apply: the workspace policy and the project policy both reach
         the reviewer, and the project policy wins where they conflict.
    bytebase.v1.ReviewConfig:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the SQL review config.
             Format: reviewConfigs/{reviewConfig}
          readOnly: true
        title:
          type: string
          title: title
          maxLength: 200
          description: The title of the review configuration.
        enabled:
          type: boolean
          title: enabled
          description: Whether the review configuration is enabled.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SQLReviewRule'
          title: rules
          description: The SQL review rules to enforce.
        resources:
          type: array
          items:
            type: string
          title: resources
          description: |-
            Resources using the config.
             Format: {resource}/{resource id}, e.g., environments/test.
      title: ReviewConfig
      additionalProperties: false
    bytebase.v1.ReviewRulePolicy:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ReviewRuleType'
          title: rules
          description: The rules switched on. Unknown or unspecified values are rejected.
      title: ReviewRulePolicy
      additionalProperties: false
      description: |-
        Standard review rule policy: the rules switched on. The nearest policy
         wins: a project's own policy applies as is; a project without one uses
         the workspace policy; with neither, every rule is on. Getting the policy
         of a project without its own is NOT_FOUND; getting the workspace's when it
         has none returns every rule on.

         SYNTAX gates the rest: the other rules judge only SQL that parses, so a
         list without SYNTAX switches every rule off.

         A saved list is explicit, so a rule added to the standard set in a later
         release is appended to every saved policy by a data migration in that
         release.
    bytebase.v1.ReviewRuleType:
      type: string
      title: ReviewRuleType
      enum:
        - REVIEW_RULE_TYPE_UNSPECIFIED
        - SYNTAX
        - WALK_THROUGH
        - ONLINE_MIGRATION
        - PRIOR_BACKUP
        - REQUIRE_IS_NULL
        - REQUIRE_WHERE
        - DISALLOW_DROP_OBJECT
        - DISALLOW_TRUNCATE
        - DISALLOW_DROP_CONSTRAINT
        - DISALLOW_RENAME
        - REQUIRE_PRIMARY_KEY
      description: |-
        ReviewRuleType is the standard review rule set. The rules are fixed:
         every project gets them without configuration, and the only setting is a
         switch (see ReviewRulePolicy).

         A rule id names what the rule examines. An execution check is named for
         what it checks; a rule about the SQL itself carries REQUIRE or DISALLOW so
         the id says which way it cuts. DISALLOW on a P1 rule means the operation
         needs a person's acceptance, not that it is forbidden.
    bytebase.v1.ReviewRun:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            Format: projects/{project}/issues/{issue}/reviewRuns/{reviewRun}
             The {reviewRun} id is the reviewer: "rule" or "ai". The name
             addresses a slot, not an execution.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewRun.Type'
          title: type
          description: Derived from the name.
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewRun.Status'
          title: status
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          description: When the current run was triggered. Reset on every re-run.
          readOnly: true
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: |-
            When the run reached a terminal status. Unset while AVAILABLE or
             RUNNING.
          readOnly: true
        error:
          type: string
          title: error
          description: |-
            Fatal execution error, set if and only if status is FAILED: the review
             failed to execute (a platform problem, never the SQL — SQL problems are
             review results on a DONE run).
          readOnly: true
        outdated:
          type: boolean
          title: outdated
          description: |-
            Whether the plan's SQL changed after this run started, so the run
             reviews an earlier version of it. The server starts a new run before it
             creates the rollout automatically.
          readOnly: true
      title: ReviewRun
      additionalProperties: false
    bytebase.v1.ReviewRun.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - AVAILABLE
        - RUNNING
        - DONE
        - FAILED
      description: |-
        States follow task_run, minus PENDING (review needs no admission
         control) and minus CANCELED (runs are side-effect-free until the fenced
         completion transaction, so re-running supersedes instead of canceling).
    bytebase.v1.ReviewRun.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - RULE
        - AI
    bytebase.v1.Revision:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: instances/{instance}/databases/{database}/revisions/{revision} or projects/{project}/instances/{instance}/databases/{database}/revisions/{revision}'
        release:
          type: string
          title: release
          description: |-
            Format: projects/{project}/releases/{release}
             Can be empty.
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        deleter:
          type: string
          title: deleter
          description: |-
            Format: users/hello@world.com
             Can be empty.
          readOnly: true
        deleteTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: delete_time
          description: Can be empty.
          readOnly: true
        file:
          type: string
          title: file
          description: |-
            Format: projects/{project}/releases/{release}/files/{file_path}
             The file_path segment is URL-encoded since file paths may contain "/".
             Can be empty.
        version:
          type: string
          title: version
          description: The schema version string for this revision.
        sheet:
          type: string
          title: sheet
          description: |-
            The sheet that holds the content.
             Format: projects/{project}/sheets/{sheet}
        sheetSha256:
          type: string
          title: sheet_sha256
          description: The SHA256 hash value of the sheet.
          readOnly: true
        taskRun:
          type: string
          title: task_run
          description: |-
            The task run associated with the revision.
             Can be empty.
             Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Revision.Type'
          title: type
          description: The type of the revision.
      title: Revision
      additionalProperties: false
    bytebase.v1.Revision.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - VERSIONED
        - DECLARATIVE
      description: The type of schema revision.
    bytebase.v1.RevokeAccessGrantRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the access grant to revoke.
             Format: projects/{project}/accessGrants/{access_grant}
      title: RevokeAccessGrantRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.RiskLevel:
      type: string
      title: RiskLevel
      enum:
        - RISK_LEVEL_UNSPECIFIED
        - LOW
        - MODERATE
        - HIGH
      description: RiskLevel is the risk level.
    bytebase.v1.Role:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Resource name. Format: roles/{role}'
        title:
          type: string
          title: title
          maxLength: 200
          description: Human-readable title.
        description:
          type: string
          title: description
          maxLength: 1000
          description: Optional description of the role.
        permissions:
          type: array
          items:
            type: string
          title: permissions
          description: List of permission identifiers granted by this role.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Role.Type'
          title: type
          description: Role type indicating if it's built-in or custom.
      title: Role
      additionalProperties: false
      description: Role defines a set of permissions that can be assigned to users.
    bytebase.v1.Role.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - BUILT_IN
        - CUSTOM
    bytebase.v1.RoleGrant:
      type: object
      properties:
        role:
          type: string
          title: role
          description: |-
            The requested role.
             Format: roles/{role}.
        user:
          type: string
          title: user
          description: |-
            The user to be granted.
             Format: users/{email}.
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: The condition for the role. Same as the condition in IAM Binding message.
        expiration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: expiration
          description: The duration for which the grant is valid.
      title: RoleGrant
      additionalProperties: false
    bytebase.v1.Rollout:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The resource name of the rollout.
             Format: projects/{project}/plans/{plan}/rollout
        title:
          type: string
          title: title
          description: |-
            The title of the rollout, inherited from the associated plan.
             This field is output only and cannot be directly set.
          readOnly: true
        stages:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Stage'
          title: stages
          description: Stages and thus tasks of the rollout.
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
      title: Rollout
      additionalProperties: false
    bytebase.v1.RolloutPolicy:
      type: object
      properties:
        automatic:
          type: boolean
          title: automatic
          description: Whether rollout is automatic without manual approval.
        roles:
          type: array
          items:
            type: string
          title: roles
          description: The roles that can approve rollout execution.
      title: RolloutPolicy
      additionalProperties: false
      description: Rollout policy configuration.
    bytebase.v1.RotateDirectorySyncTokenRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The workspace whose directory sync token is rotated.
             Format: workspaces/{workspace}
      title: RotateDirectorySyncTokenRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.RotateDirectorySyncTokenResponse:
      type: object
      properties:
        token:
          type: string
          title: token
          description: The new token, in plaintext. This is the only time it is ever returned.
          readOnly: true
      title: RotateDirectorySyncTokenResponse
      additionalProperties: false
    bytebase.v1.RowValue:
      type: object
      anyOf:
        - type: object
          properties:
            boolValue:
              type: boolean
              title: bool_value
          title: bool_value
        - type: object
          properties:
            bytesValue:
              type: string
              title: bytes_value
              format: byte
          title: bytes_value
        - type: object
          properties:
            doubleValue:
              type: number
              title: double_value
              format: double
          title: double_value
        - type: object
          properties:
            floatValue:
              type: number
              title: float_value
              format: float
          title: float_value
        - type: object
          properties:
            int32Value:
              type: integer
              title: int32_value
              format: int32
          title: int32_value
        - type: object
          properties:
            int64Value:
              type: string
              title: int64_value
              format: int64
          title: int64_value
        - type: object
          properties:
            nullValue:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.NullValue'
              title: null_value
          title: null_value
        - type: object
          properties:
            stringValue:
              type: string
              title: string_value
          title: string_value
        - type: object
          properties:
            timestampTzValue:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.RowValue.TimestampTZ'
              title: timestamp_tz_value
              description: |-
                timestamp_tz_value is used for the timestamptz data type, which
                 accurately represents the timestamp with location information.
          title: timestamp_tz_value
        - type: object
          properties:
            timestampValue:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.RowValue.Timestamp'
              title: timestamp_value
              description: |-
                timestamp_value is used for the timestamp without time zone data type,
                 meaning it only includes the timestamp without any time zone or location
                 info. Although it may be expressed as a UTC value, it should be seen as a
                 timestamp missing location context.
          title: timestamp_value
        - type: object
          properties:
            uint32Value:
              type: integer
              title: uint32_value
          title: uint32_value
        - type: object
          properties:
            uint64Value:
              type: string
              title: uint64_value
              format: int64
          title: uint64_value
        - type: object
          properties:
            valueValue:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.Value'
              title: value_value
              description: value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only.
          title: value_value
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - boolValue
              - required:
                  - bytesValue
              - required:
                  - doubleValue
              - required:
                  - floatValue
              - required:
                  - int32Value
              - required:
                  - int64Value
              - required:
                  - nullValue
              - required:
                  - stringValue
              - required:
                  - timestampTzValue
              - required:
                  - timestampValue
              - required:
                  - uint32Value
              - required:
                  - uint64Value
              - required:
                  - valueValue
          - not:
              oneOf:
                - required:
                    - boolValue
                - required:
                    - bytesValue
                - required:
                    - doubleValue
                - required:
                    - floatValue
                - required:
                    - int32Value
                - required:
                    - int64Value
                - required:
                    - nullValue
                - required:
                    - stringValue
                - required:
                    - timestampTzValue
                - required:
                    - timestampValue
                - required:
                    - uint32Value
                - required:
                    - uint64Value
                - required:
                    - valueValue
      title: RowValue
    bytebase.v1.RowValue.Timestamp:
      type: object
      properties:
        googleTimestamp:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: google_timestamp
        accuracy:
          type: integer
          title: accuracy
          format: int32
          description: The accuracy is the number of digits after the decimal point.
      title: Timestamp
      additionalProperties: false
    bytebase.v1.RowValue.TimestampTZ:
      type: object
      properties:
        googleTimestamp:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: google_timestamp
        zone:
          type: string
          title: zone
          description: |-
            Zone is the time zone abbreviations in timezone database such as "PDT",
             "PST". https://en.wikipedia.org/wiki/List_of_tz_database_time_zones We
             retrieve the time zone information from the timestamptz field in the
             database. A timestamp is in UTC or epoch time, and with zone info, we can
             convert it to a local time string. Zone and offset are returned by
             time.Time.Zone()
        offset:
          type: integer
          title: offset
          format: int32
          description: The offset is in seconds east of UTC
        accuracy:
          type: integer
          title: accuracy
          format: int32
      title: TimestampTZ
      additionalProperties: false
    bytebase.v1.RunPlanChecksRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The plan to run plan checks.
             Format: projects/{project}/plans/{plan}
        specId:
          type:
            - string
            - "null"
          title: spec_id
          description: |-
            The UUID of the specific spec to run plan checks for.
             This should match the spec.id field in Plan.Spec.
             If not set, all specs in the plan will be used.
      title: RunPlanChecksRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.RunPlanChecksResponse:
      type: object
      title: RunPlanChecksResponse
      additionalProperties: false
    bytebase.v1.RunReviewRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/issues/{issue}/reviewRuns/{reviewRun}'
      title: RunReviewRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.SASLConfig:
      type: object
      anyOf:
        - type: object
          properties:
            krbConfig:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.KerberosConfig'
              title: krb_config
              description: Kerberos authentication configuration.
          title: krb_config
      unevaluatedProperties: false
      title: SASLConfig
    bytebase.v1.SQLEditorThemeSetting:
      type: object
      properties:
        id:
          type: string
          title: id
        name:
          type: string
          title: name
        monacoBase:
          type: string
          title: monaco_base
        tokens:
          type: object
          title: tokens
          additionalProperties:
            allOf:
              - $ref: '#/components/schemas/google.type.Color'
            title: value
          description: CSS token colors.
      title: SQLEditorThemeSetting
      additionalProperties: false
    bytebase.v1.SQLReviewRule:
      type: object
      anyOf:
        - type: object
          properties:
            commentConventionPayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.CommentConventionRulePayload'
              title: comment_convention_payload
          title: comment_convention_payload
        - type: object
          properties:
            namingCasePayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NamingCaseRulePayload'
              title: naming_case_payload
          title: naming_case_payload
        - type: object
          properties:
            namingPayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NamingRulePayload'
              title: naming_payload
          title: naming_payload
        - type: object
          properties:
            numberPayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NumberRulePayload'
              title: number_payload
          title: number_payload
        - type: object
          properties:
            stringArrayPayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.StringArrayRulePayload'
              title: string_array_payload
          title: string_array_payload
        - type: object
          properties:
            stringPayload:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.StringRulePayload'
              title: string_payload
          title: string_payload
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - commentConventionPayload
              - required:
                  - namingCasePayload
              - required:
                  - namingPayload
              - required:
                  - numberPayload
              - required:
                  - stringArrayPayload
              - required:
                  - stringPayload
          - not:
              oneOf:
                - required:
                    - commentConventionPayload
                - required:
                    - namingCasePayload
                - required:
                    - namingPayload
                - required:
                    - numberPayload
                - required:
                    - stringArrayPayload
                - required:
                    - stringPayload
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.Type'
          title: type
          description: The type of SQL review rule.
        level:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.Level'
          title: level
          description: The severity level of the rule.
        engine:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Engine'
          title: engine
          description: The database engine this rule applies to.
      title: SQLReviewRule
      description: SQL review rule configuration. Check the SQL_REVIEW_RULES_DOCUMENTATION.md for details.
    bytebase.v1.SQLReviewRule.CommentConventionRulePayload:
      type: object
      properties:
        required:
          type: boolean
          title: required
        maxLength:
          type: integer
          title: max_length
          format: int32
      title: CommentConventionRulePayload
      additionalProperties: false
    bytebase.v1.SQLReviewRule.Level:
      type: string
      title: Level
      enum:
        - LEVEL_UNSPECIFIED
        - ERROR
        - WARNING
      description: The severity level for SQL review rules.
    bytebase.v1.SQLReviewRule.NamingCaseRulePayload:
      type: object
      properties:
        upper:
          type: boolean
          title: upper
      title: NamingCaseRulePayload
      additionalProperties: false
    bytebase.v1.SQLReviewRule.NamingRulePayload:
      type: object
      properties:
        maxLength:
          type: integer
          title: max_length
          format: int32
        format:
          type: string
          title: format
      title: NamingRulePayload
      additionalProperties: false
      description: Payload message types for SQL review rules
    bytebase.v1.SQLReviewRule.NumberRulePayload:
      type: object
      properties:
        number:
          type: integer
          title: number
          format: int32
      title: NumberRulePayload
      additionalProperties: false
    bytebase.v1.SQLReviewRule.StringArrayRulePayload:
      type: object
      properties:
        list:
          type: array
          items:
            type: string
          title: list
      title: StringArrayRulePayload
      additionalProperties: false
    bytebase.v1.SQLReviewRule.StringRulePayload:
      type: object
      properties:
        value:
          type: string
          title: value
      title: StringRulePayload
      additionalProperties: false
    bytebase.v1.SQLReviewRule.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - ENGINE_MYSQL_USE_INNODB
        - NAMING_FULLY_QUALIFIED
        - NAMING_TABLE
        - NAMING_COLUMN
        - NAMING_INDEX_PK
        - NAMING_INDEX_UK
        - NAMING_INDEX_FK
        - NAMING_INDEX_IDX
        - NAMING_COLUMN_AUTO_INCREMENT
        - NAMING_TABLE_NO_KEYWORD
        - NAMING_IDENTIFIER_NO_KEYWORD
        - NAMING_IDENTIFIER_CASE
        - STATEMENT_SELECT_NO_SELECT_ALL
        - STATEMENT_WHERE_REQUIRE_SELECT
        - STATEMENT_WHERE_REQUIRE_UPDATE_DELETE
        - STATEMENT_WHERE_NO_LEADING_WILDCARD_LIKE
        - STATEMENT_DISALLOW_ON_DEL_CASCADE
        - STATEMENT_DISALLOW_RM_TBL_CASCADE
        - STATEMENT_DISALLOW_COMMIT
        - STATEMENT_DISALLOW_LIMIT
        - STATEMENT_DISALLOW_ORDER_BY
        - STATEMENT_MERGE_ALTER_TABLE
        - STATEMENT_INSERT_ROW_LIMIT
        - STATEMENT_INSERT_MUST_SPECIFY_COLUMN
        - STATEMENT_INSERT_DISALLOW_ORDER_BY_RAND
        - STATEMENT_AFFECTED_ROW_LIMIT
        - STATEMENT_DML_DRY_RUN
        - STATEMENT_DISALLOW_ADD_COLUMN_WITH_DEFAULT
        - STATEMENT_ADD_CHECK_NOT_VALID
        - STATEMENT_ADD_FOREIGN_KEY_NOT_VALID
        - STATEMENT_DISALLOW_ADD_NOT_NULL
        - STATEMENT_CREATE_SPECIFY_SCHEMA
        - STATEMENT_CHECK_SET_ROLE_VARIABLE
        - STATEMENT_WHERE_NO_EQUAL_NULL
        - STATEMENT_WHERE_DISALLOW_FUNCTIONS_AND_CALCULATIONS
        - STATEMENT_WHERE_MAXIMUM_LOGICAL_OPERATOR_COUNT
        - STATEMENT_MAXIMUM_STATEMENTS_IN_TRANSACTION
        - STATEMENT_NON_TRANSACTIONAL
        - STATEMENT_ADD_COLUMN_WITHOUT_POSITION
        - STATEMENT_DISALLOW_OFFLINE_DDL
        - STATEMENT_DISALLOW_CROSS_DB_QUERIES
        - STATEMENT_MAX_EXECUTION_TIME
        - STATEMENT_REQUIRE_ALGORITHM_OPTION
        - STATEMENT_REQUIRE_LOCK_OPTION
        - STATEMENT_OBJECT_OWNER_CHECK
        - TABLE_REQUIRE_PK
        - TABLE_NO_FOREIGN_KEY
        - TABLE_DROP_NAMING_CONVENTION
        - TABLE_COMMENT
        - TABLE_DISALLOW_PARTITION
        - TABLE_DISALLOW_TRIGGER
        - TABLE_NO_DUPLICATE_INDEX
        - TABLE_TEXT_FIELDS_TOTAL_LENGTH
        - TABLE_DISALLOW_SET_CHARSET
        - TABLE_DISALLOW_DDL
        - TABLE_DISALLOW_DML
        - TABLE_LIMIT_SIZE
        - TABLE_REQUIRE_CHARSET
        - TABLE_REQUIRE_COLLATION
        - COLUMN_REQUIRED
        - COLUMN_NO_NULL
        - COLUMN_DISALLOW_CHANGE_TYPE
        - COLUMN_SET_DEFAULT_FOR_NOT_NULL
        - COLUMN_DISALLOW_CHANGE
        - COLUMN_DISALLOW_CHANGING_ORDER
        - COLUMN_DISALLOW_DROP
        - COLUMN_DISALLOW_DROP_IN_INDEX
        - COLUMN_COMMENT
        - COLUMN_AUTO_INCREMENT_MUST_INTEGER
        - COLUMN_TYPE_DISALLOW_LIST
        - COLUMN_DISALLOW_SET_CHARSET
        - COLUMN_MAXIMUM_CHARACTER_LENGTH
        - COLUMN_MAXIMUM_VARCHAR_LENGTH
        - COLUMN_AUTO_INCREMENT_INITIAL_VALUE
        - COLUMN_AUTO_INCREMENT_MUST_UNSIGNED
        - COLUMN_CURRENT_TIME_COUNT_LIMIT
        - COLUMN_REQUIRE_DEFAULT
        - COLUMN_DEFAULT_DISALLOW_VOLATILE
        - COLUMN_ADD_NOT_NULL_REQUIRE_DEFAULT
        - COLUMN_REQUIRE_CHARSET
        - COLUMN_REQUIRE_COLLATION
        - SCHEMA_BACKWARD_COMPATIBILITY
        - DATABASE_DROP_EMPTY_DATABASE
        - INDEX_NO_DUPLICATE_COLUMN
        - INDEX_KEY_NUMBER_LIMIT
        - INDEX_PK_TYPE_LIMIT
        - INDEX_TYPE_NO_BLOB
        - INDEX_TOTAL_NUMBER_LIMIT
        - INDEX_PRIMARY_KEY_TYPE_ALLOWLIST
        - INDEX_CREATE_CONCURRENTLY
        - INDEX_TYPE_ALLOW_LIST
        - INDEX_NOT_REDUNDANT
        - SYSTEM_CHARSET_ALLOWLIST
        - SYSTEM_COLLATION_ALLOWLIST
        - SYSTEM_COMMENT_LENGTH
        - SYSTEM_PROCEDURE_DISALLOW_CREATE
        - SYSTEM_EVENT_DISALLOW_CREATE
        - SYSTEM_VIEW_DISALLOW_CREATE
        - SYSTEM_FUNCTION_DISALLOW_CREATE
        - SYSTEM_FUNCTION_DISALLOWED_LIST
        - ADVICE_ONLINE_MIGRATION
        - BUILTIN_PRIOR_BACKUP_CHECK
        - BUILTIN_WALK_THROUGH_CHECK
        - STATEMENT_DISALLOW_TRUNCATE
        - BUILTIN_STATEMENT_MAXIMUM_SQL_SIZE
    bytebase.v1.SampleInfo:
      type: object
      properties:
        available:
          type: boolean
          title: available
          description: Whether sample setup is currently available.
          readOnly: true
        instances:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SampleInfo.Instance'
          title: instances
          description: The provisioned sample instances.
          readOnly: true
      title: SampleInfo
      additionalProperties: false
      description: SampleInfo describes sample setup availability and provisioned resources.
    bytebase.v1.SampleInfo.Instance:
      type: object
      properties:
        instance:
          type: string
          title: instance
          description: |-
            The provisioned sample instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
          readOnly: true
        expireTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: expire_time
          description: The time when the provisioned sample instance expires.
          readOnly: true
      title: Instance
      additionalProperties: false
      description: Instance describes one provisioned sample instance.
    bytebase.v1.SavedQuery:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            (IMMUTABLE) Server-generated.
             Format: projects/{project}/savedQueries/{savedQuery}
        project:
          type: string
          title: project
          description: 'Format: projects/{project}'
          readOnly: true
        database:
          type: string
          title: database
          description: |-
            The connected database, which must belong to the saved query's own
             project. Empty when none is connected, or when the database no longer
             exists.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        title:
          type: string
          title: title
          maxLength: 200
          description: The title of the saved query.
        creator:
          type: string
          title: creator
          description: |-
            The owner. Ownership does not transfer.
             Format: users/{email}
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        content:
          type: string
          title: content
          format: byte
          description: |-
            The SQL text. SearchSavedQueries returns a truncated preview;
             GetSavedQuery returns the full text.
        contentSize:
          type: string
          title: content_size
          format: int64
          description: The full size of the content, which may exceed the `content` returned.
          readOnly: true
        starred:
          type: boolean
          title: starred
          description: Whether the calling user starred it.
          readOnly: true
        folder:
          type: string
          title: folder
          maxLength: 256
          description: |-
            The folder holding this saved query. A path like "a/b/c"; empty means
             unfiled.
      title: SavedQuery
      required:
        - name
        - title
        - content
      additionalProperties: false
    bytebase.v1.SavedQueryBinding:
      type: object
      properties:
        level:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SavedQueryBinding.Level'
          title: level
        members:
          type: array
          items:
            type: string
          title: members
          minItems: 1
          description: |-
            The members granted `level`: "user:{email}" or "group:{email}" only.

             Service accounts cannot be grantees — they reach their own saved queries
             as the creator. Naming one under "user:" grants nothing rather than
             failing. Groups are stored as references, so membership stays live.
      title: SavedQueryBinding
      required:
        - level
        - members
      additionalProperties: false
      description: Binds members to one access level on one saved query.
    bytebase.v1.SavedQueryBinding.Level:
      type: string
      title: Level
      enum:
        - LEVEL_UNSPECIFIED
        - VIEWER
        - EDITOR
      description: |-
        Nested to avoid colliding with the package-scoped EDITOR in
         DatabaseChangeMode.
    bytebase.v1.SavedQueryPolicy:
      type: object
      properties:
        bindings:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SavedQueryBinding'
          title: bindings
          description: |-
            At most one binding per level. A member listed under two levels is
             rejected rather than resolved to the higher one.
        etag:
          type: string
          title: etag
          description: |-
            The etag of the policy as read. SetSavedQueryPolicy requires it and fails
             with ABORTED when it no longer matches.
      title: SavedQueryPolicy
      additionalProperties: false
      description: |-
        Who a saved query is shared with, and at what level. No bindings means
         private. The creator is never a binding member; ownership cannot be granted.
    bytebase.v1.SchemaCatalog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The schema name.
        tables:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TableCatalog'
          title: tables
          description: The tables in the schema.
      title: SchemaCatalog
      additionalProperties: false
      description: Schema metadata within a database.
    bytebase.v1.SchemaMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name is the schema name.
             It is an empty string for databases without such concept such as MySQL.
        tables:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TableMetadata'
          title: tables
          description: The tables is the list of tables in a schema.
        externalTables:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ExternalTableMetadata'
          title: external_tables
          description: The external_tables is the list of external tables in a schema.
        views:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ViewMetadata'
          title: views
          description: The views is the list of views in a schema.
        functions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.FunctionMetadata'
          title: functions
          description: The functions is the list of functions in a schema.
        procedures:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ProcedureMetadata'
          title: procedures
          description: The procedures is the list of procedures in a schema.
        streams:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.StreamMetadata'
          title: streams
          description: |-
            The streams is the list of streams in a schema, currently, only used for
             Snowflake.
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskMetadata'
          title: tasks
          description: |-
            The routines is the list of routines in a schema, currently, only used for
             Snowflake.
        materializedViews:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.MaterializedViewMetadata'
          title: materialized_views
          description: The materialized_views is the list of materialized views in a schema.
        packages:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.PackageMetadata'
          title: packages
          description: The packages is the list of packages in a schema.
        owner:
          type: string
          title: owner
          description: The owner of the schema.
        sequences:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SequenceMetadata'
          title: sequences
          description: The sequences is the list of sequences in a schema, sorted by name.
        events:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.EventMetadata'
          title: events
          description: The events is the list of scheduled events in a schema.
        enumTypes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.EnumTypeMetadata'
          title: enum_types
          description: The enum_types is the list of user-defined enum types in a schema.
        skipDump:
          type: boolean
          title: skip_dump
          description: Whether to skip this schema during schema dump operations.
        comment:
          type: string
          title: comment
          description: The comment is the comment of a schema.
        compositeTypes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CompositeTypeMetadata'
          title: composite_types
          description: |-
            The composite_types is the list of user-defined composite types in a
             schema (PostgreSQL family, CREATE TYPE ... AS). Excludes table/view row
             types and derived types.
      title: SchemaMetadata
      additionalProperties: false
      description: |-
        SchemaMetadata is the metadata for schemas.
         This is the concept of schema in Postgres, but it's a no-op for MySQL.
    bytebase.v1.SearchAuditLogsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
        filter:
          type: string
          title: filter
          description: |-
            The filter of the log. It should be a valid CEL expression.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - method: the API name, can be found in the docs. Usually "/bytebase.v1.…", for example "/bytebase.v1.UserService/CreateUser"; entries written outside the v1 API carry their own prefix, such as "/bytebase.mcp.Session/Authorize" or "/bytebase.cli.Recovery/ResetUserPassword". Support "==" operator.
             - resource: the resource the entry is about, support "==" operator.
             - severity: support "==" operator, check Severity enum in AuditLog message for values.
             - actor: the actor, in users/{email}, serviceAccounts/{email}, or
               workloadIdentities/{email} format. Support "==" operator.
             - create_time: support ">=" and "<=" operator.
             - mcp: true selects the entries MCP produced, false the rest. A boolean, not a string. Support "==" operator.
             - mcp_correlation_id: the MCP session an entry belongs to, taken from an entry's mcp_delegation.correlation_id. Support "==" operator. Entries MCP produced outside a session — a refused connection or consent — carry none and match no value here.

             For example:
              - filter = "method == '/bytebase.v1.SQLService/Query'"
              - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
              - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && actor == 'users/bb@bytebase.com'"
              - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
              - filter = "mcp == true"
              - filter = "mcp_correlation_id == '0b7f1a3c-1d2e-4f56-8a90-1b2c3d4e5f60'"
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of the log.
             Only support order by create_time. The default sorting order is ascending.
             For example:
              - order_by = "create_time asc"
              - order_by = "create_time desc"
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of logs to return.
             The service may return fewer than this value.
             If unspecified, at most 10 log entries will be returned.
             The maximum value is 5000; values above 5000 will be coerced to 5000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `SearchLogs` call.
             Provide this to retrieve the subsequent page.
      title: SearchAuditLogsRequest
      required:
        - parent
      additionalProperties: false
      description: Request message for searching audit logs.
    bytebase.v1.SearchAuditLogsResponse:
      type: object
      properties:
        auditLogs:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AuditLog'
          title: audit_logs
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token to retrieve next page of log entities.
             Pass this value in the page_token field in the subsequent call
             to retrieve the next page of log entities.
      title: SearchAuditLogsResponse
      additionalProperties: false
      description: Response message for searching audit logs.
    bytebase.v1.SearchDatabasesRequest:
      type: object
      properties:
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of databases to return. The service may return fewer
             than this value.
             If unspecified, at most 10 databases will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `SearchDatabases` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `SearchDatabases` must
             match the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter databases returned in the list.
             It supports the same fields and operators as `ListDatabasesRequest.filter`.

             For example:
             project == "projects/{project resource id}"
             name.contains("database name") && engine == "POSTGRES"
      title: SearchDatabasesRequest
      additionalProperties: false
    bytebase.v1.SearchDatabasesResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Database'
          title: databases
          description: The databases from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: SearchDatabasesResponse
      additionalProperties: false
    bytebase.v1.SearchIssuesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent, which owns this collection of issues.
             Format: projects/{project}
             Use the wildcard "projects/-" to search across collections (AIP-159); the
             result is restricted to the projects where the caller holds
             bb.issues.get. For a concrete project, the caller must hold bb.issues.get
             on that project or the request is denied.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of issues to return. The service may return fewer than
             this value.
             If unspecified, at most 10 issues will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `SearchIssues` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `SearchIssues` must match
             the call that provided the page token.
        filter:
          type: string
          title: filter
          description: |-
            Filter is used to filter issues returned in the list.
             Check the filter field in the ListIssuesRequest message.
        query:
          type: string
          title: query
          description: Query is the query statement.
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of issues.
             Support:
             - create_time
             - update_time
             The default sorting order is ascending.
             For example:
             - order_by = "create_time desc"
             - order_by = "update_time asc"
      title: SearchIssuesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.SearchIssuesResponse:
      type: object
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Issue'
          title: issues
          description: The issues from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: SearchIssuesResponse
      additionalProperties: false
    bytebase.v1.SearchMyAccessGrantsRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project to search in.
             Format: projects/{project}
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: The maximum number of access grants to return.
        pageToken:
          type: string
          title: page_token
          description: A page token from a previous SearchMyAccessGrants call.
        filter:
          type: string
          title: filter
          description: Check the filter field in the ListAccessGrantsRequest message.
        orderBy:
          type: string
          title: order_by
          description: Check the order_by field in the ListAccessGrantsRequest message.
      title: SearchMyAccessGrantsRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.SearchMyAccessGrantsResponse:
      type: object
      properties:
        accessGrants:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.AccessGrant'
          title: access_grants
          description: The access grants from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: SearchMyAccessGrantsResponse
      additionalProperties: false
    bytebase.v1.SearchProjectsRequest:
      type: object
      properties:
        showDeleted:
          type: boolean
          title: show_deleted
          description: Show deleted projects if specified.
        filter:
          type: string
          title: filter
          description: |-
            Filter the project.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filters:
             - name: the project name, support "==" and ".contains()" operator.
             - resource_id: the project id, support "==" and ".contains()" operator.
             - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
             - state: check the State enum for the values, support "==" operator.
             - labels.{key}: the project label, support "==" and "in" operators.

             For example:
             name == "project name"
             name.contains("project name")
             resource_id == "project id"
             resource_id.contains("project id")
             exclude_default == true
             state == "DELETED"
             labels.environment == "production"
             labels.tier == "critical"
             labels.environment in ["staging", "prod"]
             You can combine filter conditions like:
             name == "project name" && resource_id.contains("project id")
             name.contains("project name") || resource_id == "project id"
             labels.environment == "production" && labels.tier == "critical"
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of projects to return. The service may return fewer than
             this value.
             If unspecified, at most 10 projects will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `SearchProjects` call.
             Provide this to retrieve the subsequent page.

             When paginating, all other parameters provided to `SearchProjects` must match
             the call that provided the page token.
        orderBy:
          type: string
          title: order_by
          description: |-
            The order by of projects.
             Support title. The default sorting order is ascending.
             For example:
             - order_by = "title"
             - order_by = "title desc"
             - order_by = "title asc"
      title: SearchProjectsRequest
      additionalProperties: false
    bytebase.v1.SearchProjectsResponse:
      type: object
      properties:
        projects:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Project'
          title: projects
          description: The projects from the specified request.
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token, which can be sent as `page_token` to retrieve the next page.
             If this field is omitted, there are no subsequent pages.
      title: SearchProjectsResponse
      additionalProperties: false
    bytebase.v1.SearchQueryHistoriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The parent project to search query histories in.
             Format: projects/{project}
             The AIP-159 wildcard "projects/-" is not supported; use
             ListQueryHistories for cross-project reads.
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of histories to return.
             The service may return fewer than this value.
             If unspecified, at most 10 history entries will be returned.
             The maximum value is 1000; values above 1000 will be coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token, received from a previous `ListQueryHistory` call.
             Provide this to retrieve the subsequent page.
        filter:
          type: string
          title: filter
          description: |-
            Filter is the filter to apply on the search query history
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             Supported filter:
             - project: the project full name in "projects/{id}" format, support "==" operator.
             - database: the database full name in "instances/{id}/databases/{name}" or "projects/{project}/instances/{id}/databases/{name}" format, support "==" operator.
             - instance: the instance full name in "instances/{id}" or "projects/{project}/instances/{id}" format, support "==" operator.
             - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
             - statement: the SQL statement, support "==" and ".contains()" operators.

             For example:
             project == "projects/{project}"
             database == "instances/{instance}/databases/{database}"
             instance == "instances/{instance}"
             type == "QUERY"
             type == "EXPORT"
             statement == "SELECT 1;"
             statement.contains("select")
             type == "QUERY" && statement.contains("select")
      title: SearchQueryHistoriesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.SearchQueryHistoriesResponse:
      type: object
      properties:
        queryHistories:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.QueryHistory'
          title: query_histories
          description: The list of history.
          readOnly: true
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            A token to retrieve next page of history.
             Pass this value in the page_token field in the subsequent call to
             `ListQueryHistory` method to retrieve the next page of history.
      title: SearchQueryHistoriesResponse
      additionalProperties: false
    bytebase.v1.SearchSavedQueriesRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        filter:
          type: string
          title: filter
          description: |-
            Filter the result, in CEL. See https://github.com/google/cel-spec

             Supported fields:
             - name: the saved query name. Supports "==" and "in [...]".
             - title: the title. Supports "contains".
             - creator: the creator in "users/{email}" format. Supports "==" and "!=".
             - shared: whether a binding shares the saved query with the caller. Their
               own saved queries, and ones visible only through a project-level
               bb.savedQueries.get, are not "shared". Supports "==".
             - starred: whether the caller starred it. Supports "==".
             - folder: the exact folder path. Supports "==".

             Use `creator == "users/{me}"` for a My view and `shared == true` for a
             Shared view. Prefer `shared` over `creator !=`: with a project-level
             bb.savedQueries.get, `creator !=` also matches saved queries nobody
             shared with the caller.

             For example:
             creator == "users/alice@example.com"
             shared == true
             starred == true
             title.contains("weekly report")
             folder == "foo/bar"
        pageSize:
          type: integer
          title: page_size
          format: int32
          description: |-
            The maximum number of saved queries to return. The service may return
             fewer. Defaults to 10; values above 1000 are coerced to 1000.
        pageToken:
          type: string
          title: page_token
          description: |-
            A page token from a previous SearchSavedQueries call. Keep every other
             parameter the same as the call that returned it.
      title: SearchSavedQueriesRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.SearchSavedQueriesResponse:
      type: object
      properties:
        savedQueries:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SavedQuery'
          title: saved_queries
        nextPageToken:
          type: string
          title: next_page_token
          description: |-
            Pass to the next SearchSavedQueries call to fetch the following page.
             Empty on the last page.
      title: SearchSavedQueriesResponse
      additionalProperties: false
    bytebase.v1.SearchSavedQueryFoldersRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: 'Format: projects/{project}'
        filter:
          type: string
          title: filter
          description: |-
            Filter folders by the saved queries they hold. Takes the same fields and
             syntax as SearchSavedQueries.filter, except `title`. A folder is returned
             when at least one saved query the caller can read matches.
      title: SearchSavedQueryFoldersRequest
      required:
        - parent
      additionalProperties: false
    bytebase.v1.SearchSavedQueryFoldersResponse:
      type: object
      properties:
        folders:
          type: array
          items:
            type: string
          title: folders
          description: |-
            Folder paths, every ancestor prefix included, sorted. A folder is a path
             on saved queries ("a/b/c"), so empty folders cannot exist.
      title: SearchSavedQueryFoldersResponse
      additionalProperties: false
    bytebase.v1.SemanticTypeSetting:
      type: object
      properties:
        types:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.SemanticTypeSetting.SemanticType'
          title: types
      title: SemanticTypeSetting
      additionalProperties: false
    bytebase.v1.SemanticTypeSetting.SemanticType:
      type: object
      properties:
        id:
          type: string
          title: id
          description: id is the uuid for semantic type.
        title:
          type: string
          title: title
          description: the title of the semantic type, it should not be empty.
        description:
          type: string
          title: description
          description: the description of the semantic type, it can be empty.
        algorithm:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Algorithm'
          title: algorithm
        icon:
          type: string
          title: icon
          description: icon is the icon for semantic type, it can be emoji or base64 encoded image.
      title: SemanticType
      additionalProperties: false
    bytebase.v1.SendEmailLoginCodeRequest:
      type: object
      properties:
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            The email address to send the code to.
             Bounded so an oversized identity is refused at the edge before any
             handler runs; the login-attempt lockout keys rows by this value.
        workspace:
          type:
            - string
            - "null"
          title: workspace
          maxLength: 256
          description: |-
            Optional workspace context captured at send time, used to locate the EMAIL setting,
             and later (at verify time) for signup gate checks and workspace assignment.
             Unset for SaaS brand-new signup (no workspace exists yet).
             Format: workspaces/{workspace}
      title: SendEmailLoginCodeRequest
      additionalProperties: false
    bytebase.v1.SequenceMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name of a sequence.
        dataType:
          type: string
          title: data_type
          description: The data type of a sequence.
        start:
          type: string
          title: start
          description: The start value of a sequence.
        minValue:
          type: string
          title: min_value
          description: The minimum value of a sequence.
        maxValue:
          type: string
          title: max_value
          description: The maximum value of a sequence.
        increment:
          type: string
          title: increment
          description: Increment value of a sequence.
        cycle:
          type: boolean
          title: cycle
          description: Cycle is whether the sequence cycles.
        cacheSize:
          type: string
          title: cache_size
          description: Cache size of a sequence.
        lastValue:
          type: string
          title: last_value
          description: Last value of a sequence.
        ownerTable:
          type: string
          title: owner_table
          description: The owner table of the sequence.
        ownerColumn:
          type: string
          title: owner_column
          description: The owner column of the sequence.
        comment:
          type: string
          title: comment
          description: The comment describing the sequence.
        skipDump:
          type: boolean
          title: skip_dump
          description: Whether to skip this sequence during schema dump operations.
      title: SequenceMetadata
      additionalProperties: false
    bytebase.v1.ServiceAccount:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the service account.
             Format: serviceAccounts/{email}
          readOnly: true
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The state of the service account.
        email:
          type: string
          title: email
          description: |-
            The email of the service account.
             For workspace-level: {name}@service.bytebase.com
             For project-level: {name}@{project-id}.service.bytebase.com
          readOnly: true
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title of the service account.
        serviceKey:
          type: string
          title: service_key
          description: The service key for authentication. Only returned on creation or key rotation.
          readOnly: true
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          description: The timestamp when the service account was created.
          readOnly: true
      title: ServiceAccount
      additionalProperties: false
      description: ServiceAccount represents an API integration account.
    bytebase.v1.SetIamPolicyRequest:
      type: object
      properties:
        resource:
          type: string
          title: resource
          description: |-
            The name of the resource to set the IAM policy.
             Format: projects/{project}
             Format: workspaces/{workspace}
        policy:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IamPolicy'
          title: policy
        etag:
          type: string
          title: etag
          description: |-
            (OPTIONAL) The current etag of the policy. Equivalent to setting `policy.etag`;
             supplying both with different values returns INVALID_ARGUMENT.
      title: SetIamPolicyRequest
      required:
        - resource
        - policy
      additionalProperties: false
      description: Request message for setting an IAM policy.
    bytebase.v1.SetSavedQueryPolicyRequest:
      type: object
      properties:
        resource:
          type: string
          title: resource
          description: 'Format: projects/{project}/savedQueries/{savedQuery}'
        policy:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SavedQueryPolicy'
          title: policy
          description: |-
            The new policy, replacing the stored one in full. Empty `bindings` makes
             the saved query private again.
      title: SetSavedQueryPolicyRequest
      required:
        - resource
        - policy
      additionalProperties: false
    bytebase.v1.Setting:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            (IDENTIFIER) The resource name of the setting.
             Format: settings/{setting}
             Example: "settings/SEMANTIC_TYPES"
        value:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SettingValue'
          title: value
          description: The configuration value of the setting.
      title: Setting
      required:
        - value
      additionalProperties: false
      description: The schema of setting.
    bytebase.v1.Setting.SettingName:
      type: string
      title: SettingName
      enum:
        - SETTING_NAME_UNSPECIFIED
        - WORKSPACE_PROFILE
        - WORKSPACE_APPROVAL
        - APP_IM
        - AI
        - DATA_CLASSIFICATION
        - SEMANTIC_TYPES
        - ENVIRONMENT
        - EMAIL
        - MCP
        - EXPORT
    bytebase.v1.SettingValue:
      type: object
      anyOf:
        - type: object
          properties:
            ai:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AISetting'
              title: ai
          title: ai
        - type: object
          properties:
            appIm:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.AppIMSetting'
              title: app_im
          title: app_im
        - type: object
          properties:
            dataClassification:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting'
              title: data_classification
          title: data_classification
        - type: object
          properties:
            email:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.EmailSetting'
              title: email
          title: email
        - type: object
          properties:
            environment:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.EnvironmentSetting'
              title: environment
          title: environment
        - type: object
          properties:
            export:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ExportSetting'
              title: export
          title: export
        - type: object
          properties:
            mcp:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.MCPSetting'
              title: mcp
          title: mcp
        - type: object
          properties:
            semanticType:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.SemanticTypeSetting'
              title: semantic_type
          title: semantic_type
        - type: object
          properties:
            workspaceApproval:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting'
              title: workspace_approval
          title: workspace_approval
        - type: object
          properties:
            workspaceProfile:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting'
              title: workspace_profile
          title: workspace_profile
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - ai
              - required:
                  - appIm
              - required:
                  - dataClassification
              - required:
                  - email
              - required:
                  - environment
              - required:
                  - export
              - required:
                  - mcp
              - required:
                  - semanticType
              - required:
                  - workspaceApproval
              - required:
                  - workspaceProfile
          - not:
              oneOf:
                - required:
                    - ai
                - required:
                    - appIm
                - required:
                    - dataClassification
                - required:
                    - email
                - required:
                    - environment
                - required:
                    - export
                - required:
                    - mcp
                - required:
                    - semanticType
                - required:
                    - workspaceApproval
                - required:
                    - workspaceProfile
      title: SettingValue
      description: The data in setting value.
    bytebase.v1.SharePointDestination:
      type: object
      properties:
        url:
          type: string
          title: url
          description: |-
            The URL of the library root or folder. Normalized to its canonical form
             and resolved with the workspace credentials on save.
      title: SharePointDestination
      additionalProperties: false
      description: A SharePoint document library root or folder that receives exports.
    bytebase.v1.SharePointSetting:
      type: object
      properties:
        tenantId:
          type: string
          title: tenant_id
          description: The Microsoft Entra tenant (directory) ID.
        clientId:
          type: string
          title: client_id
          description: The application (client) ID.
        clientSecret:
          type: string
          title: client_secret
          description: The client secret. It is never returned.
          writeOnly: true
        clientSecretSet:
          type: boolean
          title: client_secret_set
          description: Whether a client secret is stored.
          readOnly: true
      title: SharePointSetting
      additionalProperties: false
      description: |-
        SharePointSetting is the Microsoft Entra application that uploads exports to
         SharePoint. It is granted access per library by the customer's SharePoint
         administrators.
    bytebase.v1.Sheet:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            (IMMUTABLE) The name of the sheet resource.
             Format: projects/{project}/sheets/{sheet}
             The sheet ID is generated by the server on creation and cannot be changed.
        content:
          type: string
          title: content
          format: byte
          description: |-
            The content of the sheet.
             By default, it will be cut off, if it doesn't match the `content_size`, you can
             set the `raw` to true in GetSheet request to retrieve the full content.
        contentSize:
          type: string
          title: content_size
          format: int64
          description: content_size is the full size of the content, may not match the size of the `content` field.
          readOnly: true
      title: Sheet
      required:
        - name
        - content
      additionalProperties: false
    bytebase.v1.SignupRequest:
      type: object
      properties:
        email:
          type: string
          title: email
          maxLength: 254
          description: |-
            The email for the new account.
             Bounded so an oversized identity is refused at the edge before any
             handler runs; the login-attempt lockout keys rows by this value.
        password:
          type: string
          title: password
          description: |
            The password for the new account.
            string.max_bytes = 72
        title:
          type: string
          title: title
          maxLength: 200
          description: The display name of the user.
      title: SignupRequest
      additionalProperties: false
    bytebase.v1.SpatialIndexConfig:
      type: object
      properties:
        method:
          type: string
          title: method
          description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
        tessellation:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TessellationConfig'
          title: tessellation
          description: Tessellation configuration for grid-based spatial indexes
        storage:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.StorageConfig'
          title: storage
          description: Storage and performance configuration
        dimensional:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DimensionalConfig'
          title: dimensional
          description: Dimensional configuration
      title: SpatialIndexConfig
      additionalProperties: false
      description: SpatialIndexConfig defines the spatial index configuration for spatial databases.
    bytebase.v1.Stage:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
             Use "-" for {stage} when the stage has no environment or deleted environment.
        id:
          type: string
          title: id
          description: |-
            id is the environment id of the stage.
             e.g., "prod".
             Use "-" when the stage has no environment or deleted environment.
          readOnly: true
        environment:
          type: string
          title: environment
          description: |-
            environment is the environment of the stage.
             Format: environments/{environment} for valid environments, or "environments/-" for stages without environment or with deleted environments.
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Task'
          title: tasks
          description: The tasks within this stage.
      title: Stage
      additionalProperties: false
    bytebase.v1.StartMFAEnrollmentRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          maxLength: 260
          description: 'Format: users/{email}. Must be the caller''s own name.'
      title: StartMFAEnrollmentRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.StartMFAEnrollmentResponse:
      type: object
      properties:
        otpSecret:
          type: string
          title: otp_secret
          description: |-
            The pending TOTP secret. The only response that carries it — it is never
             readable from the User resource.
        recoveryCodes:
          type: array
          items:
            type: string
          title: recovery_codes
          description: The pending recovery codes, shown once for the caller to save.
        expireTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: expire_time
          description: When this enrollment stops being confirmable.
        pendingVersion:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: pending_version
          description: |-
            Identifies this mint. Echo it back to EnableMFA and
             ConfirmRecoveryCodes; a mint from another tab or device replaces the
             pending state, and those methods refuse a version that is no longer the
             pending one rather than promoting something this caller never saw.
      title: StartMFAEnrollmentResponse
      additionalProperties: false
    bytebase.v1.StartTrialRequest:
      type: object
      title: StartTrialRequest
      additionalProperties: false
    bytebase.v1.State:
      type: string
      title: State
      enum:
        - STATE_UNSPECIFIED
        - ACTIVE
        - DELETED
      description: Resource lifecycle state.
    bytebase.v1.StatementAnchor:
      type: object
      properties:
        spec:
          type: string
          title: spec
          description: The Plan.Spec.id in the issue's plan; may no longer resolve after deletion.
        sheetSha256:
          type: string
          title: sheet_sha256
          description: SHA256 of the saved sheet, as 64 lowercase hexadecimal characters.
        startPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: start_position
          description: |-
            One-based lines and Unicode code-point columns. When both columns are zero,
             the range covers whole lines, including the end line. Otherwise both columns
             must be positive, start_position is inclusive, and end_position is exclusive.
        endPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: end_position
      title: StatementAnchor
      additionalProperties: false
      description: |-
        The saved statement revision and range referenced by a comment.
         Source currency is derived by comparing the spec and hash with the current plan.
         Historical SQL is available through SheetService.GetSheet with this hash.
    bytebase.v1.StatementType:
      type: string
      title: StatementType
      enum:
        - STATEMENT_TYPE_UNSPECIFIED
        - CREATE_DATABASE
        - CREATE_TABLE
        - CREATE_VIEW
        - CREATE_INDEX
        - CREATE_SEQUENCE
        - CREATE_SCHEMA
        - CREATE_FUNCTION
        - CREATE_TRIGGER
        - CREATE_PROCEDURE
        - CREATE_EVENT
        - CREATE_EXTENSION
        - CREATE_TYPE
        - DROP_DATABASE
        - DROP_TABLE
        - DROP_VIEW
        - DROP_INDEX
        - DROP_SEQUENCE
        - DROP_SCHEMA
        - DROP_FUNCTION
        - DROP_TRIGGER
        - DROP_PROCEDURE
        - DROP_EVENT
        - DROP_EXTENSION
        - DROP_TYPE
        - ALTER_DATABASE
        - ALTER_TABLE
        - ALTER_VIEW
        - ALTER_SEQUENCE
        - ALTER_EVENT
        - ALTER_TYPE
        - ALTER_INDEX
        - TRUNCATE
        - RENAME
        - RENAME_INDEX
        - RENAME_SCHEMA
        - RENAME_SEQUENCE
        - COMMENT
        - INSERT
        - UPDATE
        - DELETE
        - MERGE
      description: StatementType represents the type of SQL statement.
    bytebase.v1.StorageConfig:
      type: object
      properties:
        fillfactor:
          type: integer
          title: fillfactor
          format: int32
          description: Fill factor percentage (1-100)
        buffering:
          type: string
          title: buffering
          description: Buffering mode for PostgreSQL (auto, on, off)
        tablespace:
          type: string
          title: tablespace
          description: Tablespace configuration for Oracle
        workTablespace:
          type: string
          title: work_tablespace
        sdoLevel:
          type: integer
          title: sdo_level
          format: int32
        commitInterval:
          type: integer
          title: commit_interval
          format: int32
        padIndex:
          type: boolean
          title: pad_index
          description: SQL Server specific parameters
        sortInTempdb:
          type: string
          title: sort_in_tempdb
          description: ON, OFF
        dropExisting:
          type: boolean
          title: drop_existing
        online:
          type: boolean
          title: online
        allowRowLocks:
          type: boolean
          title: allow_row_locks
        allowPageLocks:
          type: boolean
          title: allow_page_locks
        maxdop:
          type: integer
          title: maxdop
          format: int32
        dataCompression:
          type: string
          title: data_compression
          description: NONE, ROW, PAGE
      title: StorageConfig
      additionalProperties: false
      description: StorageConfig defines storage and performance parameters for spatial indexes.
    bytebase.v1.StreamMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a stream.
        tableName:
          type: string
          title: table_name
          description: The table_name is the name of the table/view that the stream is created on.
        owner:
          type: string
          title: owner
          description: The owner of the stream.
        comment:
          type: string
          title: comment
          description: The comment of the stream.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Type'
          title: type
          description: The type of the stream.
        stale:
          type: boolean
          title: stale
          description: Indicates whether the stream was last read before the `stale_after` time.
        mode:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Mode'
          title: mode
          description: The mode of the stream.
        definition:
          type: string
          title: definition
          description: The definition of the stream.
      title: StreamMetadata
      additionalProperties: false
    bytebase.v1.StreamMetadata.Mode:
      type: string
      title: Mode
      enum:
        - MODE_UNSPECIFIED
        - DEFAULT
        - APPEND_ONLY
        - INSERT_ONLY
    bytebase.v1.StreamMetadata.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - DELTA
    bytebase.v1.Subscription:
      type: object
      properties:
        plan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanType'
          title: plan
          readOnly: true
        seats:
          type: integer
          title: seats
          format: int32
          readOnly: true
        instances:
          type: integer
          title: instances
          format: int32
          readOnly: true
        activeInstances:
          type: integer
          title: active_instances
          format: int32
          readOnly: true
        expiresTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: expires_time
          readOnly: true
        trialing:
          type: boolean
          title: trialing
          readOnly: true
        orgName:
          type: string
          title: org_name
          readOnly: true
        ha:
          type: boolean
          title: ha
          description: Whether high availability (multiple replicas) is enabled.
          readOnly: true
        etag:
          type: string
          title: etag
          description: Etag for optimistic concurrency on purchase updates. Only set in SaaS mode.
          readOnly: true
      title: Subscription
      additionalProperties: false
    bytebase.v1.SwitchWorkspaceRequest:
      type: object
      properties:
        workspace:
          type: string
          title: workspace
          maxLength: 256
          description: |-
            The target workspace to switch to.
             Format: workspaces/{workspace}
        web:
          type: boolean
          title: web
          description: If true, sets tokens as HTTP-only cookies (browser clients).
        otpCode:
          type:
            - string
            - "null"
          title: otp_code
          maxLength: 64
          description: OTP code for MFA verification. Required if the target workspace enforces MFA.
        recoveryCode:
          type:
            - string
            - "null"
          title: recovery_code
          maxLength: 64
          description: Recovery code for MFA verification (alternative to otp_code).
        mfaTempToken:
          type:
            - string
            - "null"
          title: mfa_temp_token
          maxLength: 4096
          description: Temporary MFA token from a previous SwitchWorkspace call that returned mfa_temp_token.
      title: SwitchWorkspaceRequest
      additionalProperties: false
    bytebase.v1.SyncDatabaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the database to sync.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
      title: SyncDatabaseRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.SyncDatabaseResponse:
      type: object
      title: SyncDatabaseResponse
      additionalProperties: false
    bytebase.v1.SyncDatabases:
      type: object
      properties:
        databases:
          type: array
          items:
            type: string
          title: databases
      title: SyncDatabases
      additionalProperties: false
    bytebase.v1.SyncInstanceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        enableFullSync:
          type: boolean
          title: enable_full_sync
          description: |-
            When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
             the instance metadata (such as the database list) and any newly discovered databases will be synced.
      title: SyncInstanceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.SyncInstanceResponse:
      type: object
      properties:
        databases:
          type: array
          items:
            type: string
          title: databases
          description: All database name list in the instance.
      title: SyncInstanceResponse
      additionalProperties: false
    bytebase.v1.SyncStatus:
      type: string
      title: SyncStatus
      enum:
        - SYNC_STATUS_UNSPECIFIED
        - OK
        - FAILED
      description: SyncStatus is the status of the database sync operation.
    bytebase.v1.TableCatalog:
      type: object
      anyOf:
        - type: object
          properties:
            columns:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.TableCatalog.Columns'
              title: columns
              description: Regular table columns.
          title: columns
        - type: object
          properties:
            objectSchema:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
              title: object_schema
              description: Object schema for JSON/XML columns.
          title: object_schema
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - columns
              - required:
                  - objectSchema
          - not:
              oneOf:
                - required:
                    - columns
                - required:
                    - objectSchema
      properties:
        name:
          type: string
          title: name
          description: The table name.
        classification:
          type: string
          title: classification
          description: The data classification level for this table.
      title: TableCatalog
      description: Table metadata within a schema.
    bytebase.v1.TableCatalog.Columns:
      type: object
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ColumnCatalog'
          title: columns
          description: The columns in the table.
      title: Columns
      additionalProperties: false
      description: Column list for regular tables.
    bytebase.v1.TableMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a table.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
          title: columns
          description: The columns is the ordered list of columns in a table.
        indexes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
          title: indexes
          description: The indexes is the list of indexes in a table.
        engine:
          type: string
          title: engine
          description: The engine is the engine of a table.
        collation:
          type: string
          title: collation
          description: The collation is the collation of a table.
        charset:
          type: string
          title: charset
          description: The character set of table.
        rowCount:
          type: string
          title: row_count
          format: int64
          description: The row_count is the estimated number of rows of a table.
        dataSize:
          type: string
          title: data_size
          format: int64
          description: The data_size is the estimated data size of a table.
        indexSize:
          type: string
          title: index_size
          format: int64
          description: The index_size is the estimated index size of a table.
        dataFree:
          type: string
          title: data_free
          format: int64
          description: The data_free is the estimated free data size of a table.
        createOptions:
          type: string
          title: create_options
          description: The create_options is the create option of a table.
        comment:
          type: string
          title: comment
          description: The comment is the comment of a table.
        foreignKeys:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ForeignKeyMetadata'
          title: foreign_keys
          description: The foreign_keys is the list of foreign keys in a table.
        partitions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata'
          title: partitions
          description: The partitions is the list of partitions in a table.
        checkConstraints:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CheckConstraintMetadata'
          title: check_constraints
          description: The check_constraints is the list of check constraints in a table.
        owner:
          type: string
          title: owner
          description: The owner of the table.
        sortingKeys:
          type: array
          items:
            type: string
          title: sorting_keys
          description: |-
            The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
             Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
          title: triggers
          description: The triggers is the list of triggers associated with the table.
        skipDump:
          type: boolean
          title: skip_dump
          description: Whether to skip this table during schema dump operations.
        shardingInfo:
          type: string
          title: sharding_info
          description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
        primaryKeyType:
          type: string
          title: primary_key_type
          description: |-
            https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
             CLUSTERED or NONCLUSTERED.
      title: TableMetadata
      additionalProperties: false
      description: TableMetadata is the metadata for tables.
    bytebase.v1.TablePartitionMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a table partition.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata.Type'
          title: type
          description: The type of a table partition.
        expression:
          type: string
          title: expression
          description: |-
            The expression is the expression of a table partition.
             For PostgreSQL, the expression is the text of {FOR VALUES
             partition_bound_spec}, see
             https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
             the expression is the `expr` or `column_list` of the following syntax.
             PARTITION BY
                { [LINEAR] HASH(expr)
                | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
                | RANGE{(expr) | COLUMNS(column_list)}
                | LIST{(expr) | COLUMNS(column_list)} }.
        value:
          type: string
          title: value
          description: |-
            The value is the value of a table partition.
             For MySQL, the value is for RANGE and LIST partition types,
             - For a RANGE partition, it contains the value set in the partition's
             VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
             - For a LIST partition, this column contains the values defined in the
             partition's VALUES IN clause, which is a list of comma-separated integer
             values.
             - For others, it's an empty string.
        useDefault:
          type: string
          title: use_default
          description: |-
            The use_default is whether the users use the default partition, it stores
             the different value for different database engines. For MySQL, it's [INT]
             type, 0 means not use default partition, otherwise, it's equals to number
             in syntax [SUB]PARTITION {number}.
        subpartitions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata'
          title: subpartitions
          description: The subpartitions is the list of subpartitions in a table partition.
        indexes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
          title: indexes
        checkConstraints:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.CheckConstraintMetadata'
          title: check_constraints
      title: TablePartitionMetadata
      additionalProperties: false
      description: TablePartitionMetadata is the metadata for table partitions.
    bytebase.v1.TablePartitionMetadata.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - RANGE
        - RANGE_COLUMNS
        - LIST
        - LIST_COLUMNS
        - HASH
        - LINEAR_HASH
        - KEY
        - LINEAR_KEY
      description: |-
        Type is the type of a table partition, some database engines may not
         support all types. Only avilable for the following database engines now:
         MySQL: RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, LINEAR HASH, KEY,
         LINEAR_KEY
         (https://dev.mysql.com/doc/refman/8.0/en/partitioning-types.html) TiDB:
         RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, KEY PostgreSQL: RANGE,
         LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
    bytebase.v1.TagPolicy:
      type: object
      properties:
        tags:
          type: object
          title: tags
          additionalProperties:
            type: string
            title: value
          description: |-
            tags is the key - value map for resources.
             for example, the environment resource can have the sql review config tag, like "bb.tag.review_config": "reviewConfigs/{review config resource id}"
      title: TagPolicy
      additionalProperties: false
      description: Policy for tagging resources with metadata.
    bytebase.v1.Task:
      type: object
      anyOf:
        - type: object
          properties:
            databaseCreate:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Task.DatabaseCreate'
              title: database_create
          title: database_create
        - type: object
          properties:
            databaseUpdate:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.Task.DatabaseUpdate'
              title: database_update
          title: database_update
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - databaseCreate
              - required:
                  - databaseUpdate
          - not:
              oneOf:
                - required:
                    - databaseCreate
                - required:
                    - databaseUpdate
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}'
        specId:
          type: string
          title: spec_id
          description: A UUID4 string that uniquely identifies the Spec.
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Task.Status'
          title: status
          description: Status is the status of the task.
        skippedReason:
          type: string
          title: skipped_reason
          description: The reason why the task was skipped.
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Task.Type'
          title: type
        target:
          type: string
          title: target
          description: |-
            Format: instances/{instance} or projects/{project}/instances/{instance} if the task is DatabaseCreate.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        updateTime:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: update_time
          description: |-
            The update_time is the update time of latest task run.
             If there are no task runs, it will be empty.
          readOnly: true
        runTime:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: run_time
          description: |-
            The run_time is the scheduled run time of latest task run.
             If there are no task runs or the task run is not scheduled, it will be empty.
          readOnly: true
      title: Task
    bytebase.v1.Task.DatabaseCreate:
      type: object
      properties:
        sheet:
          type: string
          title: sheet
          description: 'Format: projects/{project}/sheets/{sheet}'
      title: DatabaseCreate
      additionalProperties: false
      description: Payload for creating a new database.
    bytebase.v1.Task.DatabaseUpdate:
      type: object
      anyOf:
        - type: object
          properties:
            release:
              type: string
              title: release
              description: 'Format: projects/{project}/releases/{release}'
          title: release
        - type: object
          properties:
            sheet:
              type: string
              title: sheet
              description: 'Format: projects/{project}/sheets/{sheet}'
          title: sheet
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - release
              - required:
                  - sheet
          - not:
              oneOf:
                - required:
                    - release
                - required:
                    - sheet
      title: DatabaseUpdate
      description: Payload for updating a database schema.
    bytebase.v1.Task.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - NOT_STARTED
        - PENDING
        - RUNNING
        - DONE
        - FAILED
        - CANCELED
        - SKIPPED
    bytebase.v1.Task.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - GENERAL
        - DATABASE_CREATE
        - DATABASE_MIGRATE
    bytebase.v1.TaskMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a task.
        id:
          type: string
          title: id
          description: |-
            The id is the snowflake-generated id of a task.
             Example: 01ad32a0-1bb6-5e93-0000-000000000001
        owner:
          type: string
          title: owner
          description: The owner of the task.
        comment:
          type: string
          title: comment
          description: The comment of the task.
        warehouse:
          type: string
          title: warehouse
          description: The warehouse of the task.
        schedule:
          type: string
          title: schedule
          description: The schedule interval of the task.
        predecessors:
          type: array
          items:
            type: string
          title: predecessors
          description: The predecessor tasks of the task.
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskMetadata.State'
          title: state
          description: The state of the task.
        condition:
          type: string
          title: condition
          description: The condition of the task.
        definition:
          type: string
          title: definition
          description: The definition of the task.
      title: TaskMetadata
      additionalProperties: false
    bytebase.v1.TaskMetadata.State:
      type: string
      title: State
      enum:
        - STATE_UNSPECIFIED
        - STARTED
        - SUSPENDED
    bytebase.v1.TaskRun:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
        creator:
          type: string
          title: creator
          description: 'Format: users/hello@world.com'
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          readOnly: true
        updateTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: update_time
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRun.Status'
          title: status
          description: The current execution status of the task run.
        detail:
          type: string
          title: detail
          description: |-
            Below are the results of a task run.
             Detailed information about the task run result.
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: The time when the task run started execution.
          readOnly: true
        hasPriorBackup:
          type: boolean
          title: has_prior_backup
          description: |-
            Indicates whether a prior backup was created for this task run.
             When true, rollback SQL can be generated via PreviewTaskRunRollback.
             Backup details are available in the task run logs.
        schedulerInfo:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRun.SchedulerInfo'
          title: scheduler_info
          description: Scheduling information about the task run.
          readOnly: true
        runTime:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: run_time
          description: |-
            The task run should run after run_time.
             This can only be set when creating the task run calling BatchRunTasks.
          readOnly: true
      title: TaskRun
      additionalProperties: false
    bytebase.v1.TaskRun.SchedulerInfo:
      type: object
      properties:
        reportTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: report_time
          description: The time when the scheduling info was reported.
        waitingCause:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRun.SchedulerInfo.WaitingCause'
          title: waiting_cause
          description: The cause for the task run waiting.
      title: SchedulerInfo
      additionalProperties: false
      description: Information about task run scheduling.
    bytebase.v1.TaskRun.SchedulerInfo.WaitingCause:
      type: object
      anyOf:
        - type: object
          properties:
            parallelTasksLimit:
              type: boolean
              title: parallel_tasks_limit
              description: Waiting due to parallel tasks limit.
          title: parallel_tasks_limit
      unevaluatedProperties: false
      title: WaitingCause
      description: Information about why a task run is waiting.
    bytebase.v1.TaskRun.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - PENDING
        - RUNNING
        - DONE
        - FAILED
        - CANCELED
        - AVAILABLE
    bytebase.v1.TaskRunLog:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/log'
        entries:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry'
          title: entries
          description: The log entries for this task run.
      title: TaskRunLog
      additionalProperties: false
    bytebase.v1.TaskRunLogEntry:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.Type'
          title: type
          description: The type of this log entry.
        logTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: log_time
          description: The time when the log was recorded.
        replicaId:
          type: string
          title: replica_id
          description: The replica ID for this log entry.
        schemaDump:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.SchemaDump'
          title: schema_dump
          description: Schema dump details (if type is SCHEMA_DUMP).
        commandExecute:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.CommandExecute'
          title: command_execute
          description: Command execution details (if type is COMMAND_EXECUTE).
        databaseSync:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.DatabaseSync'
          title: database_sync
          description: Database sync details (if type is DATABASE_SYNC).
        transactionControl:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TransactionControl'
          title: transaction_control
          description: Transaction control details (if type is TRANSACTION_CONTROL).
        priorBackup:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup'
          title: prior_backup
          description: Prior backup details (if type is PRIOR_BACKUP).
        retryInfo:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.RetryInfo'
          title: retry_info
          description: Retry information details (if type is RETRY_INFO).
        computeDiff:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.ComputeDiff'
          title: compute_diff
          description: Compute diff details (if type is COMPUTE_DIFF).
        releaseFileExecute:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.ReleaseFileExecute'
          title: release_file_execute
          description: Release file execution details (if type is RELEASE_FILE_EXECUTE).
        ghostMigration:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.GhostMigration'
          title: ghost_migration
          description: gh-ost migration details (if type is GHOST_MIGRATION).
      title: TaskRunLogEntry
      additionalProperties: false
    bytebase.v1.TaskRunLogEntry.CommandExecute:
      type: object
      properties:
        logTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: log_time
          description: When the command was logged.
        range:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Range'
          title: range
          description: |-
            The byte offset range of the executed command in the sheet.
             Uses byte offsets (not character indices) for efficient slicing of sheet content bytes.
             Example: For "SELECT 你好;" in a UTF-8 sheet, range [0, 13) represents all 13 bytes.
        statement:
          type: string
          title: statement
          description: The executed statement.
        response:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.CommandExecute.CommandResponse'
          title: response
          description: The response from executing the command.
      title: CommandExecute
      additionalProperties: false
      description: Command execution details.
    bytebase.v1.TaskRunLogEntry.CommandExecute.CommandResponse:
      type: object
      properties:
        logTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: log_time
          description: When the response was logged.
        error:
          type: string
          title: error
          description: Error message if command execution failed.
        affectedRows:
          type: string
          title: affected_rows
          format: int64
          description: Total affected rows.
        allAffectedRows:
          type: array
          items:
            type: string
            format: int64
          title: all_affected_rows
          description: |-
            `all_affected_rows` is the affected rows of each command.
             `all_affected_rows` may be unavailable if the database driver doesn't support it. Caller should fallback to `affected_rows` in that case.
      title: CommandResponse
      additionalProperties: false
      description: Command execution response.
    bytebase.v1.TaskRunLogEntry.ComputeDiff:
      type: object
      properties:
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: When diff computation started.
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: When diff computation ended.
        error:
          type: string
          title: error
          description: Error message if computation failed.
      title: ComputeDiff
      additionalProperties: false
      description: Schema diff computation details.
    bytebase.v1.TaskRunLogEntry.DatabaseSync:
      type: object
      properties:
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: When the database sync started.
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: When the database sync ended.
        error:
          type: string
          title: error
          description: Error message if sync failed.
      title: DatabaseSync
      additionalProperties: false
      description: Database synchronization details.
    bytebase.v1.TaskRunLogEntry.GhostMigration:
      type: object
      properties:
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: When the gh-ost migration started.
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: When the gh-ost migration ended.
        error:
          type: string
          title: error
          description: Error message if the gh-ost migration failed.
      title: GhostMigration
      additionalProperties: false
      description: gh-ost migration details.
    bytebase.v1.TaskRunLogEntry.PriorBackup:
      type: object
      properties:
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: When the backup started.
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: When the backup ended.
        priorBackupDetail:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail'
          title: prior_backup_detail
          description: The backup details.
        error:
          type: string
          title: error
          description: Error message if the backup failed.
      title: PriorBackup
      additionalProperties: false
      description: Prior backup operation details.
    bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail.Item'
          title: items
          description: The list of backed up tables.
      title: PriorBackupDetail
      additionalProperties: false
      description: Prior backup detail for rollback purposes.
    bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail.Item:
      type: object
      properties:
        sourceTable:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail.Item.Table'
          title: source_table
          description: The original table information.
        targetTable:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail.Item.Table'
          title: target_table
          description: The target backup table information.
        startPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: start_position
          description: The start position in the SQL statement.
        endPosition:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Position'
          title: end_position
          description: The end position in the SQL statement.
      title: Item
      additionalProperties: false
      description: A single backup table mapping.
    bytebase.v1.TaskRunLogEntry.PriorBackup.PriorBackupDetail.Item.Table:
      type: object
      properties:
        database:
          type: string
          title: database
          description: |-
            The database information.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        schema:
          type: string
          title: schema
          description: The schema name.
        table:
          type: string
          title: table
          description: The table name.
      title: Table
      additionalProperties: false
      description: Table information.
    bytebase.v1.TaskRunLogEntry.ReleaseFileExecute:
      type: object
      properties:
        version:
          type: string
          title: version
          description: The version of the file being executed (e.g., "0001").
        filePath:
          type: string
          title: file_path
          description: The file path within the release (e.g., "2.2/V0001_create_table.sql").
      title: ReleaseFileExecute
      additionalProperties: false
      description: Release file execution details.
    bytebase.v1.TaskRunLogEntry.RetryInfo:
      type: object
      properties:
        error:
          type: string
          title: error
          description: The error that triggered the retry.
        retryCount:
          type: integer
          title: retry_count
          format: int32
          description: Current retry attempt number.
        maximumRetries:
          type: integer
          title: maximum_retries
          format: int32
          description: Maximum number of retries allowed.
      title: RetryInfo
      additionalProperties: false
      description: Retry information for failed operations.
    bytebase.v1.TaskRunLogEntry.SchemaDump:
      type: object
      properties:
        startTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start_time
          description: When the schema dump started.
        endTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end_time
          description: When the schema dump ended.
        error:
          type: string
          title: error
          description: Error message if the schema dump failed.
      title: SchemaDump
      additionalProperties: false
      description: Schema dump operation details.
    bytebase.v1.TaskRunLogEntry.TransactionControl:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TransactionControl.Type'
          title: type
          description: The type of transaction control.
        error:
          type: string
          title: error
          description: Error message if the operation failed.
      title: TransactionControl
      additionalProperties: false
      description: Transaction control operation details.
    bytebase.v1.TaskRunLogEntry.TransactionControl.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - BEGIN
        - COMMIT
        - ROLLBACK
      description: Transaction control type.
    bytebase.v1.TaskRunLogEntry.Type:
      type: string
      title: Type
      enum:
        - TYPE_UNSPECIFIED
        - SCHEMA_DUMP
        - COMMAND_EXECUTE
        - DATABASE_SYNC
        - TRANSACTION_CONTROL
        - PRIOR_BACKUP
        - RETRY_INFO
        - COMPUTE_DIFF
        - RELEASE_FILE_EXECUTE
        - GHOST_MIGRATION
      description: The type of log entry.
    bytebase.v1.TaskRunSession:
      type: object
      anyOf:
        - type: object
          properties:
            postgres:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres'
              title: postgres
              description: PostgreSQL session information.
          title: postgres
      unevaluatedProperties: false
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/session'
      title: TaskRunSession
    bytebase.v1.TaskRunSession.Postgres:
      type: object
      properties:
        session:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
          title: session
          description: '`session` is the session of the task run executing commands.'
        blockingSessions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
          title: blocking_sessions
          description: '`blocking_sessions` block `session`.'
        blockedSessions:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
          title: blocked_sessions
          description: '`blocked_sessions` are blocked by `session`.'
      title: Postgres
      additionalProperties: false
      description: PostgreSQL session information.
    bytebase.v1.TaskRunSession.Postgres.Session:
      type: object
      properties:
        pid:
          type: string
          title: pid
          description: Process ID of the session.
        blockedByPids:
          type: array
          items:
            type: string
          title: blocked_by_pids
          description: PIDs of sessions blocking this session.
        query:
          type: string
          title: query
          description: Current query being executed.
        state:
          type:
            - string
            - "null"
          title: state
          description: Session state (active, idle, etc.).
        waitEventType:
          type:
            - string
            - "null"
          title: wait_event_type
          description: Wait event type if session is waiting.
        waitEvent:
          type:
            - string
            - "null"
          title: wait_event
          description: Specific wait event if session is waiting.
        datname:
          type:
            - string
            - "null"
          title: datname
          description: Database name.
        usename:
          type:
            - string
            - "null"
          title: usename
          description: User name.
        applicationName:
          type: string
          title: application_name
          description: Application name.
        clientAddr:
          type:
            - string
            - "null"
          title: client_addr
          description: Client IP address.
        clientPort:
          type:
            - string
            - "null"
          title: client_port
          description: Client port number.
        backendStart:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: backend_start
          description: When the backend process started.
        xactStart:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: xact_start
          description: When the current transaction started.
        queryStart:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: "null"
          title: query_start
          description: When the current query started.
      title: Session
      additionalProperties: false
      description: PostgreSQL session information read from `pg_stat_activity`.
    bytebase.v1.TessellationConfig:
      type: object
      properties:
        scheme:
          type: string
          title: scheme
          description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
        gridLevels:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.GridLevel'
          title: grid_levels
          description: Grid levels and densities for multi-level tessellation
        cellsPerObject:
          type: integer
          title: cells_per_object
          format: int32
          description: Number of cells per object (1-8192 for SQL Server)
        boundingBox:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.BoundingBox'
          title: bounding_box
          description: Bounding box for GEOMETRY tessellation (not used for GEOGRAPHY)
      title: TessellationConfig
      additionalProperties: false
      description: TessellationConfig defines tessellation parameters for spatial indexes.
    bytebase.v1.TestEmailSettingRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
        emailSetting:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.EmailSetting'
          title: email_setting
        to:
          type: string
          title: to
      title: TestEmailSettingRequest
      required:
        - parent
        - emailSetting
        - to
      additionalProperties: false
    bytebase.v1.TestEmailSettingResponse:
      type: object
      properties:
        success:
          type: boolean
          title: success
        error:
          type: string
          title: error
      title: TestEmailSettingResponse
      additionalProperties: false
    bytebase.v1.TestIdentityProviderRequest:
      type: object
      anyOf:
        - type: object
          properties:
            ldapContext:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderTestRequestContext'
              title: ldap_context
              description: LDAP credentials context for test connection.
          title: ldap_context
        - type: object
          properties:
            oauth2Context:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderTestRequestContext'
              title: oauth2_context
          title: oauth2_context
        - type: object
          properties:
            oidcContext:
              allOf:
                - $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderTestRequestContext'
              title: oidc_context
              description: OIDC authentication context for test connection.
          title: oidc_context
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - ldapContext
              - required:
                  - oauth2Context
              - required:
                  - oidcContext
          - not:
              oneOf:
                - required:
                    - ldapContext
                - required:
                    - oauth2Context
                - required:
                    - oidcContext
      properties:
        identityProvider:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
          title: identity_provider
          description: The identity provider to test connection including uncreated.
      title: TestIdentityProviderRequest
    bytebase.v1.TestIdentityProviderResponse:
      type: object
      properties:
        claims:
          type: object
          title: claims
          additionalProperties:
            type: string
            title: value
          description: The map of claims returned by the identity provider.
        userInfo:
          type: object
          title: user_info
          additionalProperties:
            type: string
            title: value
          description: The matched user info from the claims.
      title: TestIdentityProviderResponse
      additionalProperties: false
    bytebase.v1.TestWebhookRequest:
      type: object
      properties:
        project:
          type: string
          title: project
          description: |-
            The name of the project which owns the webhook to test.
             Format: projects/{project}
        webhook:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Webhook'
          title: webhook
          description: |-
            The webhook to test.

             The url is what gets posted to. Reads do not return a saved webhook's url,
             so leave url empty and set name to test the one already stored; set url to
             test a url before saving it.
      title: TestWebhookRequest
      required:
        - project
        - webhook
      additionalProperties: false
    bytebase.v1.TestWebhookResponse:
      type: object
      properties:
        error:
          type: string
          title: error
          description: The result of the test, empty if the test is successful.
      title: TestWebhookResponse
      additionalProperties: false
    bytebase.v1.TriggerMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of the trigger.
        event:
          type: string
          title: event
          description: |-
            The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
             TRUNCATE.
        timing:
          type: string
          title: timing
          description: The timing is the timing of the trigger, such as BEFORE, AFTER.
        body:
          type: string
          title: body
          description: The body is the body of the trigger.
        sqlMode:
          type: string
          title: sql_mode
          description: The SQL mode setting for the trigger.
        characterSetClient:
          type: string
          title: character_set_client
          description: The character set used by the client creating the trigger.
        collationConnection:
          type: string
          title: collation_connection
          description: The collation used for the connection when creating the trigger.
        comment:
          type: string
          title: comment
          description: The comment describing the trigger.
        skipDump:
          type: boolean
          title: skip_dump
          description: Whether to skip this trigger during schema dump operations.
      title: TriggerMetadata
      additionalProperties: false
    bytebase.v1.UndeleteInstanceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted instance.
             Format: instances/{instance} or projects/{project}/instances/{instance}
      title: UndeleteInstanceRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.UndeleteProjectRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted project.
             Format: projects/{project}
      title: UndeleteProjectRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.UndeleteReleaseRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted release.
             Format: projects/{project}/releases/{release}
      title: UndeleteReleaseRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.UndeleteServiceAccountRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted service account.
             Format: serviceAccounts/{email}
      title: UndeleteServiceAccountRequest
      required:
        - name
      additionalProperties: false
      description: Request message for restoring a deleted service account.
    bytebase.v1.UndeleteUserRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted user.
             Format: users/{email}
      title: UndeleteUserRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.UndeleteWorkloadIdentityRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the deleted workload identity.
             Format: workloadIdentities/{email}
      title: UndeleteWorkloadIdentityRequest
      required:
        - name
      additionalProperties: false
      description: Request message for restoring a deleted workload identity.
    bytebase.v1.UpdateDataSourceRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the instance to update a data source.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        dataSource:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DataSource'
          title: data_source
          description: Identified by data source ID.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        validateOnly:
          type: boolean
          title: validate_only
          description: Validate only also tests the data source connection.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the data source is not found, a new data source will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateDataSourceRequest
      required:
        - name
        - dataSource
      additionalProperties: false
    bytebase.v1.UpdateDatabaseCatalogRequest:
      type: object
      properties:
        catalog:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
          title: catalog
          description: |-
            The database catalog to update, identified by its `name` field.
             Format: instances/{instance}/databases/{database}/catalog or projects/{project}/instances/{instance}/databases/{database}/catalog

             Replaces the whole catalog: send the complete value, since anything omitted
             is erased. There is no `update_mask` because `schemas` is a repeated field,
             and AIP-161 forbids addressing one element of one.
      title: UpdateDatabaseCatalogRequest
      required:
        - catalog
      additionalProperties: false
      description: Request message for updating a database catalog.
    bytebase.v1.UpdateDatabaseGroupRequest:
      type: object
      properties:
        databaseGroup:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
          title: database_group
          description: |-
            The database group to update.

             The database group's `name` field is used to identify the database group to update.
             Format: projects/{project}/databaseGroups/{databaseGroup}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the database group is not found, a new database group will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateDatabaseGroupRequest
      required:
        - databaseGroup
      additionalProperties: false
      description: Request message for updating a database group.
    bytebase.v1.UpdateDatabaseRequest:
      type: object
      properties:
        database:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Database'
          title: database
          description: |-
            The database to update.

             The database's `name` field is used to identify the database to update.
             Format: instances/{instance}/databases/{database} or projects/{project}/instances/{instance}/databases/{database}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
      title: UpdateDatabaseRequest
      required:
        - database
      additionalProperties: false
    bytebase.v1.UpdateEmailRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the user whose email to update.
             Format: users/{email}
             Note: This is the current (old) email address. The new email is specified in the 'email' field.
        email:
          type: string
          title: email
          maxLength: 254
          description: The new email address.
      title: UpdateEmailRequest
      required:
        - name
        - email
      additionalProperties: false
    bytebase.v1.UpdateGroupRequest:
      type: object
      properties:
        group:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Group'
          title: group
          description: |-
            The group to update.

             The group's `name` field is used to identify the group to update.
             Format: groups/{email}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the group is not found, a new group will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateGroupRequest
      required:
        - group
      additionalProperties: false
      description: Request message for updating a group.
    bytebase.v1.UpdateIdentityProviderRequest:
      type: object
      properties:
        identityProvider:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
          title: identity_provider
          description: |-
            The identity provider to update.

             The identity provider's `name` field is used to identify the identity provider to update.
             Format: idps/{identity_provider}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the identity provider is not found, a new identity provider will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateIdentityProviderRequest
      required:
        - identityProvider
      additionalProperties: false
    bytebase.v1.UpdateInstanceRequest:
      type: object
      properties:
        instance:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Instance'
          title: instance
          description: |-
            The instance to update.

             The instance's `name` field is used to identify the instance to update.
             Format: instances/{instance} or projects/{project}/instances/{instance}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the instance is not found, a new instance will be created.
             In this situation, `update_mask` is ignored. A project-nested name creates
             the instance only under its encoded active, non-default project; it never
             falls back to a workspace instance.
      title: UpdateInstanceRequest
      required:
        - instance
      additionalProperties: false
    bytebase.v1.UpdateIssueCommentRequest:
      type: object
      properties:
        parent:
          type: string
          title: parent
          description: |-
            The issue name
             Format: projects/{project}/issues/{issue}
        issueComment:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.IssueComment'
          title: issue_comment
          description: The comment to update.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the issue comment is not found, a new issue comment will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateIssueCommentRequest
      required:
        - parent
        - updateMask
      additionalProperties: false
    bytebase.v1.UpdateIssueRequest:
      type: object
      properties:
        issue:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Issue'
          title: issue
          description: |-
            The issue to update.

             The issue's `name` field is used to identify the issue to update.
             Format: projects/{project}/issues/{issue}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the issue is not found, a new issue will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateIssueRequest
      required:
        - issue
        - updateMask
      additionalProperties: false
    bytebase.v1.UpdatePlanRequest:
      type: object
      properties:
        plan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Plan'
          title: plan
          description: |-
            The plan to update.

             The plan's `name` field is used to identify the plan to update.
             Format: projects/{project}/plans/{plan}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the plan is not found, a new plan will be created.
             In this situation, `update_mask` is ignored.
      title: UpdatePlanRequest
      required:
        - plan
        - updateMask
      additionalProperties: false
    bytebase.v1.UpdatePolicyRequest:
      type: object
      properties:
        policy:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Policy'
          title: policy
          description: |-
            The policy to update.

             The policy's `name` field is used to identify the instance to update.
             Format: {resource name}/policies/{policy type}
             Workspace resource name: workspaces/{workspace-id}.
             Environment resource name: environments/environment-id.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the policy is not found, a new policy will be created.
             In this situation, `update_mask` is ignored.
      title: UpdatePolicyRequest
      required:
        - policy
      additionalProperties: false
    bytebase.v1.UpdateProjectRequest:
      type: object
      properties:
        project:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Project'
          title: project
          description: |-
            The project to update.

             The project's `name` field is used to identify the project to update.
             Format: projects/{project}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the project is not found, a new project will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateProjectRequest
      required:
        - project
      additionalProperties: false
    bytebase.v1.UpdatePurchaseRequest:
      type: object
      properties:
        plan:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.PlanType'
          title: plan
        interval:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.BillingInterval'
          title: interval
        seats:
          type: integer
          title: seats
          format: int32
        etag:
          type: string
          title: etag
      title: UpdatePurchaseRequest
      additionalProperties: false
    bytebase.v1.UpdateReleaseRequest:
      type: object
      properties:
        release:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Release'
          title: release
          description: The release to update.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to be updated.
      title: UpdateReleaseRequest
      required:
        - release
      additionalProperties: false
    bytebase.v1.UpdateReviewConfigRequest:
      type: object
      properties:
        reviewConfig:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
          title: review_config
          description: |-
            The SQL review config to update.

             The name field is used to identify the SQL review config to update.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the config is not found, a new config will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateReviewConfigRequest
      required:
        - reviewConfig
      additionalProperties: false
    bytebase.v1.UpdateRoleRequest:
      type: object
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Role'
          title: role
          description: The role to update.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the role is not found, a new role will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateRoleRequest
      required:
        - role
      additionalProperties: false
    bytebase.v1.UpdateSavedQueryRequest:
      type: object
      properties:
        savedQuery:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SavedQuery'
          title: saved_query
          description: |-
            `saved_query.name` identifies the saved query to update.
             Format: projects/{project}/savedQueries/{savedQuery}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: |-
            Fields to update, relative to the saved query (`title`, not
             `saved_query.title`). Supported: `title`, `content`, `database`, `folder`.
             At least one path is required.
      title: UpdateSavedQueryRequest
      required:
        - savedQuery
      additionalProperties: false
    bytebase.v1.UpdateSavedQueryStarRequest:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: projects/{project}/savedQueries/{savedQuery}'
        starred:
          type: boolean
          title: starred
          description: Whether the caller stars the saved query.
      title: UpdateSavedQueryStarRequest
      required:
        - name
      additionalProperties: false
    bytebase.v1.UpdateServiceAccountRequest:
      type: object
      properties:
        serviceAccount:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ServiceAccount'
          title: service_account
          description: |-
            The service account to update.

             The service account's `name` field is used to identify the service account to update.
             Format: serviceAccounts/{email}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: |-
            The list of fields to update.
             Supported fields: title, service_key (triggers key rotation)
      title: UpdateServiceAccountRequest
      required:
        - serviceAccount
      additionalProperties: false
      description: Request message for updating a service account.
    bytebase.v1.UpdateSettingRequest:
      type: object
      properties:
        setting:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Setting'
          title: setting
          description: The setting to update.
        validateOnly:
          type: boolean
          title: validate_only
          description: |-
            validate_only is a flag to indicate whether to validate the setting value,
             server would not persist the setting value if it is true.
        allowMissing:
          type: boolean
          title: allow_missing
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
      title: UpdateSettingRequest
      required:
        - setting
      additionalProperties: false
      description: The request message for updating or creating a setting.
    bytebase.v1.UpdateUserRequest:
      type: object
      properties:
        user:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.User'
          title: user
          description: |-
            The user to update.

             The user's `name` field is used to identify the user to update.
             Format: users/{email}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the user is not found, a new user will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateUserRequest
      required:
        - user
      additionalProperties: false
    bytebase.v1.UpdateWebhookRequest:
      type: object
      properties:
        webhook:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Webhook'
          title: webhook
          description: The webhook to modify.
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: The list of fields to update.
        allowMissing:
          type: boolean
          title: allow_missing
          description: |-
            If set to true, and the webhook is not found, a new webhook will be created.
             In this situation, `update_mask` is ignored.
      title: UpdateWebhookRequest
      required:
        - webhook
      additionalProperties: false
    bytebase.v1.UpdateWorkloadIdentityRequest:
      type: object
      properties:
        workloadIdentity:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
          title: workload_identity
          description: |-
            The workload identity to update.

             The workload identity's `name` field is used to identify the workload identity to update.
             Format: workloadIdentities/{email}
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
          description: |-
            The list of fields to update.
             Supported fields: title, workload_identity_config
      title: UpdateWorkloadIdentityRequest
      required:
        - workloadIdentity
      additionalProperties: false
      description: Request message for updating a workload identity.
    bytebase.v1.UpdateWorkspaceRequest:
      type: object
      properties:
        workspace:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Workspace'
          title: workspace
        updateMask:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FieldMask'
          title: update_mask
      title: UpdateWorkspaceRequest
      required:
        - workspace
      additionalProperties: false
    bytebase.v1.UploadLicenseRequest:
      type: object
      properties:
        license:
          type: string
          title: license
      title: UploadLicenseRequest
      additionalProperties: false
    bytebase.v1.User:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the user.
             Format: users/{email}
          readOnly: true
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The lifecycle state of the user account.
        email:
          type: string
          title: email
          maxLength: 254
          description: The email address of the user, used for login and notifications.
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title or full name of the user.
        password:
          type: string
          title: password
          description: |
            The password for authentication. Only used during user creation or password updates.
            string.max_bytes = 72
          writeOnly: true
        mfaEnabled:
          type: boolean
          title: mfa_enabled
          description: |-
            Whether the user has a live MFA factor. Set by ConfirmRecoveryCodes and
             DisableMFA, never by an update.
          readOnly: true
        phone:
          type: string
          title: phone
          description: |-
            Should be a valid E.164 compliant phone number.
             Could be empty.
        profile:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.User.Profile'
          title: profile
          description: User profile metadata.
        groups:
          type: array
          items:
            type: string
            readOnly: true
          title: groups
          description: |-
            The groups for the user.
             Format: groups/{email}
          readOnly: true
        workspace:
          type: string
          title: workspace
          description: |-
            The current workspace.
             Format: workspaces/{id}
          readOnly: true
      title: User
      additionalProperties: false
    bytebase.v1.User.Profile:
      type: object
      properties:
        lastLoginTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: last_login_time
          description: The last time the user successfully logged in.
        lastChangePasswordTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: last_change_password_time
          description: The last time the user changed their password.
        source:
          type: string
          title: source
          description: source means where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.
      title: Profile
      additionalProperties: false
    bytebase.v1.VCSType:
      type: string
      title: VCSType
      enum:
        - VCS_TYPE_UNSPECIFIED
        - GITHUB
        - GITLAB
        - BITBUCKET
        - AZURE_DEVOPS
      description: Version control system type.
    bytebase.v1.VCSUser:
      type: object
      properties:
        vcsType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.VCSType'
          title: vcs_type
        userId:
          type: string
          title: user_id
        userName:
          type: string
          title: user_name
        displayName:
          type: string
          title: display_name
      title: VCSUser
      additionalProperties: false
    bytebase.v1.VerifyCheckoutSessionRequest:
      type: object
      properties:
        sessionId:
          type: string
          title: session_id
          description: |-
            The same Stripe Checkout Session ID PurchaseResponse mints, arriving back
             the other way, so it carries the same classification. VerifyCheckoutSession
             is EXCLUDED, and a refusal of it streams its request to the stdout audit
             log, so leaving this unannotated would write the id into that line while
             the response that produced it was redacted.
      title: VerifyCheckoutSessionRequest
      additionalProperties: false
    bytebase.v1.VerifyCheckoutSessionResponse:
      type: object
      properties:
        status:
          type: string
          title: status
          description: 'Stripe Checkout Session status: "complete", "expired", or "open".'
      title: VerifyCheckoutSessionResponse
      additionalProperties: false
    bytebase.v1.ViewMetadata:
      type: object
      properties:
        name:
          type: string
          title: name
          description: The name is the name of a view.
        definition:
          type: string
          title: definition
          description: The definition is the definition of a view.
        comment:
          type: string
          title: comment
          description: The comment is the comment of a view.
        dependencyColumns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.DependencyColumn'
          title: dependency_columns
          description: The dependency_columns is the list of dependency columns of a view.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
          title: columns
          description: The columns is the ordered list of columns in a table.
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
          title: triggers
          description: The triggers is the list of triggers in a view.
        skipDump:
          type: boolean
          title: skip_dump
      title: ViewMetadata
      additionalProperties: false
      description: ViewMetadata is the metadata for views.
    bytebase.v1.Webhook:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            name is the name of the webhook, generated by the server.
             format: projects/{project}/webhooks/{webhook}
        type:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WebhookType'
          title: type
          description: |-
            Webhook integration type.
             type is the type of the webhook.
        title:
          type: string
          title: title
          description: title is the title of the webhook.
        url:
          type: string
          title: url
          description: |-
            url is the url of the webhook, should be unique within the project.

             Write-only: an incoming-webhook url is the whole credential for posting
             into the customer's chat, so reads leave it empty, the same way a data
             source's password and SSL material are left empty. Set it to change it.

             Required to create a webhook. Not required on TestWebhook, where an empty
             url on a request that names a webhook means the one already stored, so the
             field carries no REQUIRED behavior it would contradict there.
          writeOnly: true
        urlSupportsDirectMessage:
          type: boolean
          title: url_supports_direct_message
          description: |-
            Whether the stored url's endpoint form can carry a direct message to the
             users an event mentions, rather than only a post to the channel the url
             names. False for a Microsoft Teams Power Automate workflow endpoint, which
             direct messages bypass entirely: a webhook with direct_message set sends
             them and returns, so the workflow post never happens.

             Reads do not return the url, so a client editing a saved webhook cannot
             work this out for itself. It is a fact about the stored url and says
             nothing about what the url is.
          readOnly: true
        directMessage:
          type: boolean
          title: direct_message
          description: |-
            if direct_message is set, the notification is sent directly
             to the persons and url will be ignored.
             IM integration setting should be set for this function to work.
        notificationTypes:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.Activity.Type'
          title: notification_types
          description: |-
            (UNORDERED_LIST) notification_types is the list of activities types that the webhook is interested in.
             Bytebase will only send notifications to the webhook if the activity type is in the list.
             It should not be empty, and should be a subset of the following:
             - ISSUE_CREATED
             - ISSUE_APPROVAL_REQUESTED
             - ISSUE_SENT_BACK
             - ISSUE_APPROVED
             - PIPELINE_FAILED
             - PIPELINE_COMPLETED
      title: Webhook
      required:
        - type
        - title
      additionalProperties: false
    bytebase.v1.WebhookType:
      type: string
      title: WebhookType
      enum:
        - WEBHOOK_TYPE_UNSPECIFIED
        - SLACK
        - DISCORD
        - TEAMS
        - DINGTALK
        - FEISHU
        - WECOM
        - LARK
        - GOOGLE_CHAT
      description: Webhook integration type.
    bytebase.v1.WorkloadIdentity:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            The name of the workload identity.
             Format: workloadIdentities/{email}
          readOnly: true
        state:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.State'
          title: state
          description: The state of the workload identity.
        email:
          type: string
          title: email
          description: |-
            The email of the workload identity.
             For workspace-level: {name}@workload.bytebase.com
             For project-level: {name}@{project-id}.workload.bytebase.com
          readOnly: true
        title:
          type: string
          title: title
          maxLength: 200
          description: The display title of the workload identity.
        createTime:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: create_time
          description: The timestamp when the workload identity was created.
          readOnly: true
        workloadIdentityConfig:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentityConfig'
          title: workload_identity_config
          description: The workload identity configuration for OIDC token validation.
      title: WorkloadIdentity
      required:
        - workloadIdentityConfig
      additionalProperties: false
      description: WorkloadIdentity represents an external CI/CD workload identity.
    bytebase.v1.WorkloadIdentityConfig:
      type: object
      properties:
        providerType:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkloadIdentityConfig.ProviderType'
          title: provider_type
          description: Provider configuration mode.
        issuerUrl:
          type: string
          title: issuer_url
          description: |-
            HTTPS URL of the OIDC issuer. The exchange fetches
             {issuer_url}/.well-known/openid-configuration to verify a token, unless
             jwks_url names the key set directly.
        allowedAudiences:
          type: array
          items:
            type: string
          title: allowed_audiences
          description: |-
            Audiences a token may be minted for. A token authenticates if its `aud`
             claim matches any entry.
        subjectPattern:
          type: string
          title: subject_pattern
          description: |-
            The subject a token must carry, e.g. "repo:owner/repo:ref:refs/heads/main".
             A trailing "*" is a prefix match. For GitHub and GitLab subjects it must
             complete an owner or group segment, so "repo:my-org/*" is accepted and
             "repo:*" is not. Other issuers write other vocabularies, so a wildcard
             outside those two is accepted as given.
        jwksUrl:
          type: string
          title: jwks_url
          description: Optional JWKS endpoint. When empty, use OIDC discovery from issuer_url.
      title: WorkloadIdentityConfig
      required:
        - providerType
        - issuerUrl
        - allowedAudiences
        - subjectPattern
      additionalProperties: false
      description: WorkloadIdentityConfig for API layer
    bytebase.v1.WorkloadIdentityConfig.ProviderType:
      type: string
      title: ProviderType
      enum:
        - PROVIDER_TYPE_UNSPECIFIED
        - GITHUB
        - GITLAB
        - OIDC
      description: ProviderType identifies the workload identity configuration mode.
    bytebase.v1.Workspace:
      type: object
      properties:
        name:
          type: string
          title: name
          description: 'Format: workspaces/{workspace}'
        title:
          type: string
          title: title
        logo:
          type: string
          title: logo
          description: The branding logo.
      title: Workspace
      additionalProperties: false
    bytebase.v1.WorkspaceApprovalSetting:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting.Rule'
          title: rules
      title: WorkspaceApprovalSetting
      additionalProperties: false
    bytebase.v1.WorkspaceApprovalSetting.Rule:
      type: object
      properties:
        template:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.ApprovalTemplate'
          title: template
        condition:
          allOf:
            - $ref: '#/components/schemas/google.type.Expr'
          title: condition
          description: |-
            The condition that is associated with the rule.
             The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

             The `source` field filters which rules apply. The `condition` field then evaluates with full context.

             All supported variables:
             statement.affected_rows: affected row count in the DDL/DML, support "==", "!=", "<", "<=", ">", ">=" operations.
             statement.table_rows: table row count number, support "==", "!=", "<", "<=", ">", ">=" operations.
             resource.environment_id: the environment resource id, support "==", "!=", "in [xx]", "!(in [xx])" operations.
             resource.project_id: the project resource id, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
             resource.db_engine: the database engine type, support "==", "!=", "in [xx]", "!(in [xx])" operations. Check the Engine enum for values.
             statement.sql_type: the SQL type, support "==", "!=", "in [xx]", "!(in [xx])" operations.
             resource.database_name: the database name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
             resource.schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
             resource.table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
             statement.text: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
             request.expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
             request.role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.

             When source is CHANGE_DATABASE, support: statement.*, resource.* (excluding request.*)
             When source is CREATE_DATABASE, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name
             When source is REQUEST_ROLE, support: resource.project_id, request.expiration_days, request.role
             When source is REQUEST_ACCESS, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name, resource.schema_name, resource.table_name, request.unmask, request.data_export

             For examples:
             resource.environment_id == "prod" && statement.affected_rows >= 100
             resource.table_name.matches("sensitive_.*") && resource.db_engine == "MYSQL"
        source:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting.Rule.Source'
          title: source
      title: Rule
      additionalProperties: false
    bytebase.v1.WorkspaceApprovalSetting.Rule.Source:
      type: string
      title: Source
      enum:
        - SOURCE_UNSPECIFIED
        - CHANGE_DATABASE
        - CREATE_DATABASE
        - REQUEST_ROLE
        - REQUEST_ACCESS
    bytebase.v1.WorkspaceProfileSetting:
      type: object
      properties:
        externalUrl:
          type: string
          title: external_url
          description: The external URL is used for sso authentication callback.
        disallowSignup:
          type: boolean
          title: disallow_signup
          description: Disallow self-service signup, users can only be invited by the owner.
        requireMfa:
          type: boolean
          title: require_mfa
          description: Require MFA for all users.
        refreshTokenDuration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: refresh_token_duration
          description: The duration for refresh token. Default is 7 days.
        announcement:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.Announcement'
          title: announcement
          description: The setting of custom announcement
        maximumRequestExpiration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: maximum_request_expiration
          description: The max expiration duration for data access requests.
        domains:
          type: array
          items:
            type: string
          title: domains
          description: The workspace domain, e.g., bytebase.com.
        enforceIdentityDomain:
          type: boolean
          title: enforce_identity_domain
          description: Only user and group from the domains can be created and login.
        databaseChangeMode:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.DatabaseChangeMode'
          title: database_change_mode
          description: The workspace database change mode.
        disallowPasswordSignin:
          type: boolean
          title: disallow_password_signin
          description: Whether password sign-in is disabled for all end users.
        enableMetricCollection:
          type: boolean
          title: enable_metric_collection
          description: Whether to enable metric collection for the workspace.
        inactiveSessionTimeout:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: inactive_session_timeout
          description: The session expiration time if not activity detected for the user. Value <= 0 means no limit.
        enableAuditLogStdout:
          type: boolean
          title: enable_audit_log_stdout
          description: |-
            Whether to enable audit logging to stdout in structured JSON format.
             Requires TEAM or ENTERPRISE license.
        watermark:
          type: boolean
          title: watermark
          description: |-
            Whether to display watermark on pages.
             Requires ENTERPRISE license.
        passwordRestriction:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
          title: password_restriction
          description: Password restriction settings.
        accessTokenDuration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: access_token_duration
          description: The duration for access token. Default is 1 hour.
        enableDebug:
          type: boolean
          title: enable_debug
          description: Whether debug mode is enabled.
        sqlResultSize:
          type: string
          title: sql_result_size
          format: int64
          description: |-
            The maximum result size limit in bytes for query and export, works for the SQL Editor and Export Center.
             The default value is 100MB, we will use the default value if the setting not exists, or the limit <= 0.
        queryTimeout:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: query_timeout
          description: The query timeout duration for query and export, works for the SQL Editor and Export Center.
        allowEmailCodeSignin:
          type: boolean
          title: allow_email_code_signin
          description: |-
            Allow signin/signup using email + a 6-digit one-time verification code.
             Requires the EMAIL setting to be configured on the workspace.
        sqlEditorThemeId:
          type: string
          title: sql_editor_theme_id
          description: |-
            Enforced SQL Editor theme id: OPAQUE — a frontend-resolved built-in preset id
             OR a custom theme's uuid. Empty ⇒ default light.
        sqlEditorCustomTheme:
          allOf:
            - $ref: '#/components/schemas/bytebase.v1.SQLEditorThemeSetting'
          title: sql_editor_custom_theme
          description: |-
            The enforced CUSTOM theme's full definition — present ONLY when
             sql_editor_theme_id is a custom uuid. tokens is always complete.
        maximumRoleExpiration:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: maximum_role_expiration
          description: |-
            The max expiration duration for request role.
             Deprecated: use just-in-time access request flows instead.
        directorySyncTokenConfigured:
          type: boolean
          title: directory_sync_token_configured
          description: |-
            Whether a directory sync token has been generated for this workspace.
             The token itself is never returned; this only lets the UI decide between
             offering "generate" and "regenerate".
          readOnly: true
      title: WorkspaceProfileSetting
      additionalProperties: false
    bytebase.v1.WorkspaceProfileSetting.PasswordRestriction:
      type: object
      properties:
        minLength:
          type: integer
          title: min_length
          format: int32
          description: min_length is the minimum password length. It must be at least 8.
        requireNumber:
          type: boolean
          title: require_number
          description: require_number requires the password to contain at least one number.
        requireLetter:
          type: boolean
          title: require_letter
          description: require_letter requires the password to contain at least one letter, either uppercase or lowercase.
        requireUppercaseLetter:
          type: boolean
          title: require_uppercase_letter
          description: require_uppercase_letter requires the password to contain at least one uppercase letter.
        requireSpecialCharacter:
          type: boolean
          title: require_special_character
          description: require_special_character requires the password to contain at least one special character.
        requireResetPasswordForFirstLogin:
          type: boolean
          title: require_reset_password_for_first_login
          description: require_reset_password_for_first_login requires users to change their password after their first login.
        passwordRotation:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: password_rotation
          description: password_rotation requires users to change their password after the duration.
      title: PasswordRestriction
      additionalProperties: false
    connect-protocol-version:
      type: number
      examples:
        - 1
      title: Connect-Protocol-Version
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      examples:
        - 1000
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/connect.error_details.Any'
          description: A list of messages that carry the error details. There is no limit on the number of messages.
      title: Connect Error
      additionalProperties: true
      description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation'
    connect.error_details.Any:
      type: object
      properties:
        type:
          type: string
          description: 'A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`.'
        value:
          type: string
          format: byte
          description: The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.
        debug:
          type: object
          title: Debug
          additionalProperties: true
          description: Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.
      additionalProperties: true
      description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.
    google.api.expr.v1alpha1.Constant:
      type: object
      anyOf:
        - type: object
          properties:
            boolValue:
              type: boolean
              title: bool_value
              description: boolean value.
          title: bool_value
        - type: object
          properties:
            bytesValue:
              type: string
              title: bytes_value
              format: byte
              description: bytes value.
          title: bytes_value
        - type: object
          properties:
            doubleValue:
              type: number
              title: double_value
              format: double
              description: double value.
          title: double_value
        - type: object
          properties:
            durationValue:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.Duration'
              title: duration_value
              description: |-
                protobuf.Duration value.

                 Deprecated: duration is no longer considered a builtin cel type.
              deprecated: true
          title: duration_value
        - type: object
          properties:
            int64Value:
              type: string
              title: int64_value
              format: int64
              description: int64 value.
          title: int64_value
        - type: object
          properties:
            nullValue:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.NullValue'
              title: null_value
              description: null value.
          title: null_value
        - type: object
          properties:
            stringValue:
              type: string
              title: string_value
              description: string value.
          title: string_value
        - type: object
          properties:
            timestampValue:
              allOf:
                - $ref: '#/components/schemas/google.protobuf.Timestamp'
              title: timestamp_value
              description: |-
                protobuf.Timestamp value.

                 Deprecated: timestamp is no longer considered a builtin cel type.
              deprecated: true
          title: timestamp_value
        - type: object
          properties:
            uint64Value:
              type: string
              title: uint64_value
              format: int64
              description: uint64 value.
          title: uint64_value
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - boolValue
              - required:
                  - bytesValue
              - required:
                  - doubleValue
              - required:
                  - durationValue
              - required:
                  - int64Value
              - required:
                  - nullValue
              - required:
                  - stringValue
              - required:
                  - timestampValue
              - required:
                  - uint64Value
          - not:
              oneOf:
                - required:
                    - boolValue
                - required:
                    - bytesValue
                - required:
                    - doubleValue
                - required:
                    - durationValue
                - required:
                    - int64Value
                - required:
                    - nullValue
                - required:
                    - stringValue
                - required:
                    - timestampValue
                - required:
                    - uint64Value
      title: Constant
      description: |-
        Represents a primitive literal.

         Named 'Constant' here for backwards compatibility.

         This is similar as the primitives supported in the well-known type
         `google.protobuf.Value`, but richer so it can represent CEL's full range of
         primitives.

         Lists and structs are not included as constants as these aggregate types may
         contain [Expr][google.api.expr.v1alpha1.Expr] elements which require
         evaluation and are thus not constant.

         Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,
         `true`, `null`.
    google.api.expr.v1alpha1.Expr:
      type: object
      anyOf:
        - type: object
          properties:
            callExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Call'
              title: call_expr
              description: A call expression, including calls to predefined functions and operators.
          title: call_expr
        - type: object
          properties:
            comprehensionExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Comprehension'
              title: comprehension_expr
              description: A comprehension expression.
          title: comprehension_expr
        - type: object
          properties:
            constExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Constant'
              title: const_expr
              description: A literal expression.
          title: const_expr
        - type: object
          properties:
            identExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Ident'
              title: ident_expr
              description: An identifier expression.
          title: ident_expr
        - type: object
          properties:
            listExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateList'
              title: list_expr
              description: A list creation expression.
          title: list_expr
        - type: object
          properties:
            selectExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Select'
              title: select_expr
              description: A field selection expression, e.g. `request.auth`.
          title: select_expr
        - type: object
          properties:
            structExpr:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateStruct'
              title: struct_expr
              description: A map or message creation expression.
          title: struct_expr
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - callExpr
              - required:
                  - comprehensionExpr
              - required:
                  - constExpr
              - required:
                  - identExpr
              - required:
                  - listExpr
              - required:
                  - selectExpr
              - required:
                  - structExpr
          - not:
              oneOf:
                - required:
                    - callExpr
                - required:
                    - comprehensionExpr
                - required:
                    - constExpr
                - required:
                    - identExpr
                - required:
                    - listExpr
                - required:
                    - selectExpr
                - required:
                    - structExpr
      properties:
        id:
          type: string
          title: id
          format: int64
          description: |-
            Required. An id assigned to this node by the parser which is unique in a
             given expression tree. This is used to associate type information and other
             attributes to a node in the parse tree.
      title: Expr
      description: |-
        An abstract representation of a common expression.

         Expressions are abstractly represented as a collection of identifiers,
         select statements, function calls, literals, and comprehensions. All
         operators with the exception of the '.' operator are modelled as function
         calls. This makes it easy to represent new operators into the existing AST.

         All references within expressions must resolve to a
         [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an
         expression to be valid. A reference may either be a bare identifier `name` or
         a qualified identifier `google.api.name`. References may either refer to a
         value or a function declaration.

         For example, the expression `google.api.name.startsWith('expr')` references
         the declaration `google.api.name` within a
         [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the
         function declaration `startsWith`.
    google.api.expr.v1alpha1.Expr.Call:
      type: object
      properties:
        target:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: target
          description: |-
            The target of an method call-style expression. For example, `x` in
             `x.f()`.
        function:
          type: string
          title: function
          description: Required. The name of the function or method being called.
        args:
          type: array
          items:
            $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: args
          description: The arguments.
      title: Call
      additionalProperties: false
      description: |-
        A call expression, including calls to predefined functions and operators.

         For example, `value == 10`, `size(map_value)`.
    google.api.expr.v1alpha1.Expr.Comprehension:
      type: object
      properties:
        iterVar:
          type: string
          title: iter_var
          description: |-
            The name of the first iteration variable.
             When the iter_range is a list, this variable is the list element.
             When the iter_range is a map, this variable is the map entry key.
        iterVar2:
          type: string
          title: iter_var2
          description: |-
            The name of the second iteration variable, empty if not set.
             When the iter_range is a list, this variable is the integer index.
             When the iter_range is a map, this variable is the map entry value.
             This field is only set for comprehension v2 macros.
        iterRange:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: iter_range
          description: The range over which the comprehension iterates.
        accuVar:
          type: string
          title: accu_var
          description: The name of the variable used for accumulation of the result.
        accuInit:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: accu_init
          description: The initial value of the accumulator.
        loopCondition:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: loop_condition
          description: |-
            An expression which can contain iter_var, iter_var2, and accu_var.

             Returns false when the result has been computed and may be used as
             a hint to short-circuit the remainder of the comprehension.
        loopStep:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: loop_step
          description: |-
            An expression which can contain iter_var, iter_var2, and accu_var.

             Computes the next value of accu_var.
        result:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: result
          description: |-
            An expression which can contain accu_var.

             Computes the result.
      title: Comprehension
      additionalProperties: false
      description: |-
        A comprehension expression applied to a list or map.

         Comprehensions are not part of the core syntax, but enabled with macros.
         A macro matches a specific call signature within a parsed AST and replaces
         the call with an alternate AST block. Macro expansion happens at parse
         time.

         The following macros are supported within CEL:

         Aggregate type macros may be applied to all elements in a list or all keys
         in a map:

         *  `all`, `exists`, `exists_one` -  test a predicate expression against
            the inputs and return `true` if the predicate is satisfied for all,
            any, or only one value `list.all(x, x < 10)`.
         *  `filter` - test a predicate expression against the inputs and return
            the subset of elements which satisfy the predicate:
            `payments.filter(p, p > 1000)`.
         *  `map` - apply an expression to all elements in the input and return the
            output aggregate type: `[1, 2, 3].map(i, i * i)`.

         The `has(m.x)` macro tests whether the property `x` is present in struct
         `m`. The semantics of this macro depend on the type of `m`. For proto2
         messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the
         macro tests whether the property is set to its default. For map and struct
         types, the macro tests whether the property `x` is defined on `m`.

         Comprehensions for the standard environment macros evaluation can be best
         visualized as the following pseudocode:

         ```
         let `accu_var` = `accu_init`
         for (let `iter_var` in `iter_range`) {
           if (!`loop_condition`) {
             break
           }
           `accu_var` = `loop_step`
         }
         return `result`
         ```

         Comprehensions for the optional V2 macros which support map-to-map
         translation differ slightly from the standard environment macros in that
         they expose both the key or index in addition to the value for each list
         or map entry:

         ```
         let `accu_var` = `accu_init`
         for (let `iter_var`, `iter_var2` in `iter_range`) {
           if (!`loop_condition`) {
             break
           }
           `accu_var` = `loop_step`
         }
         return `result`
         ```
    google.api.expr.v1alpha1.Expr.CreateList:
      type: object
      properties:
        elements:
          type: array
          items:
            $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: elements
          description: The elements part of the list.
        optionalIndices:
          type: array
          items:
            type: integer
            format: int32
          title: optional_indices
          description: |-
            The indices within the elements list which are marked as optional
             elements.

             When an optional-typed value is present, the value it contains
             is included in the list. If the optional-typed value is absent, the list
             element is omitted from the CreateList result.
      title: CreateList
      additionalProperties: false
      description: |-
        A list creation expression.

         Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g.
         `dyn([1, 'hello', 2.0])`
    google.api.expr.v1alpha1.Expr.CreateStruct:
      type: object
      properties:
        messageName:
          type: string
          title: message_name
          description: |-
            The type name of the message to be created, empty when creating map
             literals.
        entries:
          type: array
          items:
            $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateStruct.Entry'
          title: entries
          description: The entries in the creation expression.
      title: CreateStruct
      additionalProperties: false
      description: |-
        A map or message creation expression.

         Maps are constructed as `{'key_name': 'value'}`. Message construction is
         similar, but prefixed with a type name and composed of field ids:
         `types.MyType{field_id: 'value'}`.
    google.api.expr.v1alpha1.Expr.CreateStruct.Entry:
      type: object
      anyOf:
        - type: object
          properties:
            fieldKey:
              type: string
              title: field_key
              description: The field key for a message creator statement.
          title: field_key
        - type: object
          properties:
            mapKey:
              allOf:
                - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
              title: map_key
              description: The key expression for a map creation statement.
          title: map_key
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - fieldKey
              - required:
                  - mapKey
          - not:
              oneOf:
                - required:
                    - fieldKey
                - required:
                    - mapKey
      properties:
        id:
          type: string
          title: id
          format: int64
          description: |-
            Required. An id assigned to this node by the parser which is unique
             in a given expression tree. This is used to associate type
             information and other attributes to the node.
        value:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: value
          description: |-
            Required. The value assigned to the key.

             If the optional_entry field is true, the expression must resolve to an
             optional-typed value. If the optional value is present, the key will be
             set; however, if the optional value is absent, the key will be unset.
        optionalEntry:
          type: boolean
          title: optional_entry
          description: Whether the key-value pair is optional.
      title: Entry
      description: Represents an entry.
    google.api.expr.v1alpha1.Expr.Ident:
      type: object
      properties:
        name:
          type: string
          title: name
          description: |-
            Required. Holds a single, unqualified identifier, possibly preceded by a
             '.'.

             Qualified names are represented by the
             [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression.
      title: Ident
      additionalProperties: false
      description: An identifier expression. e.g. `request`.
    google.api.expr.v1alpha1.Expr.Select:
      type: object
      properties:
        operand:
          allOf:
            - $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
          title: operand
          description: |-
            Required. The target of the selection expression.

             For example, in the select expression `request.auth`, the `request`
             portion of the expression is the `operand`.
        field:
          type: string
          title: field
          description: |-
            Required. The name of the field to select.

             For example, in the select expression `request.auth`, the `auth` portion
             of the expression would be the `field`.
        testOnly:
          type: boolean
          title: test_only
          description: |-
            Whether the select is to be interpreted as a field presence test.

             This results from the macro `has(request.auth)`.
      title: Select
      additionalProperties: false
      description: A field selection expression. e.g. `request.auth`.
    google.protobuf.Any:
      type: object
      properties:
        type:
          type: string
        value:
          type: string
          format: binary
      additionalProperties: true
      description: An arbitrary message with a type URL identifying the encoded message type.
    google.protobuf.Duration:
      type: string
      format: duration
      description: A signed duration in seconds, with up to nine fractional digits and an `s` suffix (for example, `3s` or `-0.001s`).
    google.protobuf.Empty:
      type: object
      description: An empty JSON object.
    google.protobuf.FieldMask:
      type: string
      description: Comma-separated field paths in lowerCamelCase (for example, `user.displayName,photo`).
    google.protobuf.FloatValue:
      oneOf:
        - type: string
        - type: number
      description: A single-precision number. The non-finite values `NaN`, `Infinity`, and `-Infinity` are encoded as strings; `null` is also accepted.
    google.protobuf.ListValue:
      type: array
      items:
        $ref: '#/components/schemas/google.protobuf.Value'
      description: A JSON array whose elements may be any JSON value.
    google.protobuf.NullValue:
      type: string
      title: NullValue
      enum:
        - NULL_VALUE
      description: |-
        Represents a JSON `null`.

         `NullValue` is a sentinel, using an enum with only one value to represent
         the null value for the `Value` type union.

         A field of type `NullValue` with any value other than `0` is considered
         invalid. Most ProtoJSON serializers will emit a `Value` with a `null_value`
         set as a JSON `null` regardless of the integer value, and so will round trip
         to a `0` value.
    google.protobuf.Struct:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/google.protobuf.Value'
      description: A JSON object whose property values may be any JSON value.
    google.protobuf.Timestamp:
      type: string
      examples:
        - "2023-01-15T01:30:15.01Z"
        - "2024-12-25T12:00:00Z"
      format: date-time
      description: A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC.
    google.protobuf.Value:
      oneOf:
        - type: "null"
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: 'Any JSON value: `null`, number, string, boolean, array, or object.'
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          title: code
          format: int32
          description: |-
            The status code, which should be an enum value of
             [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          title: message
          description: |-
            A developer-facing error message, which should be in English. Any
             user-facing error message should be localized and sent in the
             [google.rpc.Status.details][google.rpc.Status.details] field, or localized
             by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
          title: details
          description: |-
            A list of messages that carry the error details.  There is a common set of
             message types for APIs to use.
      title: Status
      additionalProperties: false
      description: |-
        The `Status` type defines a logical error model that is suitable for
         different programming environments, including REST APIs and RPC APIs. It is
         used by [gRPC](https://github.com/grpc). Each `Status` message contains
         three pieces of data: error code, error message, and error details.

         You can find out more about this error model and how to work with it in the
         [API Design Guide](https://cloud.google.com/apis/design/errors).
    google.type.Color:
      type: object
      properties:
        red:
          type: number
          title: red
          format: float
          description: The amount of red in the color as a value in the interval [0, 1].
        green:
          type: number
          title: green
          format: float
          description: The amount of green in the color as a value in the interval [0, 1].
        blue:
          type: number
          title: blue
          format: float
          description: The amount of blue in the color as a value in the interval [0, 1].
        alpha:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.FloatValue'
          title: alpha
          description: |-
            The fraction of this color that should be applied to the pixel. That is,
             the final pixel color is defined by the equation:

               `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`

             This means that a value of 1.0 corresponds to a solid color, whereas
             a value of 0.0 corresponds to a completely transparent color. This
             uses a wrapper message rather than a simple float scalar so that it is
             possible to distinguish between a default value and the value being unset.
             If omitted, this color object is rendered as a solid color
             (as if the alpha value had been explicitly given a value of 1.0).
      title: Color
      additionalProperties: false
      description: |-
        Represents a color in the RGBA color space. This representation is designed
         for simplicity of conversion to/from color representations in various
         languages over compactness. For example, the fields of this representation
         can be trivially provided to the constructor of `java.awt.Color` in Java; it
         can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
         method in iOS; and, with just a little work, it can be easily formatted into
         a CSS `rgba()` string in JavaScript.

         This reference page doesn't carry information about the absolute color
         space
         that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
         DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
         space.

         When color equality needs to be decided, implementations, unless
         documented otherwise, treat two colors as equal if all their red,
         green, blue, and alpha values each differ by at most 1e-5.

         Example (Java):

              import com.google.type.Color;

              // ...
              public static java.awt.Color fromProto(Color protocolor) {
                float alpha = protocolor.hasAlpha()
                    ? protocolor.getAlpha().getValue()
                    : 1.0;

                return new java.awt.Color(
                    protocolor.getRed(),
                    protocolor.getGreen(),
                    protocolor.getBlue(),
                    alpha);
              }

              public static Color toProto(java.awt.Color color) {
                float red = (float) color.getRed();
                float green = (float) color.getGreen();
                float blue = (float) color.getBlue();
                float denominator = 255.0;
                Color.Builder resultBuilder =
                    Color
                        .newBuilder()
                        .setRed(red / denominator)
                        .setGreen(green / denominator)
                        .setBlue(blue / denominator);
                int alpha = color.getAlpha();
                if (alpha != 255) {
                  result.setAlpha(
                      FloatValue
                          .newBuilder()
                          .setValue(((float) alpha) / denominator)
                          .build());
                }
                return resultBuilder.build();
              }
              // ...

         Example (iOS / Obj-C):

              // ...
              static UIColor* fromProto(Color* protocolor) {
                 float red = [protocolor red];
                 float green = [protocolor green];
                 float blue = [protocolor blue];
                 FloatValue* alpha_wrapper = [protocolor alpha];
                 float alpha = 1.0;
                 if (alpha_wrapper != nil) {
                   alpha = [alpha_wrapper value];
                 }
                 return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
              }

              static Color* toProto(UIColor* color) {
                  CGFloat red, green, blue, alpha;
                  if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
                    return nil;
                  }
                  Color* result = [[Color alloc] init];
                  [result setRed:red];
                  [result setGreen:green];
                  [result setBlue:blue];
                  if (alpha <= 0.9999) {
                    [result setAlpha:floatWrapperWithValue(alpha)];
                  }
                  [result autorelease];
                  return result;
             }
             // ...

          Example (JavaScript):

             // ...

             var protoToCssColor = function(rgb_color) {
                var redFrac = rgb_color.red || 0.0;
                var greenFrac = rgb_color.green || 0.0;
                var blueFrac = rgb_color.blue || 0.0;
                var red = Math.floor(redFrac * 255);
                var green = Math.floor(greenFrac * 255);
                var blue = Math.floor(blueFrac * 255);

                if (!('alpha' in rgb_color)) {
                   return rgbToCssColor(red, green, blue);
                }

                var alphaFrac = rgb_color.alpha.value || 0.0;
                var rgbParams = [red, green, blue].join(',');
                return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
             };

             var rgbToCssColor = function(red, green, blue) {
               var rgbNumber = new Number((red << 16) | (green << 8) | blue);
               var hexString = rgbNumber.toString(16);
               var missingZeros = 6 - hexString.length;
               var resultBuilder = ['#'];
               for (var i = 0; i < missingZeros; i++) {
                  resultBuilder.push('0');
               }
               resultBuilder.push(hexString);
               return resultBuilder.join('');
             };

             // ...
    google.type.Expr:
      type: object
      properties:
        expression:
          type: string
          title: expression
          description: |-
            Textual representation of an expression in Common Expression Language
             syntax.
        title:
          type: string
          title: title
          description: |-
            Optional. Title for the expression, i.e. a short string describing
             its purpose. This can be used e.g. in UIs which allow to enter the
             expression.
        description:
          type: string
          title: description
          description: |-
            Optional. Description of the expression. This is a longer text which
             describes the expression, e.g. when hovered over it in a UI.
        location:
          type: string
          title: location
          description: |-
            Optional. String indicating the location of the expression for error
             reporting, e.g. a file name and a position in the file.
      title: Expr
      additionalProperties: false
      description: |-
        Represents a textual expression in the Common Expression Language (CEL)
         syntax. CEL is a C-like expression language. The syntax and semantics of CEL
         are documented at https://github.com/google/cel-spec.

         Example (Comparison):

             title: "Summary size limit"
             description: "Determines if a summary is less than 100 chars"
             expression: "document.summary.size() < 100"

         Example (Equality):

             title: "Requestor is owner"
             description: "Determines if requestor is the document owner"
             expression: "document.owner == request.auth.claims.email"

         Example (Logic):

             title: "Public documents"
             description: "Determine whether the document should be publicly visible"
             expression: "document.type != 'private' && document.type != 'internal'"

         Example (Data Manipulation):

             title: "Notification string"
             description: "Create a notification string with a timestamp."
             expression: "'New message received at ' + string(document.create_time)"

         The exact variables and functions that may be referenced within an expression
         are determined by the service that evaluates it. See the service
         documentation for additional information.
security: []
tags:
  - name: AccessGrantService
    description: AccessGrantService manages temporary access grants within projects.
  - name: RolloutService
    description: RolloutService manages the execution of deployment plans.
  - name: QueryHistoryService
    description: QueryHistoryService manages query history records of SQL Editor queries and exports.
  - name: SQLService
    description: SQLService executes SQL queries and manages query operations.
  - name: PlanService
    description: PlanService manages deployment plans for database changes.
  - name: IssueService
    description: IssueService manages issues for tracking database changes and tasks.
  - name: SettingService
    description: SettingService manages workspace-level settings and configurations.
  - name: ActuatorService
    description: ActuatorService manages system health and operational information.
  - name: AIService
    description: AIService provides AI chat capabilities for the page agent.
  - name: AuditLogService
    description: AuditLogService manages audit logs for system activities and API calls.
  - name: IdentityProviderService
    description: IdentityProviderService manages external identity providers for SSO authentication.
  - name: UserService
    description: UserService manages user accounts and authentication.
  - name: AuthService
    description: AuthService handles user authentication operations.
  - name: CelService
    description: CelService manages CEL (Common Expression Language) parsing and formatting operations.
  - name: ChangelogService
    description: ChangelogService manages database migration history.
  - name: DatabaseCatalogService
    description: DatabaseCatalogService manages database schema metadata and classification.
  - name: DatabaseGroupService
    description: DatabaseGroupService manages database groups for organizing databases by criteria.
  - name: InstanceRoleService
    description: InstanceRoleService manages database roles within instances.
  - name: InstanceService
    description: InstanceService manages database instances and their connections.
  - name: DatabaseService
    description: DatabaseService manages databases and their schemas.
  - name: GroupService
    description: GroupService manages user groups for organizing users and permissions.
  - name: OrgPolicyService
    description: OrgPolicyService manages organizational policies at various resource levels.
  - name: ProjectService
    description: ProjectService manages projects that group databases and changes.
  - name: ReleaseService
    description: ReleaseService manages releases for coordinating deployments.
  - name: ReviewConfigService
    description: ReviewConfigService manages approval flow configurations.
  - name: RevisionService
    description: RevisionService manages schema revision history.
  - name: RoleService
    description: RoleService manages workspace roles and permissions.
  - name: SavedQueryService
    description: |-
      SavedQueryService manages saved queries in the SQL Editor.

       A saved query is private to its creator until shared. Permissions come from
       three places:
       - The creator owns the saved query and holds every permission on it.
       - A VIEWER binding grants bb.savedQueries.get and getIamPolicy; an EDITOR
         binding adds update.
       - Permissions granted on the project or workspace apply to every saved
         query in the project, private ones included.
       A caller without a method's permission gets NotFound, not
       PermissionDenied, so private names stay unprobeable. Running a saved query
       is governed by the SQL Editor's database permissions, not by this service.
  - name: ServiceAccountService
    description: ServiceAccountService manages service accounts for API integrations.
  - name: SheetService
    description: SheetService manages SQL scripts and saved queries.
  - name: SubscriptionService
    description: SubscriptionService manages enterprise subscriptions and licensing.
  - name: WorkloadIdentityService
    description: WorkloadIdentityService manages workload identities for external CI/CD integrations.
  - name: WorkspaceService
    description: WorkspaceService manages workspace-level operations and profile.
