{
  "$defs": {
    "ConnectDiscordSettings": {
      "additionalProperties": false,
      "description": "Connect an existing Discord webhook, posting a test before saving it.",
      "properties": {
        "name": {
          "anyOf": [
            {
              "maxLength": 64,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "operation": {
          "const": "connect_discord",
          "title": "Operation",
          "type": "string"
        },
        "section": {
          "const": "notifications",
          "title": "Section",
          "type": "string"
        },
        "webhook_url": {
          "title": "Webhook Url",
          "type": "string"
        }
      },
      "required": [
        "webhook_url",
        "section",
        "operation"
      ],
      "title": "ConnectDiscordSettings",
      "type": "object"
    },
    "ConnectWebhookSettings": {
      "additionalProperties": false,
      "description": "Test and save a generic webhook. Reuse its ID to replace URL or credentials.",
      "properties": {
        "bearer_token": {
          "anyOf": [
            {
              "format": "password",
              "type": "string",
              "writeOnly": true
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional Authorization bearer token. Omit for no Authorization header, including when replacing a webhook.",
          "title": "Bearer Token"
        },
        "channel_id": {
          "description": "Choose a stable ID such as webhook-grok. Reusing it replaces this destination and enables it after a successful test.",
          "pattern": "^webhook-[A-Za-z0-9_-]{1,64}$",
          "title": "Channel Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "maxLength": 64,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "operation": {
          "const": "connect_webhook",
          "title": "Operation",
          "type": "string"
        },
        "section": {
          "const": "notifications",
          "title": "Section",
          "type": "string"
        },
        "webhook_url": {
          "description": "Public HTTPS endpoint accepting JSON POSTs. Redirects are refused.",
          "maxLength": 4096,
          "minLength": 1,
          "title": "Webhook Url",
          "type": "string"
        }
      },
      "required": [
        "webhook_url",
        "section",
        "operation",
        "channel_id"
      ],
      "title": "ConnectWebhookSettings",
      "type": "object"
    },
    "NotificationKind": {
      "description": "Kind of notification carried by an intent.",
      "enum": [
        "alert.trigger",
        "trade.filled",
        "approval.required",
        "approval.decided"
      ],
      "title": "NotificationKind",
      "type": "string"
    },
    "RemoveChannelSettings": {
      "additionalProperties": false,
      "description": "Remove a webhook, Discord channel or push device; email can only be disabled.",
      "properties": {
        "channel_id": {
          "maxLength": 256,
          "minLength": 1,
          "title": "Channel Id",
          "type": "string"
        },
        "operation": {
          "const": "remove_channel",
          "title": "Operation",
          "type": "string"
        },
        "section": {
          "const": "notifications",
          "title": "Section",
          "type": "string"
        }
      },
      "required": [
        "section",
        "operation",
        "channel_id"
      ],
      "title": "RemoveChannelSettings",
      "type": "object"
    },
    "UpdateChannelSettings": {
      "additionalProperties": false,
      "description": "Update a destination\u2019s label, enable state, detail level or event subscriptions.",
      "properties": {
        "channel_id": {
          "maxLength": 256,
          "minLength": 1,
          "title": "Channel Id",
          "type": "string"
        },
        "detail_level": {
          "anyOf": [
            {
              "enum": [
                "compact",
                "detailed",
                "full"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Detail Level"
        },
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Enabled"
        },
        "event_types": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/NotificationKind"
              },
              "maxItems": 4,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Event Types"
        },
        "name": {
          "anyOf": [
            {
              "maxLength": 64,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "operation": {
          "const": "update_channel",
          "title": "Operation",
          "type": "string"
        },
        "section": {
          "const": "notifications",
          "title": "Section",
          "type": "string"
        }
      },
      "required": [
        "section",
        "operation",
        "channel_id"
      ],
      "title": "UpdateChannelSettings",
      "type": "object"
    },
    "UpdateSessionSettings": {
      "additionalProperties": false,
      "description": "Mute/unmute or reroute a session without restarting it.",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Enabled"
        },
        "notification_channels": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Notification Channels"
        },
        "operation": {
          "const": "update_session",
          "title": "Operation",
          "type": "string"
        },
        "section": {
          "const": "notifications",
          "title": "Section",
          "type": "string"
        },
        "session_id": {
          "maxLength": 256,
          "minLength": 1,
          "title": "Session Id",
          "type": "string"
        }
      },
      "required": [
        "section",
        "operation",
        "session_id"
      ],
      "title": "UpdateSessionSettings",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "change": {
      "description": "Notification change: connect Discord or a generic webhook, update/remove a channel, or edit one session's routing. Only section=notifications is supported.",
      "discriminator": {
        "mapping": {
          "connect_discord": "#/$defs/ConnectDiscordSettings",
          "connect_webhook": "#/$defs/ConnectWebhookSettings",
          "remove_channel": "#/$defs/RemoveChannelSettings",
          "update_channel": "#/$defs/UpdateChannelSettings",
          "update_session": "#/$defs/UpdateSessionSettings"
        },
        "propertyName": "operation"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/ConnectDiscordSettings"
        },
        {
          "$ref": "#/$defs/ConnectWebhookSettings"
        },
        {
          "$ref": "#/$defs/UpdateChannelSettings"
        },
        {
          "$ref": "#/$defs/RemoveChannelSettings"
        },
        {
          "$ref": "#/$defs/UpdateSessionSettings"
        }
      ],
      "title": "Change",
      "type": "object"
    }
  },
  "required": [
    "change"
  ],
  "title": "configure_settingsArguments",
  "type": "object"
}
