{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schedule_id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,128}$"
    },
    "schedule_revision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "project_id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,128}$",
      "description": "Project that owns this record."
    },
    "target": {
      "type": "string",
      "minLength": 1,
      "maxLength": 253
    },
    "include_subdomains": {
      "type": "boolean"
    },
    "provider": {
      "type": "string",
      "const": "dataforseo"
    },
    "data_mode": {
      "type": "string",
      "const": "synthetic"
    },
    "metric": {
      "type": "string",
      "const": "rank"
    },
    "scale": {
      "type": "object",
      "properties": {
        "minimum": {
          "type": "number",
          "const": 0
        },
        "maximum": {
          "type": "number",
          "const": 1000
        },
        "name": {
          "type": "string",
          "const": "one_thousand"
        }
      },
      "required": [
        "minimum",
        "maximum",
        "name"
      ],
      "additionalProperties": false
    },
    "items": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "overview_run_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$"
          },
          "slot_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at": {
            "type": "null",
            "description": "UTC timestamp of the observation used here."
          },
          "retrieved_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "freshness": {
            "type": "string",
            "enum": [
              "unknown",
              "stale",
              "fresh"
            ]
          },
          "outcome": {
            "type": "string",
            "enum": [
              "unknown",
              "measured"
            ]
          },
          "execution": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "queued",
                  "running",
                  "succeeded",
                  "failed",
                  "reconciliation_required"
                ],
                "description": "Resource lifecycle status."
              },
              "error_code": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z_]{1,80}$",
                    "description": "Latest delivery detail code; null when no failure or retry has been recorded."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Latest delivery detail code; null when no failure or retry has been recorded."
              },
              "provider_task_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9_-]{1,128}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "status",
              "error_code",
              "provider_task_id"
            ],
            "additionalProperties": false
          },
          "cost": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "const": "USD"
              },
              "max_cost_microusd": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "reserved_cost_microusd": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "provider_reported_cost_microusd": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "request_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "reconciliation_required": {
                "type": "boolean"
              }
            },
            "required": [
              "currency",
              "max_cost_microusd",
              "reserved_cost_microusd",
              "provider_reported_cost_microusd",
              "request_count",
              "reconciliation_required"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "overview_run_id",
          "slot_at",
          "rank",
          "observed_at",
          "retrieved_at",
          "freshness",
          "outcome",
          "execution",
          "cost"
        ],
        "additionalProperties": false,
        "description": "Records in this bounded page."
      },
      "description": "Records in this bounded page."
    },
    "alert_candidates": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$",
            "description": "Resource identifier returned by the operation."
          },
          "schedule_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$"
          },
          "provider": {
            "type": "string",
            "const": "dataforseo"
          },
          "metric": {
            "type": "string",
            "const": "rank"
          },
          "rank_scale": {
            "type": "string",
            "const": "one_thousand"
          },
          "previous_run_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$"
          },
          "current_run_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$"
          },
          "previous_rank": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "current_rank": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "change": {
            "type": "integer",
            "minimum": -1000,
            "maximum": 1000
          },
          "observed_at": {
            "type": "null",
            "description": "UTC timestamp of the observation used here."
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
          },
          "delivery_state": {
            "type": "string",
            "const": "candidate_only"
          }
        },
        "required": [
          "id",
          "schedule_id",
          "provider",
          "metric",
          "rank_scale",
          "previous_run_id",
          "current_run_id",
          "previous_rank",
          "current_rank",
          "change",
          "observed_at",
          "retrieved_at",
          "delivery_state"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean",
      "description": "True when another page is available."
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "description": "Opaque continuation for the same listing; null means no further page."
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque continuation for the same listing; null means no further page."
    }
  },
  "required": [
    "schedule_id",
    "schedule_revision",
    "project_id",
    "target",
    "include_subdomains",
    "provider",
    "data_mode",
    "metric",
    "scale",
    "items",
    "alert_candidates",
    "has_more",
    "next_cursor"
  ],
  "additionalProperties": false
}
