{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "setId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Identifier of the set returned by its create or list operation."
    },
    "expectedRevision": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740990,
      "description": "Revision last read by the caller; mismatches reject concurrent updates."
    },
    "approved": {
      "type": "boolean",
      "const": true,
      "description": "Explicit approval required to freeze this customer and competitor selection."
    },
    "members": {
      "minItems": 2,
      "maxItems": 11,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,128}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "customer",
              "competitor"
            ]
          },
          "scope": {
            "type": "object",
            "properties": {
              "target_kind": {
                "type": "string",
                "enum": [
                  "domain",
                  "exact_url"
                ]
              },
              "target": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "include_subdomains": {
                "type": "boolean"
              }
            },
            "required": [
              "target_kind",
              "target",
              "include_subdomains"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "role",
          "scope"
        ],
        "additionalProperties": false
      },
      "description": "Customer and competitor members approved for this set revision."
    }
  },
  "required": [
    "setId",
    "expectedRevision",
    "approved",
    "members"
  ],
  "additionalProperties": false
}
