{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/everyn-ai/json-schema/everyn-ai-workspace-usage-unavailable-response-schema.json",
  "title": "WorkspaceUsageUnavailableResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/everyn-ai-usage-api-openapi.yml#/components/schemas/WorkspaceUsageUnavailableResponse",
  "additionalProperties": false,
  "properties": {
    "availability": {
      "const": "unavailable",
      "title": "Availability",
      "type": "string"
    },
    "billingAccountId": {
      "title": "Billingaccountid",
      "type": "string"
    },
    "calculatedAt": {
      "format": "date-time",
      "title": "Calculatedat",
      "type": "string"
    },
    "managedAi": {
      "anyOf": [
        {
          "$ref": "#/$defs/WorkspaceManagedAiResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "organizationId": {
      "title": "Organizationid",
      "type": "string"
    },
    "primaryConsequence": {
      "enum": [
        "subscription_hard_stop",
        "financial_hold",
        "rows_unavailable"
      ],
      "title": "Primaryconsequence",
      "type": "string"
    },
    "reason": {
      "const": "row_period_unavailable",
      "title": "Reason",
      "type": "string"
    }
  },
  "required": [
    "organizationId",
    "billingAccountId",
    "calculatedAt",
    "availability",
    "reason",
    "managedAi",
    "primaryConsequence"
  ],
  "type": "object",
  "$defs": {
    "CustomerMoneyResponse": {
      "additionalProperties": false,
      "properties": {
        "amount": {
          "description": "Exact base-10 amount serialized without binary floating point or exponent notation.",
          "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$",
          "title": "Amount",
          "type": "string"
        },
        "currencyCode": {
          "maxLength": 3,
          "minLength": 3,
          "title": "Currencycode",
          "type": "string"
        }
      },
      "required": [
        "currencyCode",
        "amount"
      ],
      "title": "CustomerMoneyResponse",
      "type": "object"
    },
    "WorkspaceManagedAiExpirationResponse": {
      "additionalProperties": false,
      "properties": {
        "amount": {
          "$ref": "#/$defs/CustomerMoneyResponse"
        },
        "expiresAt": {
          "format": "date-time",
          "title": "Expiresat",
          "type": "string"
        }
      },
      "required": [
        "expiresAt",
        "amount"
      ],
      "title": "WorkspaceManagedAiExpirationResponse",
      "type": "object"
    },
    "WorkspaceManagedAiResponse": {
      "additionalProperties": false,
      "properties": {
        "executionSafe": {
          "$ref": "#/$defs/CustomerMoneyResponse"
        },
        "nextExpiration": {
          "anyOf": [
            {
              "$ref": "#/$defs/WorkspaceManagedAiExpirationResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "settledBalance": {
          "$ref": "#/$defs/CustomerMoneyResponse"
        },
        "sources": {
          "items": {
            "$ref": "#/$defs/WorkspaceManagedAiSourceResponse"
          },
          "title": "Sources",
          "type": "array"
        },
        "status": {
          "enum": [
            "available",
            "low",
            "unavailable"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "required": [
        "executionSafe",
        "settledBalance",
        "status",
        "sources",
        "nextExpiration"
      ],
      "title": "WorkspaceManagedAiResponse",
      "type": "object"
    },
    "WorkspaceManagedAiSourceResponse": {
      "additionalProperties": false,
      "properties": {
        "available": {
          "$ref": "#/$defs/CustomerMoneyResponse"
        },
        "kind": {
          "enum": [
            "cardless_sample",
            "promotional",
            "recurring",
            "purchased",
            "correction"
          ],
          "title": "Kind",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "available"
      ],
      "title": "WorkspaceManagedAiSourceResponse",
      "type": "object"
    }
  }
}