{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/inboxacademy-io/json-schema/inboxacademy-io-gate-unlock-response-schema.json",
  "title": "GateUnlockResponse",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/inboxacademy-io-openapi.json#/components/schemas/GateUnlockResponse",
  "properties": {
    "status": {
      "description": "`unlocked`: the learner was waiting at the gate and has moved on. `unlocked_in_advance`: the learner has not reached the gate yet and will pass it without stopping. `already_unlocked`: nothing changed; the gate was unlocked before. For an enrollment gate, `unlocked` means the enrollment is now active, and `already_unlocked` that it already was.",
      "enum": [
        "unlocked",
        "unlocked_in_advance",
        "already_unlocked"
      ],
      "title": "Status",
      "type": "string"
    },
    "gate": {
      "description": "The key of the gate that was unlocked.",
      "title": "Gate",
      "type": "string"
    },
    "enrollment": {
      "$ref": "#/$defs/EnrollmentResponse"
    }
  },
  "required": [
    "status",
    "gate",
    "enrollment"
  ],
  "type": "object",
  "$defs": {
    "EnrollmentResponse": {
      "properties": {
        "id": {
          "description": "The unique identifier of the enrollment.",
          "minimum": 1,
          "title": "Id",
          "type": "integer"
        },
        "email": {
          "description": "The email address of the learner to be enrolled.",
          "title": "Email",
          "type": "string"
        },
        "course_slug": {
          "description": "The slug of the course the learner is enrolled in.",
          "title": "Course Slug",
          "type": "string"
        },
        "status": {
          "description": "The status of the enrollment.",
          "title": "Status",
          "type": "string"
        },
        "enrolled_at": {
          "description": "The timestamp when the learner was enrolled.",
          "format": "date-time",
          "title": "Enrolled At",
          "type": "string"
        },
        "activated_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The timestamp when the enrollment was activated.",
          "title": "Activated At"
        },
        "waiting_at_gate": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The key of the gate the learner is waiting at, if their progress is held at one. The enrollment's status stays `active` while it waits - except at a course's enrollment gate, which holds the enrollment `unverified` until it is unlocked.",
          "title": "Waiting At Gate"
        }
      },
      "required": [
        "id",
        "email",
        "course_slug",
        "status",
        "enrolled_at"
      ],
      "title": "EnrollmentResponse",
      "type": "object"
    }
  }
}