{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-invitation-schema.json",
  "title": "Invitation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-invitations-api-openapi.yml#/components/schemas/Invitation",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "description": "The unique identifier of an invitation."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "The email address of the user to be invited.",
      "maxLength": 254
    },
    "role": {
      "allOf": [
        {
          "$ref": "#/$defs/RoleEnum"
        }
      ],
      "description": "The role that the user will have in the organization, should the user accept.\n\n* `OWNER` - Owner\n* `ADMIN` - Administrator\n* `CONTRIB` - Contributor\n* `VIEWER` - Viewer\n* `NO_SECRETS` - NoSecretsViewer"
    },
    "inviter": {
      "type": "string",
      "format": "uri",
      "readOnly": true,
      "description": "The user that created the invitation."
    },
    "inviter_name": {
      "type": "string",
      "readOnly": true,
      "description": "The name of the user that created the invitation."
    },
    "state": {
      "type": "string",
      "readOnly": true,
      "description": "The current state of the invitation."
    },
    "state_detail": {
      "type": "string",
      "readOnly": true,
      "description": "Additional details about the state of the invitation."
    },
    "membership": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "readOnly": true,
      "description": "The resulting membership, should the user accept."
    },
    "organization": {
      "type": "string",
      "format": "uri",
      "readOnly": true,
      "description": "The organization that the user will become a member of, should the user accept."
    }
  },
  "required": [
    "email",
    "id",
    "inviter",
    "inviter_name",
    "membership",
    "organization",
    "role",
    "state",
    "state_detail",
    "url"
  ],
  "$defs": {
    "RoleEnum": {
      "enum": [
        "OWNER",
        "ADMIN",
        "CONTRIB",
        "VIEWER",
        "NO_SECRETS"
      ],
      "type": "string",
      "description": "* `OWNER` - Owner\n* `ADMIN` - Administrator\n* `CONTRIB` - Contributor\n* `VIEWER` - Viewer\n* `NO_SECRETS` - NoSecretsViewer"
    }
  }
}