{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-environment-member-schema.json",
  "title": "Environment member",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-projects-environments-api-openapi.yml#/components/schemas/EnvironmentMember",
  "type": "object",
  "required": [
    "user_id",
    "role",
    "email",
    "name",
    "linux_username",
    "port_range_start",
    "ssh_public_key",
    "provisioned_at",
    "created_at"
  ],
  "properties": {
    "user_id": {
      "type": "string",
      "format": "uuid"
    },
    "role": {
      "$ref": "#/$defs/EnvironmentRole"
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "format": "email"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "linux_username": {
      "type": [
        "string",
        "null"
      ],
      "description": "Linux account provisioned for this member inside the environment."
    },
    "port_range_start": {
      "type": [
        "integer",
        "null"
      ],
      "description": "First port of the member's reserved range."
    },
    "ssh_public_key": {
      "type": "boolean",
      "description": "Whether a key is on file (the key itself is only fetched by the daemon)."
    },
    "provisioned_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the daemon last confirmed the account + key as provisioned."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "EnvironmentRole": {
      "type": "string",
      "enum": [
        "owner",
        "maintainer",
        "developer",
        "viewer"
      ],
      "description": "Role of a member on an environment; `owner` ≥ `maintainer` ≥ `developer` ≥ `viewer`."
    }
  }
}