{
  "$schema": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/schemas/comcom-meta.schema.json",
  "$id": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/profiles/v0.2/operations.communications/comcom-notification-preferences-update/schemas/input.schema.json",
  "title": "Notification Preferences Update input",
  "description": "Update notification preferences using an exact, schema-validated Comcom interaction.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "capability",
    "parameters"
  ],
  "properties": {
    "capability": {
      "const": "comcom.notification.preferences.update"
    },
    "parameters": {
      "type": "object",
      "description": "Notification Preferences Update parameters.",
      "additionalProperties": false,
      "required": [
        "notificationPreferencesId",
        "expectedRevision",
        "changes"
      ],
      "properties": {
        "notificationPreferencesId": {
          "type": "string",
          "description": "NotificationPreferences URI.",
          "format": "uri-reference"
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 0
        },
        "changes": {
          "type": "object",
          "description": "Permitted NotificationPreferences changes.",
          "additionalProperties": false,
          "required": [],
          "properties": {
            "statusCode": {
              "type": "string",
              "description": "Profile-defined business state.",
              "pattern": "^[a-z][a-zA-Z0-9.-]{0,63}$"
            },
            "senderId": {
              "type": "string",
              "description": "Originating entity URI.",
              "format": "uri-reference"
            },
            "recipientIds": {
              "type": "array",
              "description": "Recipient URIs.",
              "items": {
                "type": "string",
                "description": "Recipient URI.",
                "format": "uri-reference"
              },
              "minItems": 1,
              "uniqueItems": true,
              "maxItems": 1000
            },
            "topic": {
              "type": "string",
              "description": "Receiver-declared topic.",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
            },
            "subject": {
              "type": "string",
              "description": "Short subject.",
              "maxLength": 200
            },
            "body": {
              "type": "string",
              "description": "Plain-text content.",
              "maxLength": 10000
            },
            "language": {
              "type": "string",
              "description": "BCP 47 language tag.",
              "pattern": "^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$"
            },
            "occurredAt": {
              "type": "string",
              "description": "Communication instant.",
              "format": "date-time"
            }
          }
        }
      }
    }
  }
}
