{
  "schemas": {
    "FetchQueryMetricsResponse": {
      "description": "The response of the FetchQueryMetrics RPC.",
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch query metrics.",
          "type": "string"
        }
      },
      "id": "FetchQueryMetricsResponse",
      "type": "object"
    },
    "DatabaseChatContext": {
      "type": "object",
      "id": "DatabaseChatContext",
      "properties": {
        "taskCompletionRequest": {
          "$ref": "TaskCompletionRequest",
          "description": "The task completion request to be used for the database chat."
        }
      }
    },
    "FetchSystemMetricsRequest": {
      "description": "The request of the FetchSystemMetrics RPC.",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "Optional. The start_time of the metrics in RFC3339 format."
        },
        "endTime": {
          "description": "Optional. The end_time of the metrics in RFC3339 format.",
          "type": "string"
        },
        "promqlQuery": {
          "type": "string",
          "description": "Required. The promql_query to fetch the system metrics."
        },
        "resource": {
          "type": "string",
          "description": "Required. The resource name used for system metrics. It is the project ID in this case."
        }
      },
      "id": "FetchSystemMetricsRequest",
      "type": "object"
    },
    "RunAgentRequest": {
      "id": "RunAgentRequest",
      "properties": {
        "productType": {
          "description": "Optional. The product type of the database. This is a string representation of the product type",
          "type": "string"
        },
        "location": {
          "type": "string",
          "description": "Optional. The location of the database resource"
        },
        "additionalContext": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Optional. The additional context to be used for the agent."
        },
        "agentOptions": {
          "description": "Optional. The options for processing the request on the agent.",
          "$ref": "AgentOptions"
        },
        "projectId": {
          "description": "Optional. The project id of the database.",
          "type": "string"
        },
        "sessionId": {
          "description": "Required. The session id of the user query. This is used to identify the user query and the agent response.",
          "type": "string"
        },
        "engineType": {
          "type": "string",
          "description": "Optional. The engine type of the database. This is a string representation of the engine type."
        },
        "databaseChatContext": {
          "description": "Optional. The database chat context to be used for database chat tools.",
          "$ref": "DatabaseChatContext"
        },
        "userQuery": {
          "type": "string",
          "description": "Required. The user query to be used for the agent."
        }
      },
      "type": "object"
    },
    "AgentOptions": {
      "properties": {
        "visualizationDisabled": {
          "description": "Optional. If true, visualizations are disabled in the agent response.",
          "type": "boolean"
        }
      },
      "id": "AgentOptions",
      "description": "Options for processing the request on the agent.",
      "type": "object"
    },
    "InputDataContext": {
      "id": "InputDataContext",
      "type": "object",
      "description": "Intended to hold customer content over and above what is present in the `input` field.",
      "properties": {
        "additionalContext": {
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object. Contains field @type with type URL.",
            "type": "any"
          },
          "description": "Optional. Represents additional customer content over the `input` field."
        }
      }
    },
    "FetchQueryMetricsRequest": {
      "id": "FetchQueryMetricsRequest",
      "description": "The request of the FetchQueryMetrics RPC.",
      "type": "object",
      "properties": {
        "resource": {
          "description": "Required. The resource name used for query metrics. It is the project ID in this case.",
          "type": "string"
        },
        "promqlQuery": {
          "type": "string",
          "description": "Required. The promql_query to fetch the query metrics."
        },
        "startTime": {
          "type": "string",
          "description": "Optional. The start_time of the metrics in RFC3339 format."
        },
        "endTime": {
          "type": "string",
          "description": "Optional. The end_time of the metrics in RFC3339 format."
        }
      }
    },
    "TaskCompletionInput": {
      "id": "TaskCompletionInput",
      "properties": {
        "preamble": {
          "description": "Optional. Preamble for the task completion conversation.",
          "type": "string"
        },
        "messages": {
          "items": {
            "$ref": "TaskCompletionMessage"
          },
          "description": "Optional. Last few messages of the conversation. The most recent message is the last element in the list.",
          "type": "array"
        }
      },
      "type": "object",
      "description": "Natural language messages making up the task completion conversation."
    },
    "TaskCompletionMessage": {
      "id": "TaskCompletionMessage",
      "properties": {
        "content": {
          "type": "string",
          "description": "Optional. Text content of the task completion/chat message."
        },
        "author": {
          "type": "string",
          "description": "Optional. Author tag for the turn."
        }
      },
      "type": "object",
      "description": "Represents a single message."
    },
    "BackendResourcesContext": {
      "type": "object",
      "properties": {
        "fullResourceNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The full resource names (https://cloud.google.com/apis/design/resource_names) of the GCP resources that are referenced or relevant to the Duet query. For example, a BigQuery SQL generation in the context of a particular BigQuery table would set this to: `//bigquery.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}`"
        },
        "additionalContext": {
          "additionalProperties": {
            "description": "Properties of the object. Contains field @type with type URL.",
            "type": "any"
          },
          "description": "Optional. Represents GCP product-specific backend resources context.",
          "type": "object"
        }
      },
      "id": "BackendResourcesContext",
      "description": "Represents ids of resources that the operation needs to reference or target. E.g. for BigQuery SQL generation, this could reference the Dataset or Table names (go/backend-resources-context-eg)."
    },
    "Blob": {
      "properties": {
        "data": {
          "format": "byte",
          "type": "string",
          "description": "Required. The raw bytes of the blob."
        },
        "mimeType": {
          "type": "string",
          "description": "Required. The MIME type of the blob."
        }
      },
      "id": "Blob",
      "description": "Content blob.",
      "type": "object"
    },
    "TaskCompletionRequest": {
      "description": "Input for task completion.",
      "type": "object",
      "id": "TaskCompletionRequest",
      "properties": {
        "contents": {
          "type": "array",
          "description": "Optional. Content of the task completion/chat input. This field is used to replace the `input` field above. It is repeated because it can contain the history of the conversation. Most recent content is the last element of the list.",
          "items": {
            "$ref": "TaskCompletionContent"
          }
        },
        "clientContext": {
          "description": "Optional. Client context (e.g. IDE name, version, etc)",
          "$ref": "ClientContext"
        },
        "inputDataContext": {
          "description": "Optional. Additional user content not captured in the `input` field above",
          "$ref": "InputDataContext"
        },
        "experienceContext": {
          "$ref": "ExperienceContext",
          "description": "Duet product context -- required"
        },
        "input": {
          "$ref": "TaskCompletionInput",
          "description": "Optional. Represents the raw input for inference. It will be modified as part of prompt engineering and other transforms before it is consumed by the LLM. Deprecated. Use `contents` field instead for multimodal input."
        },
        "instance": {
          "description": "Required. The full name of the Instance resource for this generation request. Format: `projects/{project}/locations/{location}/instances/{instance}` Use the special 'default' name to refer to the default instance.",
          "type": "string"
        },
        "topic": {
          "type": "string",
          "description": "Optional. The topic to file this message under. Format: projects/*/locations/*/topics/{topic_id} Setting this field implies an intent to persist messages. The entire request fails if this field is set but the user doesn't have the IAM permissions to persist messages. The value of this field is ignored if the 'instance' resource associated with the API call does not have storage option set."
        },
        "backendResourcesContext": {
          "description": "Optional. The GCP resources that the code generation process needs to reference",
          "$ref": "BackendResourcesContext"
        },
        "messageId": {
          "type": "string",
          "description": "Optional. An ID for this TaskCompletionRequest, used for persistence and for correlating it with the TaskCompletionResponse received from the Agent (the response carries the id of the TaskCompletionRequests it consumed). - If the 'topic' field is set, a Message object wrapping this TaskCompletionRequest is created under the specified Topic and persisted with this ID (if it's not set, the ID will be generated server-side). The persisted Message objects in a Topic can be retrieved using the MessageService API. - If the 'topic' field is not set, this TaskCompletionRequest is not persisted and message_id is a no-op. To update a previously persisted message, set the 'topic' field and the 'message_id' field to the same value, while changing the contents. Only the last request to the Agent in the Topic can be updated. Updating the request will cause all its responses to be recreated."
        }
      }
    },
    "RunAgentResponse": {
      "id": "RunAgentResponse",
      "type": "object",
      "properties": {
        "response": {
          "type": "string",
          "description": "The agent's response to the user query."
        },
        "sduiRequests": {
          "type": "array",
          "readOnly": true,
          "items": {
            "$ref": "SduiRequest"
          },
          "description": "Output only. The SDUI requests for UI widgets. The number of elements is limited to 100."
        },
        "visualizations": {
          "description": "A list of visualizations generated by the agent.",
          "type": "array",
          "items": {
            "$ref": "Visualization"
          }
        }
      }
    },
    "ExperienceContext": {
      "type": "object",
      "properties": {
        "experience": {
          "description": "Required. The Duet experience that this request belongs to.",
          "type": "string"
        },
        "task": {
          "description": "Optional. The backend Task(s) this request maps to (if known).",
          "type": "string"
        },
        "agent": {
          "description": "Optional. The Backend Agent to route this request to (if known).",
          "type": "string"
        }
      },
      "description": "The specific Duet product and flow a request belongs to. E.g. Appsheet code generation (“/appsheet/generate”).",
      "id": "ExperienceContext"
    },
    "SduiRequest": {
      "id": "SduiRequest",
      "description": "Client-side request type for GetSdui. See go/cloud-sdui for more details.",
      "type": "object",
      "properties": {
        "description": {
          "description": "The description of the SDUI component. To be used for LLM context.",
          "type": "string"
        },
        "sduiService": {
          "description": "The name of the SduiService to send the request to.",
          "type": "string"
        },
        "componentId": {
          "type": "string",
          "description": "Required unique identifier for the SDUI component."
        },
        "payload": {
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          },
          "description": "Payload to the SDUI component.",
          "type": "object"
        }
      }
    },
    "ClientContext": {
      "id": "ClientContext",
      "properties": {
        "version": {
          "description": "Optional. Duet plugin/UI version",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Optional. Name of the Duet plugin/UI running in the client space"
        },
        "additionalContext": {
          "description": "Optional. Represents GCP product-specific UI/client context.",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          }
        }
      },
      "description": "Represents context about the UI client. Must NOT contain customer content.",
      "type": "object"
    },
    "TaskCompletionContent": {
      "properties": {
        "role": {
          "description": "Required. Either \"user\" or \"model\".",
          "type": "string"
        },
        "parts": {
          "type": "array",
          "description": "Required. The parts of the content.",
          "items": {
            "$ref": "Part"
          }
        }
      },
      "id": "TaskCompletionContent",
      "description": "Content of the task completion/chat input.",
      "type": "object"
    },
    "Part": {
      "id": "Part",
      "properties": {
        "inlineData": {
          "$ref": "Blob",
          "description": "Optional. Inline blob content."
        },
        "text": {
          "type": "string",
          "description": "Optional. Text content."
        }
      },
      "type": "object",
      "description": "A part of the content."
    },
    "Visualization": {
      "id": "Visualization",
      "type": "object",
      "description": "Represents a visualization generated by the agent.",
      "properties": {
        "summary": {
          "description": "A summary or description of the visualization.",
          "type": "string"
        },
        "promqlQuery": {
          "type": "string",
          "description": "The PromQL query string for a PROMQL_QUERY type visualization. See: https://prometheus.io/docs/prometheus/latest/querying/basics/"
        },
        "visualizationType": {
          "enum": [
            "VISUALIZATION_TYPE_UNSPECIFIED",
            "PROMQL_QUERY"
          ],
          "enumDescriptions": [
            "The default value. This value is unused.",
            "The visualization is a PromQL query."
          ],
          "description": "The type of the visualization.",
          "type": "string"
        }
      }
    },
    "FetchSystemMetricsResponse": {
      "description": "The response of the FetchSystemMetrics RPC.",
      "id": "FetchSystemMetricsResponse",
      "type": "object",
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch system metrics.",
          "type": "string"
        }
      }
    }
  },
  "kind": "discovery#restDescription",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "rootUrl": "https://databaseinsights.googleapis.com/",
  "ownerName": "Google",
  "title": "Database Insights API",
  "servicePath": "",
  "version_module": true,
  "version": "v1beta",
  "name": "databaseinsights",
  "protocol": "rest",
  "parameters": {
    "access_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth access token."
    },
    "$.xgafv": {
      "type": "string",
      "enum": [
        "1",
        "2"
      ],
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "description": "V1 error format."
    },
    "alt": {
      "location": "query",
      "type": "string",
      "description": "Data format for response.",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "default": "json"
    },
    "upload_protocol": {
      "location": "query",
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    },
    "prettyPrint": {
      "location": "query",
      "type": "boolean",
      "default": "true",
      "description": "Returns response with indentations and line breaks."
    },
    "callback": {
      "location": "query",
      "type": "string",
      "description": "JSONP"
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "location": "query",
      "type": "string"
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query",
      "type": "string"
    },
    "uploadType": {
      "location": "query",
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "key": {
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
      "location": "query",
      "type": "string"
    },
    "quotaUser": {
      "location": "query",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
      "type": "string"
    }
  },
  "batchPath": "batch",
  "revision": "20260902",
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "queryMetrics": {
              "methods": {
                "fetch": {
                  "request": {
                    "$ref": "FetchQueryMetricsRequest"
                  },
                  "description": "FetchQueryMetrics fetches the given database query level metrics.",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/queryMetrics:fetch",
                  "response": {
                    "$ref": "FetchQueryMetricsResponse"
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "path": "v1beta/{+parent}/queryMetrics:fetch",
                  "id": "databaseinsights.projects.locations.queryMetrics.fetch",
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "required": true,
                      "type": "string",
                      "location": "path",
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "pattern": "^projects/[^/]+/locations/[^/]+$"
                    }
                  }
                }
              }
            },
            "virtualDbxAgent": {
              "methods": {
                "query": {
                  "parameterOrder": [
                    "parent"
                  ],
                  "description": "RunAgent runs the agent.",
                  "response": {
                    "$ref": "RunAgentResponse"
                  },
                  "request": {
                    "$ref": "RunAgentRequest"
                  },
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/virtualDbxAgent:query",
                  "id": "databaseinsights.projects.locations.virtualDbxAgent.query",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "type": "string",
                      "location": "path",
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "required": true
                    }
                  },
                  "path": "v1beta/{+parent}/virtualDbxAgent:query",
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ]
                }
              }
            },
            "systemMetrics": {
              "methods": {
                "fetch": {
                  "path": "v1beta/{+parent}/systemMetrics:fetch",
                  "request": {
                    "$ref": "FetchSystemMetricsRequest"
                  },
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/systemMetrics:fetch",
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "response": {
                    "$ref": "FetchSystemMetricsResponse"
                  },
                  "description": "FetchSystemMetrics fetches the given system level metrics.",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "type": "string",
                      "required": true,
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "location": "path"
                    }
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "id": "databaseinsights.projects.locations.systemMetrics.fetch"
                }
              }
            }
          }
        }
      }
    }
  },
  "discoveryVersion": "v1",
  "canonicalName": "Database Insights",
  "description": "Database Insights API is a regional service that provides deep performance diagnostics and monitoring for Google Cloud databases. It exposes tools like Query insights, which helps you detect, diagnose, and prevent query performance problems, and System insights, which provides comprehensive telemetry and monitoring for system-level instance metrics.",
  "baseUrl": "https://databaseinsights.googleapis.com/",
  "documentationLink": "https://cloud.google.com/alloydb/docs/query-insights-overview",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/cloud-platform": {
          "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
        }
      }
    }
  },
  "ownerDomain": "google.com",
  "id": "databaseinsights:v1beta",
  "basePath": "",
  "fullyEncodeReservedExpansion": true,
  "mtlsRootUrl": "https://databaseinsights.mtls.googleapis.com/"
}
