{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-campaign-manager/json-schema/google-campaign-manager-report-data-query-request-schema.json",
  "title": "ReportDataQueryRequest",
  "description": "The request body containing ad-hoc query parameters.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-campaign-manager-report-data-api-openapi.yml#/components/schemas/ReportDataQueryRequest",
  "properties": {
    "sortBys": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SortBy"
      },
      "description": "Optional. Sort options across either requested dimensions or metrics."
    },
    "metricNames": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Required. The list of metric names to include."
    },
    "dimensionNames": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "Optional. The list of dimension names to group by."
    },
    "pageToken": {
      "description": "Optional. Continuation token for paginating results.",
      "type": "string"
    },
    "dimensionFilters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DimensionValue"
      },
      "description": "Optional. The list of dimension values on which report lines are filtered. Utilizes the existing legacy filter message `DimensionValue`."
    },
    "maxResults": {
      "description": "Optional. Maximum number of result rows to return per page. The default value is 100. The maximum allowed value is 1000. Values above 1000 will be coerced (clamped) down to 1000. Negative values will be rejected.",
      "format": "int32",
      "type": "integer"
    },
    "dateRange": {
      "$ref": "#/$defs/DateRange",
      "description": "Optional. The requested date range covering the report duration."
    }
  },
  "type": "object",
  "$defs": {
    "DateRange": {
      "properties": {
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "kind": {
          "description": "The kind of resource this is, in this case dfareporting#dateRange.",
          "type": "string"
        },
        "startDate": {
          "format": "date",
          "type": "string"
        },
        "relativeDateRange": {
          "description": "The date range relative to the date of when the report is run.",
          "type": "string",
          "enum": [
            "TODAY",
            "YESTERDAY",
            "WEEK_TO_DATE",
            "MONTH_TO_DATE",
            "QUARTER_TO_DATE",
            "YEAR_TO_DATE",
            "PREVIOUS_WEEK",
            "PREVIOUS_MONTH",
            "PREVIOUS_QUARTER",
            "PREVIOUS_YEAR",
            "LAST_7_DAYS",
            "LAST_30_DAYS",
            "LAST_90_DAYS",
            "LAST_365_DAYS",
            "LAST_24_MONTHS",
            "LAST_14_DAYS",
            "LAST_60_DAYS"
          ]
        }
      },
      "type": "object",
      "description": "Represents a date range."
    },
    "DimensionValue": {
      "type": "object",
      "description": "Represents a DimensionValue resource.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID associated with the value if available."
        },
        "value": {
          "type": "string",
          "description": "The value of the dimension."
        },
        "dimensionName": {
          "description": "The name of the dimension.",
          "type": "string"
        },
        "matchType": {
          "type": "string",
          "enum": [
            "EXACT",
            "BEGINS_WITH",
            "CONTAINS",
            "WILDCARD_EXPRESSION"
          ],
          "description": "Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT."
        },
        "etag": {
          "type": "string",
          "description": "The eTag of this response for caching purposes."
        },
        "kind": {
          "description": "The kind of resource this is, in this case dfareporting#dimensionValue.",
          "type": "string"
        }
      }
    },
    "SortBy": {
      "type": "object",
      "properties": {
        "sortOrder": {
          "enum": [
            "ASCENDING",
            "DESCENDING"
          ],
          "type": "string",
          "description": "Optional. The sort order of this column."
        },
        "name": {
          "type": "string",
          "description": "Required. The dimension or metric field name to sort on."
        }
      },
      "description": "Specifies the sort configuration for a specific field in the report."
    }
  }
}