{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/viridi-parente/main/json-schema/viridi-parente-notification-target-schema.json",
  "title": "NotificationTarget",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viridi-parente-notification-target-controller-api-openapi.yml#/components/schemas/NotificationTarget",
  "properties": {
    "id": {
      "$ref": "#/$defs/NotificationTargetId"
    },
    "createdTime": {
      "type": "integer",
      "format": "int64"
    },
    "tenantId": {
      "$ref": "#/$defs/TenantId"
    },
    "name": {
      "type": "string"
    },
    "configuration": {
      "oneOf": [
        {
          "$ref": "#/$defs/MicrosoftTeamsNotificationTargetConfig"
        },
        {
          "$ref": "#/$defs/PlatformUsersNotificationTargetConfig"
        },
        {
          "$ref": "#/$defs/SlackNotificationTargetConfig"
        }
      ]
    }
  },
  "required": [
    "configuration",
    "name"
  ],
  "$defs": {
    "MicrosoftTeamsNotificationTargetConfig": {
      "allOf": [
        {
          "$ref": "#/$defs/NotificationTargetConfig"
        },
        {
          "type": "object",
          "properties": {
            "webhookUrl": {
              "type": "string"
            },
            "channelName": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "id": {},
            "email": {
              "type": "string"
            },
            "firstName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            }
          }
        }
      ],
      "required": [
        "channelName",
        "webhookUrl"
      ]
    },
    "NotificationTargetConfig": {
      "properties": {
        "description": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "NotificationTargetId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "NOTIFICATION_TARGET"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "PlatformUsersNotificationTargetConfig": {
      "allOf": [
        {
          "$ref": "#/$defs/NotificationTargetConfig"
        },
        {
          "type": "object",
          "properties": {
            "usersFilter": {
              "$ref": "#/$defs/UsersFilter"
            }
          }
        }
      ],
      "required": [
        "usersFilter"
      ]
    },
    "SlackConversation": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "DIRECT",
            "PUBLIC_CHANNEL",
            "PRIVATE_CHANNEL"
          ]
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "wholeName": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ]
    },
    "SlackNotificationTargetConfig": {
      "allOf": [
        {
          "$ref": "#/$defs/NotificationTargetConfig"
        },
        {
          "type": "object",
          "properties": {
            "conversationType": {
              "type": "string",
              "enum": [
                "DIRECT",
                "PUBLIC_CHANNEL",
                "PRIVATE_CHANNEL"
              ]
            },
            "conversation": {
              "$ref": "#/$defs/SlackConversation"
            }
          }
        }
      ],
      "required": [
        "conversation"
      ]
    },
    "TenantId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "TENANT"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "UsersFilter": {
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}