{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "acceptanceRef": {
      "properties": {
        "cid": {
          "maxGraphemes": 256,
          "maxLength": 768,
          "minLength": 1,
          "type": "string"
        },
        "sequence": {
          "description": "Raised by every write of the record, a renewal included.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "cid",
        "sequence"
      ],
      "type": "object"
    },
    "appointment": {
      "properties": {
        "id": {
          "description": "A UUID.",
          "maxLength": 36,
          "minLength": 36,
          "type": "string"
        },
        "standing": {
          "description": "Whether the appointment is in force.",
          "knownValues": [
            "in-force",
            "lapsed"
          ],
          "maxGraphemes": 64,
          "maxLength": 192,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "id",
        "standing"
      ],
      "type": "object"
    },
    "invitation": {
      "properties": {
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        },
        "id": {
          "description": "A UUID.",
          "maxLength": 36,
          "minLength": 36,
          "type": "string"
        }
      },
      "required": [
        "id",
        "expiresAt"
      ],
      "type": "object"
    },
    "main": {
      "description": "The organisation's statement of the party's standing, in the organisation's own repository in the space.",
      "key": "literal:self",
      "record": {
        "properties": {
          "acceptance": {
            "description": "The acceptance the organisation acted on, once it has admitted the party.",
            "ref": "#acceptanceRef",
            "type": "ref"
          },
          "appointments": {
            "description": "For each person the party appointed to act for it: whether the appointment is in force at the organisation.",
            "items": {
              "ref": "#appointment",
              "type": "ref"
            },
            "maxLength": 64,
            "type": "array"
          },
          "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"
          },
          "endedBy": {
            "description": "Who ended the relationship, once it has ended.",
            "knownValues": [
              "org",
              "party"
            ],
            "maxGraphemes": 64,
            "maxLength": 192,
            "minLength": 1,
            "type": "string"
          },
          "instance": {
            "description": "The web address (a URL) of the organisation's instance, for display.",
            "maxGraphemes": 512,
            "maxLength": 1536,
            "type": "string"
          },
          "invitation": {
            "ref": "#invitation",
            "type": "ref"
          },
          "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"
          },
          "org": {
            "description": "The organisation that holds the space.",
            "format": "did",
            "type": "string"
          },
          "party": {
            "description": "The party the relationship is with.",
            "format": "did",
            "type": "string"
          },
          "refused": {
            "ref": "#refused",
            "type": "ref"
          },
          "sequence": {
            "description": "Raised by every write of the record, a renewal included.",
            "minimum": 1,
            "type": "integer"
          },
          "standingEpoch": {
            "description": "How many times the organisation has suspended the party.",
            "minimum": 0,
            "type": "integer"
          },
          "state": {
            "description": "The party's standing.",
            "knownValues": [
              "invited",
              "active",
              "suspended",
              "ended"
            ],
            "maxGraphemes": 64,
            "maxLength": 192,
            "minLength": 1,
            "type": "string"
          },
          "version": {
            "description": "The version of these definitions the writer used.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "version",
          "compatibleFrom",
          "org",
          "party",
          "invitation",
          "standingEpoch",
          "instance",
          "sequence",
          "assertedAt",
          "state",
          "appointments"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "refused": {
      "description": "What the organisation did not act on, and a fixed word that says why: the party's acceptance it judged without admitting, and the last delegation it would not take.",
      "properties": {
        "acceptance": {
          "description": "A fixed word: lower-case letters and hyphens, starting with a letter.",
          "maxLength": 63,
          "minLength": 1,
          "type": "string"
        },
        "delegation": {
          "description": "A fixed word: lower-case letters and hyphens, starting with a letter.",
          "maxLength": 63,
          "minLength": 1,
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "id": "network.coopsource.relationship.standing",
  "lexicon": 1
}
