{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mantic/json-schema/mantic-subscribe-response-schema.json",
  "title": "SubscribeResponse",
  "description": "The metric is charged for and queued, not yet on the calendar: provisioning it\ncan mean enabling a family and forecasting it for the first time.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mantic-calendar-series-api-openapi.yml#/components/schemas/SubscribeResponse",
  "properties": {
    "series_key": {
      "type": "string",
      "title": "Series Key"
    },
    "series": {
      "anyOf": [
        {
          "$ref": "#/$defs/CatalogueSeriesResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "budget": {
      "$ref": "#/$defs/service__api__routes__webapp__calendar_series__BudgetResponse"
    }
  },
  "type": "object",
  "required": [
    "series_key",
    "series",
    "budget"
  ],
  "$defs": {
    "CatalogueSeriesResponse": {
      "properties": {
        "series_key": {
          "type": "string",
          "title": "Series Key"
        },
        "subject": {
          "type": "string",
          "title": "Subject"
        },
        "geography": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Geography"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit"
        },
        "frequency": {
          "type": "string",
          "title": "Frequency"
        },
        "subdomain": {
          "type": "string",
          "title": "Subdomain"
        },
        "state": {
          "$ref": "#/$defs/SeriesState"
        },
        "preview_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Preview Title"
        },
        "next_release_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Release At"
        },
        "reference_period_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reference Period Date"
        },
        "previous_value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previous Value"
        },
        "previous_period_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previous Period Date"
        },
        "unavailable_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unavailable Reason"
        },
        "cost_units": {
          "type": "integer",
          "title": "Cost Units"
        },
        "included": {
          "type": "boolean",
          "title": "Included"
        },
        "first_forecast": {
          "type": "boolean",
          "title": "First Forecast"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "series_key",
        "subject",
        "geography",
        "unit",
        "frequency",
        "subdomain",
        "state",
        "preview_title",
        "next_release_at",
        "reference_period_date",
        "previous_value",
        "previous_period_date",
        "unavailable_reason",
        "cost_units",
        "included",
        "first_forecast"
      ],
      "title": "CatalogueSeriesResponse"
    },
    "SeriesState": {
      "type": "string",
      "enum": [
        "subscribed",
        "pending",
        "available",
        "dormant",
        "unavailable",
        "initialising",
        "failed"
      ],
      "title": "SeriesState",
      "description": "Which control a family offers on a dashboard."
    },
    "service__api__routes__webapp__calendar_series__BudgetResponse": {
      "properties": {
        "total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total"
        },
        "spent": {
          "type": "integer",
          "title": "Spent"
        },
        "remaining": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Remaining"
        }
      },
      "type": "object",
      "required": [
        "total",
        "spent",
        "remaining"
      ],
      "title": "BudgetResponse",
      "description": "`total` and `remaining` are null where nothing is metered: no organisation billed,\nor one whose allowance is unlimited."
    }
  }
}