{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/romm/json-schema/romm-notification-channel-update-payload-schema.json",
  "title": "NotificationChannelUpdatePayload",
  "description": "The fields to change; a null `topics` forwards every topic, an empty `secret` drops it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/romm-notification-channels-api-openapi.yml#/components/schemas/NotificationChannelUpdatePayload",
  "properties": {
    "name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Enabled"
    },
    "min_level": {
      "anyOf": [
        {
          "$ref": "#/$defs/NotificationChannelMinLevel"
        },
        {
          "type": "null"
        }
      ]
    },
    "topics": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/NotificationTopic"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topics"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Url"
    },
    "secret": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret"
    },
    "address": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 320
        },
        {
          "type": "null"
        }
      ],
      "title": "Address"
    },
    "fields": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "items": {
                  "type": "string",
                  "maxLength": 2000
                },
                "type": "array",
                "maxItems": 20
              }
            ]
          },
          "type": "object",
          "maxProperties": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Fields"
    }
  },
  "type": "object",
  "$defs": {
    "NotificationChannelMinLevel": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "error"
      ],
      "title": "NotificationChannelMinLevel",
      "description": "The least severe notification a channel forwards; success ranks as info."
    },
    "NotificationTopic": {
      "type": "string",
      "enum": [
        "scans",
        "tasks",
        "streaming",
        "devices",
        "account",
        "custom"
      ],
      "title": "NotificationTopic",
      "description": "The groups a notification channel picks what it forwards by."
    }
  }
}