{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anygas-xyz/json-schema/anygas-xyz-conditional-request-schema.json",
  "title": "ConditionalRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anygas-xyz-primitives-api-openapi.yml#/components/schemas/ConditionalRequest",
  "type": "object",
  "required": [
    "route",
    "when"
  ],
  "properties": {
    "route": {
      "type": "object",
      "additionalProperties": true
    },
    "when": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "priceAbove",
            "priceBelow",
            "timeAfter"
          ]
        },
        "asset": {
          "type": "string",
          "description": "Required for price conditions, e.g. ETH/USD, BTC/USD, USDG/USD."
        },
        "value": {
          "description": "Numeric price for price conditions; epoch/ISO for timeAfter.",
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        }
      }
    },
    "live": {
      "type": "boolean",
      "default": false
    }
  }
}