{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aerocell-app/json-schema/aerocell-app-regional-search-schema.json",
  "title": "RegionalSearch",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/aerocell-app-api-openapi.json#/components/schemas/RegionalSearch",
  "type": "object",
  "required": [
    "requested_country_codes",
    "region",
    "trip_days",
    "currency",
    "updated_at",
    "total_matching",
    "browse_url",
    "note",
    "plans"
  ],
  "properties": {
    "requested_country_codes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Za-z]{2}$",
        "description": "Assigned ISO alpha-2 code; catalog-supported XK is also accepted. Codes are case-insensitive."
      }
    },
    "region": {
      "type": [
        "string",
        "null"
      ]
    },
    "trip_days": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 366
    },
    "currency": {
      "type": "string",
      "const": "USD"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Country: upstream catalog snapshot time (five-minute cache). Regional: time the bundle catalog was retrieved; not a provider price-change timestamp."
    },
    "total_matching": {
      "type": "integer",
      "minimum": 0
    },
    "browse_url": {
      "type": "string",
      "format": "uri"
    },
    "note": {
      "type": "string"
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RegionalPlan"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "RegionalPlan": {
      "type": "object",
      "required": [
        "id",
        "name",
        "data_gb",
        "validity_days",
        "price_usd",
        "network",
        "operators",
        "covers_trip",
        "includes_calls",
        "includes_sms",
        "provider_details",
        "plan_page_url",
        "checkout_url",
        "region_code",
        "country_codes",
        "country_count"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,100}$"
        },
        "name": {
          "type": "string"
        },
        "data_gb": {
          "type": "number",
          "minimum": 0,
          "description": "Displayed GB rounded to one decimal; 1 GB = 1024^3 bytes."
        },
        "validity_days": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "price_usd": {
          "type": "number",
          "minimum": 0
        },
        "network": {
          "type": "string"
        },
        "operators": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Catalog operator summary, up to four names; not a complete per-country network map."
        },
        "covers_trip": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "includes_calls": {
          "type": "boolean",
          "description": "Plan includes voice calls (for example a local phone number); most plans are data-only."
        },
        "includes_sms": {
          "type": "boolean",
          "description": "Plan includes SMS."
        },
        "provider_details": {
          "type": "array",
          "maxItems": 10,
          "description": "Network provider's own plan notes in English, such as call allowances or install limits. Usually empty.",
          "items": {
            "type": "object",
            "required": [
              "title",
              "content"
            ],
            "properties": {
              "title": {
                "type": "string",
                "maxLength": 100
              },
              "content": {
                "type": "string",
                "maxLength": 500
              }
            },
            "additionalProperties": false
          }
        },
        "plan_page_url": {
          "type": "string",
          "format": "uri"
        },
        "checkout_url": {
          "type": "string",
          "format": "uri"
        },
        "region_code": {
          "type": "string"
        },
        "country_codes": {
          "type": "array",
          "minItems": 2,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$",
            "description": "Assigned ISO alpha-2 code; catalog-supported XK is also accepted. Codes are case-insensitive."
          }
        },
        "country_count": {
          "type": "integer",
          "minimum": 2
        }
      },
      "additionalProperties": false
    }
  }
}