{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-platform/json-schema/google-cloud-platform-query-assets-request-schema.json",
  "title": "QueryAssetsRequest",
  "description": "QueryAssets request.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-platform-cloudasset-v1-api-openapi.yml#/components/schemas/QueryAssetsRequest",
  "properties": {
    "statement": {
      "description": "Optional. A SQL statement that's compatible with [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql).",
      "type": "string"
    },
    "pageSize": {
      "type": "integer",
      "description": "Optional. The maximum number of rows to return in the results. Responses are limited to 10 MB and 1000 rows. By default, the maximum row count is 1000. When the byte or row count limit is reached, the rest of the query results will be paginated. The field will be ignored when [output_config] is specified.",
      "format": "int32"
    },
    "readTime": {
      "description": "Optional. Queries cloud assets as they appeared at the specified point in time.",
      "format": "google-datetime",
      "type": "string"
    },
    "outputConfig": {
      "$ref": "#/$defs/QueryAssetsOutputConfig",
      "description": "Optional. Destination where the query results will be saved. When this field is specified, the query results won't be saved in the [QueryAssetsResponse.query_result]. Instead [QueryAssetsResponse.output_config] will be set. Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used to check the status of the query job when passed to a following [QueryAssets] API call."
    },
    "readTimeWindow": {
      "$ref": "#/$defs/TimeWindow",
      "description": "Optional. [start_time] is required. [start_time] must be less than [end_time] Defaults [end_time] to now if [start_time] is set and [end_time] isn't. Maximum permitted time range is 7 days."
    },
    "jobReference": {
      "type": "string",
      "description": "Optional. Reference to the query job, which is from the `QueryAssetsResponse` of previous `QueryAssets` call."
    },
    "pageToken": {
      "description": "Optional. A page token received from previous `QueryAssets`. The field will be ignored when [output_config] is specified.",
      "type": "string"
    },
    "timeout": {
      "type": "string",
      "format": "google-duration",
      "description": "Optional. Specifies the maximum amount of time that the client is willing to wait for the query to complete. By default, this limit is 5 min for the first query, and 1 minute for the following queries. If the query is complete, the `done` field in the `QueryAssetsResponse` is true, otherwise false. Like BigQuery [jobs.query API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) The call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. The field will be ignored when [output_config] is specified."
    }
  },
  "type": "object",
  "$defs": {
    "GoogleCloudAssetV1QueryAssetsOutputConfigBigQueryDestination": {
      "description": "BigQuery destination.",
      "type": "object",
      "properties": {
        "table": {
          "type": "string",
          "description": "Required. The BigQuery table where the query results will be saved. If this table does not exist, a new table with the given name will be created."
        },
        "writeDisposition": {
          "description": "Specifies the action that occurs if the destination table or partition already exists. The following values are supported: * WRITE_TRUNCATE: If the table or partition already exists, BigQuery overwrites the entire table or all the partitions data. * WRITE_APPEND: If the table or partition already exists, BigQuery appends the data to the table or the latest partition. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY.",
          "type": "string"
        },
        "dataset": {
          "description": "Required. The BigQuery dataset where the query results will be saved. It has the format of \"projects/{projectId}/datasets/{datasetId}\".",
          "type": "string"
        }
      }
    },
    "QueryAssetsOutputConfig": {
      "properties": {
        "bigqueryDestination": {
          "$ref": "#/$defs/GoogleCloudAssetV1QueryAssetsOutputConfigBigQueryDestination",
          "description": "BigQuery destination where the query results will be saved."
        }
      },
      "description": "Output configuration query assets.",
      "type": "object"
    },
    "TimeWindow": {
      "description": "A time window specified by its `start_time` and `end_time`.",
      "type": "object",
      "properties": {
        "startTime": {
          "format": "google-datetime",
          "type": "string",
          "description": "Start time of the time window (exclusive)."
        },
        "endTime": {
          "description": "End time of the time window (inclusive). If not specified, the current timestamp is used instead.",
          "format": "google-datetime",
          "type": "string"
        }
      }
    }
  }
}