{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cuebiq/main/json-schema/cuebiq-campaign-schema.json",
  "title": "Campaign",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cuebiq-openapi.json#/components/schemas/Campaign",
  "required": [
    "id",
    "name",
    "flightDateRange",
    "conversionIntervalRange",
    "status",
    "reports"
  ],
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/UUID"
    },
    "name": {
      "type": "string"
    },
    "brandId": {
      "format": "int32",
      "type": "integer"
    },
    "flightDateRange": {
      "$ref": "#/$defs/LocalDateRange"
    },
    "conversionWindow": {
      "format": "int32",
      "type": "integer"
    },
    "conversionIntervalRange": {
      "$ref": "#/$defs/LocalDateRange"
    },
    "externalRef": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "reports": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReportSummary"
      }
    }
  },
  "$defs": {
    "LocalDate": {
      "format": "date",
      "type": "string"
    },
    "LocalDateRange": {
      "required": [
        "start",
        "end"
      ],
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/$defs/LocalDate"
        },
        "end": {
          "$ref": "#/$defs/LocalDate"
        }
      }
    },
    "ReportSummary": {
      "required": [
        "id",
        "name"
      ],
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/UUID"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "UUID": {
      "format": "uuid",
      "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
      "type": "string"
    }
  }
}