{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gajo-io/json-schema/gajo-io-me-result-schema.json",
  "title": "MeResult",
  "description": "Envelope with account details.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gajo-io-account-api-openapi.yml#/components/schemas/MeResult",
  "allOf": [
    {
      "$ref": "#/$defs/ApiResult"
    },
    {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "$ref": "#/$defs/Me"
        }
      }
    }
  ],
  "$defs": {
    "ApiResult": {
      "type": "object",
      "description": "Envelope shared by every response.",
      "required": [
        "success"
      ],
      "properties": {
        "success": {
          "type": "boolean",
          "description": "`true` when the request succeeded."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human-readable status or error message. Often `null` on reads."
        },
        "data": {
          "description": "Operation-specific payload; `null` or absent when there is nothing to return."
        }
      }
    },
    "Me": {
      "type": "object",
      "required": [
        "plan",
        "email",
        "urlCount",
        "apiAccess",
        "customCodes",
        "routingRules",
        "memberSince"
      ],
      "properties": {
        "plan": {
          "$ref": "#/$defs/Plan"
        },
        "email": {
          "type": "string",
          "description": "Account email address (empty string if it cannot be resolved)."
        },
        "urlCount": {
          "type": "integer",
          "format": "int64",
          "minimum": 0,
          "description": "Total links ever created on the account."
        },
        "apiAccess": {
          "type": "boolean",
          "description": "Whether the plan includes the API (always `true` for account plans)."
        },
        "customCodes": {
          "type": "boolean",
          "description": "Whether the plan can create custom short codes (Pro)."
        },
        "routingRules": {
          "type": "boolean",
          "description": "Whether the plan can use routing, templates, bindings and deep links (Pro)."
        },
        "memberSince": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Plan": {
      "type": "string",
      "enum": [
        "Free",
        "Basic",
        "Pro"
      ],
      "description": "Gajo account plan."
    }
  }
}