{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sifflet/json-schema/sifflet-public-create-notification-rule-dto-schema.json",
  "title": "PublicCreateNotificationRuleDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sifflet-notification-rules-api-openapi.yml#/components/schemas/PublicCreateNotificationRuleDto",
  "required": [
    "domainId",
    "name",
    "scope"
  ],
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Description of the notification rule"
    },
    "domainId": {
      "type": "string",
      "description": "Domain of the notification rule",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "description": "Name of the notification rule"
    },
    "notificationDestinations": {
      "type": "array",
      "description": "Notification destination of the notification rule, like Slack or emails",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/PublicMailNotificationDestinationReferenceDto"
          },
          {
            "$ref": "#/$defs/PublicMsTeamsNotificationDestinationReferenceDto"
          },
          {
            "$ref": "#/$defs/PublicSlackNotificationDestinationReferenceDto"
          },
          {
            "$ref": "#/$defs/PublicWebhookNotificationDestinationReferenceDto"
          }
        ]
      }
    },
    "scope": {
      "$ref": "#/$defs/PublicNotificationRuleScopeDto"
    },
    "ticketingDestinations": {
      "type": "array",
      "description": "Ticketing destination of the notification rule, like Jira or ServiceNow",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/PublicJiraTicketingDestinationParamsDto"
          },
          {
            "$ref": "#/$defs/PublicServiceNowTicketingDestinationParamsDto"
          }
        ]
      }
    }
  },
  "$defs": {
    "PublicAllNotificationRuleAssetScopeDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationRuleAssetScopeDto"
        }
      ]
    },
    "PublicAllNotificationRuleMonitorScopeDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationRuleMonitorScopeDto"
        }
      ]
    },
    "PublicDynamicNotificationRuleAssetScopeDto": {
      "required": [
        "conditions",
        "filterLogicalOperator",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationRuleAssetScopeDto"
        },
        {
          "type": "object",
          "properties": {
            "conditions": {
              "type": "array",
              "description": "List of the conditions defining asset scope of the notification rule",
              "items": {
                "oneOf": [
                  {
                    "$ref": "#/$defs/PublicSourceFilterNotificationRuleAssetScopeConditionDto"
                  },
                  {
                    "$ref": "#/$defs/PublicTagFilterNotificationRuleAssetScopeConditionDto"
                  }
                ]
              }
            },
            "filterLogicalOperator": {
              "type": "string",
              "description": "Logical operator to use between conditions",
              "enum": [
                "AND",
                "OR"
              ]
            }
          }
        }
      ]
    },
    "PublicExternalTagReferenceDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the referenced object",
          "format": "uuid"
        },
        "kind": {
          "type": "string",
          "description": "Type of the referenced tag",
          "enum": [
            "BIGQUERY_EXTERNAL",
            "SNOWFLAKE_EXTERNAL",
            "DBT_EXTERNAL",
            "DATABRICKS_EXTERNAL",
            "ADF_EXTERNAL",
            "ATLAN_EXTERNAL",
            "ALATION_EXTERNAL",
            "AMUNDSEN_EXTERNAL",
            "APACHE_ATLAS_EXTERNAL",
            "CASTOR_DOC_EXTERNAL",
            "COLLIBRA_EXTERNAL",
            "DATAGALAXY_EXTERNAL",
            "INFORMATICA_EXTERNAL",
            "SECODA_EXTERNAL",
            "SELECT_STAR_EXTERNAL",
            "GENERIC_CATALOG_EXTERNAL"
          ]
        },
        "name": {
          "type": "string",
          "description": "Name of the referenced object"
        }
      },
      "description": "Asset tag from external providers."
    },
    "PublicFilterNotificationRuleAssetScopeConditionDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the condition",
          "enum": [
            "SOURCE",
            "TAG"
          ]
        }
      },
      "description": "List of the conditions defining asset scope of the notification rule"
    },
    "PublicFilteredNotificationRuleMonitorScopeDto": {
      "required": [
        "monitorTemplates",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationRuleMonitorScopeDto"
        },
        {
          "type": "object",
          "properties": {
            "monitorTemplates": {
              "type": "array",
              "description": "List of monitor templates in the scope of the notification rule",
              "items": {
                "type": "string",
                "description": "List of monitor templates in the scope of the notification rule",
                "enum": [
                  "COMPLETENESS",
                  "ROW_LEVEL_DUPLICATES",
                  "FRESHNESS",
                  "SCHEMA_CHANGE",
                  "FRESHNESS_UPDATE_TIME_GAP",
                  "NUMERICAL_TRANSFORMATION",
                  "CORRELATED_METRICS",
                  "CUSTOM_METRICS",
                  "DISTRIBUTION",
                  "UNIQUE",
                  "REFERENTIAL_INTEGRITY",
                  "NOT_IN_LIST",
                  "COUNT_DUPLICATE",
                  "NULLS",
                  "VALUE_RANGE",
                  "IS_EMAIL",
                  "IS_PHONE_NUMBER",
                  "IS_UUID",
                  "MATCHES_REGEX",
                  "NO_CODE_CONDITION",
                  "SQL_CONDITION",
                  "SQL",
                  "DBT"
                ]
              }
            }
          }
        }
      ]
    },
    "PublicJiraTemplateFieldDto": {
      "required": [
        "key",
        "type"
      ],
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "description": "Custom fields for jira template"
    },
    "PublicJiraTicketingDestinationParamsDto": {
      "required": [
        "templateName",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicTicketingDestinationParamsDto"
        },
        {
          "type": "object",
          "properties": {
            "fields": {
              "type": "array",
              "description": "Custom fields for jira template",
              "items": {
                "$ref": "#/$defs/PublicJiraTemplateFieldDto"
              }
            }
          }
        }
      ]
    },
    "PublicMailNotificationDestinationReferenceDto": {
      "required": [
        "email",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationDestinationReferenceDto"
        },
        {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "description": "Referenced email destination address"
            }
          }
        }
      ]
    },
    "PublicMsTeamsNotificationDestinationReferenceDto": {
      "required": [
        "msTeamsName",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationDestinationReferenceDto"
        },
        {
          "type": "object",
          "properties": {
            "msTeamsName": {
              "type": "string",
              "description": "Name of the referenced microsoft teams channel"
            }
          }
        }
      ]
    },
    "PublicNotificationDestinationReferenceDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "SLACK",
            "MAIL",
            "MS_TEAMS",
            "WEBHOOK"
          ]
        }
      },
      "description": "Notification destination of the notification rule, like Slack or emails"
    },
    "PublicNotificationRuleAssetScopeDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the notification rule asset scope",
          "enum": [
            "ALL",
            "STATIC",
            "DYNAMIC"
          ]
        }
      },
      "description": "Definition of the asset scope of the notification rule"
    },
    "PublicNotificationRuleMonitorScopeDto": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the notification rule monitor scope",
          "enum": [
            "ALL",
            "FILTERED"
          ]
        }
      },
      "description": "Definition of the monitor scope of the notification rule"
    },
    "PublicNotificationRuleScopeDto": {
      "required": [
        "assetScope",
        "monitorScope"
      ],
      "type": "object",
      "properties": {
        "assetScope": {
          "oneOf": [
            {
              "$ref": "#/$defs/PublicAllNotificationRuleAssetScopeDto"
            },
            {
              "$ref": "#/$defs/PublicDynamicNotificationRuleAssetScopeDto"
            },
            {
              "$ref": "#/$defs/PublicStaticNotificationRuleAssetScopeDto"
            }
          ]
        },
        "monitorScope": {
          "oneOf": [
            {
              "$ref": "#/$defs/PublicAllNotificationRuleMonitorScopeDto"
            },
            {
              "$ref": "#/$defs/PublicFilteredNotificationRuleMonitorScopeDto"
            }
          ]
        }
      },
      "description": "Definition of the monitors bound to the notification rule"
    },
    "PublicServiceNowTemplateFieldDto": {
      "required": [
        "key"
      ],
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "description": "Custom fields for service now template"
    },
    "PublicServiceNowTicketingDestinationParamsDto": {
      "required": [
        "templateName",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicTicketingDestinationParamsDto"
        },
        {
          "type": "object",
          "properties": {
            "fields": {
              "type": "array",
              "description": "Custom fields for service now template",
              "items": {
                "$ref": "#/$defs/PublicServiceNowTemplateFieldDto"
              }
            }
          }
        }
      ]
    },
    "PublicSlackNotificationDestinationReferenceDto": {
      "required": [
        "channelName",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationDestinationReferenceDto"
        },
        {
          "type": "object",
          "properties": {
            "channelName": {
              "type": "string",
              "description": "Name of the referenced slack channel"
            }
          }
        }
      ]
    },
    "PublicSourceFilterNotificationRuleAssetScopeConditionDto": {
      "required": [
        "operator",
        "sources",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicFilterNotificationRuleAssetScopeConditionDto"
        },
        {
          "type": "object",
          "properties": {
            "operator": {
              "type": "string",
              "description": "Operator of the condition",
              "enum": [
                "IS",
                "IS_NOT"
              ]
            },
            "sources": {
              "type": "array",
              "description": "List of the sources in the condition in URI format. <a href=\"https://docs.siffletdata.com/docs/uri\">[Read more about URIs]</a>",
              "items": {
                "type": "string",
                "description": "List of the sources in the condition in URI format. <a href=\"https://docs.siffletdata.com/docs/uri\">[Read more about URIs]</a>"
              }
            }
          }
        }
      ]
    },
    "PublicStaticNotificationRuleAssetScopeDto": {
      "required": [
        "assets",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationRuleAssetScopeDto"
        },
        {
          "type": "object",
          "properties": {
            "assets": {
              "type": "array",
              "description": "List of the assets in the scope of the notification rule",
              "items": {
                "type": "string",
                "description": "List of the assets in the scope of the notification rule"
              }
            }
          }
        }
      ]
    },
    "PublicTagFilterNotificationRuleAssetScopeConditionDto": {
      "required": [
        "operator",
        "tags",
        "type"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicFilterNotificationRuleAssetScopeConditionDto"
        },
        {
          "type": "object",
          "properties": {
            "operator": {
              "type": "string",
              "description": "Operator of the condition",
              "enum": [
                "IS",
                "IS_NOT"
              ]
            },
            "tags": {
              "type": "array",
              "description": "List of the tags references in the condition",
              "items": {
                "$ref": "#/$defs/PublicExternalTagReferenceDto"
              }
            }
          }
        }
      ]
    },
    "PublicTicketingDestinationParamsDto": {
      "required": [
        "templateName",
        "type"
      ],
      "type": "object",
      "properties": {
        "templateName": {
          "type": "string",
          "description": "Name of the referenced template"
        },
        "type": {
          "type": "string",
          "enum": [
            "JIRA",
            "SERVICENOW"
          ]
        }
      },
      "description": "Ticketing destination of the notification rule, like Jira or ServiceNow"
    },
    "PublicWebhookNotificationDestinationReferenceDto": {
      "required": [
        "type",
        "webhookName"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/PublicNotificationDestinationReferenceDto"
        },
        {
          "type": "object",
          "properties": {
            "webhookName": {
              "type": "string",
              "description": "Name of the referenced webhook"
            }
          }
        }
      ]
    }
  }
}