REST Resource: queries

Resource: Query

Returned when you request a list of queries or a specific query. Also, used by customer to create and update a query.

JSON representation
{
  "queryName": string,
  "queryText": string,
  "parameterTypes": {
    string: {
      object(ParameterType)
    },
    ...
  },
  "mergeSpec": {
    object(MergeSpec)
  },
  "isGlobal": boolean,
  "queryState": enum(QueryState),
  "queryVersion": enum(QueryVersion),
  "lastUpdatedMillis": string,
  "lastUpdateEmail": string,
  "creatorEmail": string
}
Fields
queryName

string

Query's unique name.

queryText

string

Query text.

parameterTypes

map (key: string, value: object(ParameterType))

Any additional parameters expected by the query. Maps each argument name to its argument type.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

mergeSpec

object(MergeSpec)

Instructions for row merging. If present, then any rows that would have been dropped for privacy will be combined into one. This will be included in the result if the merged row meets privacy restrictions.

isGlobal

boolean

True if the query is defined as global; otherwise the query can be used only by a particular customer (or set of customers).

queryState

enum(QueryState)

This field defines whether a query is still in development. If it is in development, it should not be executable except by admin user.

queryVersion

enum(QueryVersion)

Define what version of the api query must be run in.

lastUpdatedMillis

string (int64 format)

Timestamp for when query was last updated.

lastUpdateEmail

string

Email address of who last updated the query.

creatorEmail

string

Email address of who created the query.

MergeSpec

Merge instructions for a result schema.

JSON representation
{
  "column": {
    string: {
      object(MergeColumn)
    },
    ...
  }
}
Fields
column

map (key: string, value: object(MergeColumn))

Instructions for merging each column, keyed by name. Any missing columns will be treated as MERGE_TYPE_UNSPECIFIED.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

QueryState

The list of states that a query can be in.

Enums
QUERY_STATE_UNSPECIFIED Query state is unspecified.
QUERY_STATE_RUNNABLE Query is available to be run by customer.
QUERY_STATE_DEVELOPMENT Query is not visible to any non-admin user.
QUERY_STATE_DRAFT Customer has created query but has not enabled it yet.
QUERY_STATE_DELETED Query has been soft deleted. Deletion could have been by full-circle or by the customer
QUERY_STATE_WHITELISTED Query has been created by a member of Ads Data Hub. Queries with this state will bypass certain checks. Also, queries with this state cannot be updated by external customer.

QueryVersion

List of api versions that a query can be run on.

Enums
QUERY_VERSION_UNSPECIFIED version unspecified
QUERY_VERSION_1 API version 1
QUERY_VERSION_2 Run through query mod service

Methods

create

Creates and stores a query for later execution.

delete

Deletes a stored query.

execute

Synchronously executes the query defined in ExecuteQueryRequest.

list

Retrieves every query to which a customer has access.

patch

Updates an existing query.

rename

Renames an existing query.

start

Starts execution for a stored query.