{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lensmor/json-schema/lensmor-event-full-access-unlock-result-schema.json",
  "title": "EventFullAccessUnlockResult",
  "description": "Result of atomically requesting all available event access layers.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lensmor-openapi.json#/components/schemas/EventFullAccessUnlockResult",
  "type": "object",
  "required": [
    "success",
    "alreadyUnlocked",
    "eventUnlocked",
    "visitorUnlocked",
    "visitorSkipped",
    "totalCreditsUsed",
    "balanceAfter",
    "event"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Whether this operation or item completed successfully."
    },
    "alreadyUnlocked": {
      "type": "boolean",
      "description": "Whether the requested access was already available before this call."
    },
    "eventUnlocked": {
      "type": "boolean",
      "description": "Whether this call newly unlocked the base event layer."
    },
    "visitorUnlocked": {
      "type": "boolean",
      "description": "Whether this call newly unlocked the registered Visitor layer."
    },
    "visitorSkipped": {
      "type": "boolean",
      "description": "Whether Visitor access was skipped because it was unavailable or not required."
    },
    "totalCreditsUsed": {
      "type": "integer",
      "minimum": 0,
      "description": "Total credits consumed across all requested access layers."
    },
    "balanceAfter": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "subscriptionBalance",
            "permanentBalance",
            "totalBalance",
            "unlimited"
          ],
          "properties": {
            "subscriptionBalance": {
              "type": "number",
              "description": "Subscription credits currently available to spend."
            },
            "permanentBalance": {
              "type": "number",
              "description": "Permanent Balance returned as part of this event full access unlock result object."
            },
            "totalBalance": {
              "type": "number",
              "description": "Total credits currently available to spend across all buckets."
            },
            "unlimited": {
              "type": "boolean",
              "description": "Unlimited returned as part of this event full access unlock result object."
            }
          },
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ],
      "description": "Credit balance remaining after the operation."
    },
    "event": {
      "$ref": "#/$defs/EventUnlockIdentity",
      "description": "Event record associated with this result."
    }
  },
  "$defs": {
    "EventUnlockIdentity": {
      "type": "object",
      "required": [
        "id",
        "eventId",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable Lensmor identifier for this record."
        },
        "eventId": {
          "type": "string",
          "description": "Public event identifier accepted by event-scoped endpoints."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name when available."
        }
      },
      "description": "Compact identity of the event affected by an unlock operation."
    }
  }
}