{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "The people who act for a party that is itself an organisation, with a lease, in the party's own repository in the space.",
      "key": "literal:self",
      "record": {
        "properties": {
          "assertedAt": {
            "format": "datetime",
            "type": "string"
          },
          "compatibleFrom": {
            "description": "The earliest version whose reader acts on this record correctly; never above version. A reader of an earlier version refuses the record. A writer that only adds optional fields or values keeps it; one that changes a meaning raises it.",
            "minimum": 1,
            "type": "integer"
          },
          "kind": {
            "description": "The kind of relationship. A reader refuses a kind it does not know or does not serve.",
            "knownValues": [
              "membership",
              "participation",
              "partnership"
            ],
            "maxGraphemes": 64,
            "maxLength": 192,
            "minLength": 1,
            "type": "string"
          },
          "lifetimeSeconds": {
            "description": "How long the party lets this delegation stand without renewing it.",
            "maximum": 2678400,
            "minimum": 60,
            "type": "integer"
          },
          "org": {
            "description": "The organisation that holds the space.",
            "format": "did",
            "type": "string"
          },
          "party": {
            "description": "The party the relationship is with.",
            "format": "did",
            "type": "string"
          },
          "representatives": {
            "items": {
              "ref": "#representative",
              "type": "ref"
            },
            "maxLength": 5,
            "type": "array"
          },
          "sequence": {
            "description": "Raised by every write of the record, a renewal included.",
            "minimum": 1,
            "type": "integer"
          },
          "standingEpoch": {
            "description": "The standing epoch of the organisation's statement the party last applied.",
            "minimum": 0,
            "type": "integer"
          },
          "validUntil": {
            "description": "The lease: the delegation is not in force after this.",
            "format": "datetime",
            "type": "string"
          },
          "version": {
            "description": "The version of these definitions the writer used.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "version",
          "compatibleFrom",
          "org",
          "party",
          "representatives",
          "standingEpoch",
          "sequence",
          "assertedAt",
          "lifetimeSeconds",
          "validUntil"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "representative": {
      "properties": {
        "appointment": {
          "description": "A UUID.",
          "maxLength": 36,
          "minLength": 36,
          "type": "string"
        },
        "mandate": {
          "description": "What the person may do for the party.",
          "items": {
            "maxGraphemes": 128,
            "maxLength": 384,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 64,
          "minLength": 1,
          "type": "array"
        },
        "person": {
          "format": "did",
          "type": "string"
        },
        "revision": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "person",
        "appointment",
        "revision",
        "mandate"
      ],
      "type": "object"
    }
  },
  "id": "network.coopsource.relationship.delegation",
  "lexicon": 1
}
