{
  "type": "record",
  "Aspect": {
    "name": "assertionAssignmentRuleInfo",
    "schemaVersion": 2
  },
  "name": "AssertionAssignmentRuleInfo",
  "namespace": "com.linkedin.pegasus2avro.assertion.rule",
  "fields": [
    {
      "Searchable": {
        "fieldType": "TEXT_PARTIAL"
      },
      "type": "string",
      "name": "name",
      "doc": "Display name of the rule."
    },
    {
      "Searchable": {
        "fieldType": "KEYWORD"
      },
      "type": {
        "type": "enum",
        "symbolDocs": {
          "DISABLED": "The rule is paused and not evaluating.",
          "ENABLED": "The rule is actively evaluating and assigning assertions."
        },
        "name": "AssertionAssignmentRuleMode",
        "namespace": "com.linkedin.pegasus2avro.assertion.rule",
        "symbols": [
          "ENABLED",
          "DISABLED"
        ],
        "doc": "The mode of an Assertion Assignment Rule."
      },
      "name": "mode",
      "default": "ENABLED",
      "doc": "The mode of the rule (ENABLED or DISABLED)."
    },
    {
      "type": {
        "type": "record",
        "name": "AssertionAssignmentRuleFilter",
        "namespace": "com.linkedin.pegasus2avro.assertion.rule",
        "fields": [
          {
            "type": {
              "type": "record",
              "name": "Filter",
              "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
              "fields": [
                {
                  "type": [
                    "null",
                    {
                      "type": "array",
                      "items": {
                        "type": "record",
                        "name": "ConjunctiveCriterion",
                        "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                        "fields": [
                          {
                            "type": {
                              "type": "array",
                              "items": {
                                "type": "record",
                                "name": "Criterion",
                                "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                "fields": [
                                  {
                                    "type": "string",
                                    "name": "field",
                                    "doc": "The name of the field that the criterion refers to"
                                  },
                                  {
                                    "type": {
                                      "type": "array",
                                      "items": "string"
                                    },
                                    "name": "values",
                                    "default": [],
                                    "doc": "Values to match against the field (one match suffices unless otherwise documented)."
                                  },
                                  {
                                    "type": {
                                      "type": "enum",
                                      "symbolDocs": {
                                        "ANCESTORS_INCL": "Represent the relation: URN field matches any nested parent in addition to the given URN",
                                        "BETWEEN": "Represent the relation within an inclusive range, e.g. 3 <= ownerCount <= 5. Note that the values in Criterion must have two entries for a lower and upper bound.",
                                        "CONTAIN": "Represent the relation: String field contains value, e.g. name contains Profile",
                                        "DESCENDANTS_INCL": "Represent the relation: URN field any nested children in addition to the given URN",
                                        "END_WITH": "Represent the relation: String field ends with value, e.g. name ends with Event",
                                        "EQUAL": "Represent the relation: field = value, e.g. platform = hdfs",
                                        "EXISTS": "Represents the relation: field exists and is non-empty, e.g. owners is not null and != [] (empty)",
                                        "GREATER_THAN": "Represent the relation greater than, e.g. ownerCount > 5",
                                        "GREATER_THAN_OR_EQUAL_TO": "Represent the relation greater than or equal to, e.g. ownerCount >= 5",
                                        "IEQUAL": "Represent the relation: field = value and support case insensitive values, e.g. platform = hdfs",
                                        "IN": "Represent the relation: String field is one of the array values to, e.g. name in [\"Profile\", \"Event\"]",
                                        "IS_NULL": "Represent the relation: field is null, e.g. platform is null",
                                        "LESS_THAN": "Represent the relation less than, e.g. ownerCount < 3",
                                        "LESS_THAN_OR_EQUAL_TO": "Represent the relation less than or equal to, e.g. ownerCount <= 3",
                                        "RELATED_INCL": "Represent the relation: URN field matches any nested child or parent in addition to the given URN",
                                        "START_WITH": "Represent the relation: String field starts with value, e.g. name starts with PageView"
                                      },
                                      "name": "Condition",
                                      "namespace": "com.linkedin.pegasus2avro.metadata.query.filter",
                                      "symbols": [
                                        "CONTAIN",
                                        "END_WITH",
                                        "EQUAL",
                                        "IEQUAL",
                                        "IS_NULL",
                                        "EXISTS",
                                        "GREATER_THAN",
                                        "GREATER_THAN_OR_EQUAL_TO",
                                        "IN",
                                        "LESS_THAN",
                                        "LESS_THAN_OR_EQUAL_TO",
                                        "BETWEEN",
                                        "START_WITH",
                                        "DESCENDANTS_INCL",
                                        "ANCESTORS_INCL",
                                        "RELATED_INCL"
                                      ],
                                      "doc": "The matching condition in a filter criterion"
                                    },
                                    "name": "condition",
                                    "default": "EQUAL",
                                    "doc": "The condition for the criterion, e.g. EQUAL, START_WITH"
                                  },
                                  {
                                    "type": "boolean",
                                    "name": "negated",
                                    "default": false,
                                    "doc": "Whether the condition should be negated"
                                  }
                                ],
                                "doc": "A criterion for matching a field with given values"
                              }
                            },
                            "name": "and",
                            "doc": "A list of and criteria the filter applies to the query"
                          }
                        ],
                        "doc": "A list of criterion and'd together."
                      }
                    }
                  ],
                  "name": "or",
                  "default": null,
                  "doc": "A list of disjunctive criterion for the filter. (or operation to combine filters)"
                },
                {
                  "type": [
                    "null",
                    {
                      "type": "array",
                      "items": "com.linkedin.pegasus2avro.metadata.query.filter.Criterion"
                    }
                  ],
                  "name": "criteria",
                  "default": null,
                  "doc": "Deprecated! A list of conjunctive criterion for the filter. If \"or\" field is provided, then this field is ignored."
                }
              ],
              "doc": "The filter for finding a record or a collection of records"
            },
            "name": "filter",
            "doc": "The structured filter used to match entities for assertion assignment."
          },
          {
            "type": [
              "null",
              "string"
            ],
            "name": "json",
            "default": null,
            "doc": "The serialized JSON representation of the filter, used for UI rendering.\nThe UI builds a logical predicate tree that is flattened into orFilters for GraphQL.\nThis string preserves the original tree structure so the UI can restore it."
          }
        ],
        "doc": "The filter criteria used to match entities for an Assertion Assignment Rule."
      },
      "name": "entityFilter",
      "doc": "The filter criteria used to match entities for assertion assignment."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "FreshnessAssertionAssignmentRuleConfig",
          "namespace": "com.linkedin.pegasus2avro.assertion.rule",
          "fields": [
            {
              "type": "boolean",
              "name": "enabled",
              "default": true,
              "doc": "Whether freshness assertion assignment is enabled."
            },
            {
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "DatasetFreshnessAssertionParameters",
                  "namespace": "com.linkedin.pegasus2avro.monitor",
                  "fields": [
                    {
                      "type": {
                        "type": "enum",
                        "symbolDocs": {
                          "AUDIT_LOG": "Determine that a change has occurred by inspecting an audit log API",
                          "DATAHUB_OPERATION": "Determine whether the table has changed using an Operation aspect",
                          "FIELD_VALUE": "Determine that a change has occurred by inspecting a particular field's value.",
                          "FILE_METADATA": "Determine that a change has occurred by inspecting underlying file system.",
                          "INFORMATION_SCHEMA": "Determine that a change has occurred by inspecting an information schema table, or other system metadata table.",
                          "PLATFORM_API": "Determine that a change has occurred by querying the platform's metadata API directly."
                        },
                        "name": "DatasetFreshnessSourceType",
                        "namespace": "com.linkedin.pegasus2avro.monitor",
                        "symbols": [
                          "FIELD_VALUE",
                          "INFORMATION_SCHEMA",
                          "AUDIT_LOG",
                          "FILE_METADATA",
                          "DATAHUB_OPERATION",
                          "PLATFORM_API"
                        ]
                      },
                      "name": "sourceType",
                      "doc": "The source of the change operation."
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "FreshnessFieldSpec",
                          "namespace": "com.linkedin.pegasus2avro.assertion",
                          "fields": [
                            {
                              "type": "string",
                              "name": "path",
                              "doc": "The field path"
                            },
                            {
                              "type": "string",
                              "name": "type",
                              "doc": "The DataHub standard schema field type."
                            },
                            {
                              "type": "string",
                              "name": "nativeType",
                              "doc": "The native field type"
                            },
                            {
                              "type": [
                                "null",
                                {
                                  "type": "enum",
                                  "symbolDocs": {
                                    "HIGH_WATERMARK": "Determine that a change has occurred by inspecting a field which should be tracked as the\n\"high watermark\" for the table. This should be an ascending number or date field.\n\nIf rows with this column have not been added since the previous check\nthen the Freshness Assertion will fail.",
                                    "LAST_MODIFIED": "Determine that a change has occurred by inspecting an last modified field which\nrepresents the last time at which a row was changed."
                                  },
                                  "name": "FreshnessFieldKind",
                                  "namespace": "com.linkedin.pegasus2avro.assertion",
                                  "symbols": [
                                    "LAST_MODIFIED",
                                    "HIGH_WATERMARK"
                                  ]
                                }
                              ],
                              "name": "kind",
                              "default": null,
                              "doc": "The type of the field being used to verify the Freshness of the asset."
                            }
                          ],
                          "doc": "Lightweight spec used for referencing a particular schema field that is used to compute\na freshness signal or operation.\nTODO: Since this is now leveraged across assertions & metrics / operations, we should consider moving this to a common package."
                        }
                      ],
                      "name": "field",
                      "default": null,
                      "doc": "Information about the field to use. Present when sourceType is FIELD_VALUE"
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "AuditLogSpec",
                          "namespace": "com.linkedin.pegasus2avro.monitor",
                          "fields": [
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": "string"
                                }
                              ],
                              "name": "operationTypes",
                              "default": null,
                              "doc": "The list of operation types that should be monitored. If not provided, a default set will be used."
                            },
                            {
                              "type": [
                                "null",
                                "string"
                              ],
                              "name": "userName",
                              "default": null,
                              "doc": "Optional: The user name associated with the operation."
                            }
                          ],
                          "doc": "Information about the Audit Log operation to use in evaluating an assertion."
                        }
                      ],
                      "name": "auditLog",
                      "default": null,
                      "doc": "Information about the audit log operation to use. Present when sourceType is AUDIT_LOG"
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "DataHubOperationSpec",
                          "namespace": "com.linkedin.pegasus2avro.monitor",
                          "fields": [
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": "string"
                                }
                              ],
                              "name": "operationTypes",
                              "default": null,
                              "doc": "The list of operation types that should be monitored. If not provided, a default set will be used."
                            },
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": "string"
                                }
                              ],
                              "name": "customOperationTypes",
                              "default": null,
                              "doc": "The list of custom operation types that should be monitored. If not provided, no custom operation types will be used."
                            }
                          ],
                          "doc": "Information about the DataHub Operation aspect used to evaluate a freshness assertion"
                        }
                      ],
                      "name": "dataHubOperation",
                      "default": null,
                      "doc": "Information about the DataHub operation. Present when sourceType is DATAHUB_OPERATION"
                    }
                  ],
                  "doc": "Information about the parameters required to evaluate an assertion"
                }
              ],
              "name": "preferredEvaluationParameters",
              "default": null,
              "doc": "Preferred parameters for freshness evaluation (source type, field spec, audit log spec, etc.)."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": {
                    "type": "record",
                    "name": "AssertionAction",
                    "namespace": "com.linkedin.pegasus2avro.assertion",
                    "fields": [
                      {
                        "type": {
                          "type": "enum",
                          "symbolDocs": {
                            "RAISE_INCIDENT": "Raise an incident.",
                            "RESOLVE_INCIDENT": "Resolve open incidents related to the assertion."
                          },
                          "name": "AssertionActionType",
                          "namespace": "com.linkedin.pegasus2avro.assertion",
                          "symbols": [
                            "RAISE_INCIDENT",
                            "RESOLVE_INCIDENT"
                          ]
                        },
                        "name": "type",
                        "doc": "The type of the Action"
                      }
                    ],
                    "doc": "The Actions about an Assertion.\nIn the future, we'll likely extend this model to support additional\nparameters or options related to the assertion actions."
                  }
                }
              ],
              "name": "onSuccess",
              "default": null,
              "doc": "Actions to take when the assertion succeeds."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "com.linkedin.pegasus2avro.assertion.AssertionAction"
                }
              ],
              "name": "onFailure",
              "default": null,
              "doc": "Actions to take when the assertion fails."
            }
          ],
          "doc": "Configuration for freshness assertions in an Assertion Assignment Rule."
        }
      ],
      "name": "freshnessConfig",
      "default": null,
      "doc": "Configuration for freshness assertions."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "VolumeAssertionAssignmentRuleConfig",
          "namespace": "com.linkedin.pegasus2avro.assertion.rule",
          "fields": [
            {
              "type": "boolean",
              "name": "enabled",
              "default": true,
              "doc": "Whether volume assertion assignment is enabled."
            },
            {
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "DatasetVolumeAssertionParameters",
                  "namespace": "com.linkedin.pegasus2avro.monitor",
                  "fields": [
                    {
                      "type": {
                        "type": "enum",
                        "symbolDocs": {
                          "DATAHUB_DATASET_PROFILE": "Determine the row count using the DataHub Dataset Profile aspect",
                          "INFORMATION_SCHEMA": "Determine the row count using an information schema query - not applicable to all platforms.",
                          "PLATFORM_API": "Determine the row count using the platform's metadata API directly.",
                          "QUERY": "Determine the row count using a COUNT(*) query",
                          "TABLE_STATISTICS": "Determine the row count using pre-computed table statistics (e.g. ANALYZE TABLE).\nSupported on platforms that maintain table-level statistics in their catalog."
                        },
                        "name": "DatasetVolumeSourceType",
                        "namespace": "com.linkedin.pegasus2avro.monitor",
                        "symbols": [
                          "INFORMATION_SCHEMA",
                          "QUERY",
                          "TABLE_STATISTICS",
                          "DATAHUB_DATASET_PROFILE",
                          "PLATFORM_API"
                        ]
                      },
                      "name": "sourceType",
                      "doc": "The source of the change operation."
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "AssertionTimeBucketingStrategy",
                          "namespace": "com.linkedin.pegasus2avro.monitor",
                          "fields": [
                            {
                              "type": "string",
                              "name": "timestampFieldPath",
                              "doc": "Path to the timestamp field used for bucketing."
                            },
                            {
                              "type": {
                                "type": "record",
                                "name": "TimeWindowSize",
                                "namespace": "com.linkedin.pegasus2avro.timeseries",
                                "fields": [
                                  {
                                    "type": {
                                      "type": "enum",
                                      "name": "CalendarInterval",
                                      "namespace": "com.linkedin.pegasus2avro.timeseries",
                                      "symbols": [
                                        "SECOND",
                                        "MINUTE",
                                        "HOUR",
                                        "DAY",
                                        "WEEK",
                                        "MONTH",
                                        "QUARTER",
                                        "YEAR"
                                      ]
                                    },
                                    "name": "unit",
                                    "doc": "Interval unit such as minute/hour/day etc."
                                  },
                                  {
                                    "type": "int",
                                    "name": "multiple",
                                    "default": 1,
                                    "doc": "How many units. Defaults to 1."
                                  }
                                ],
                                "doc": "Defines the size of a time window."
                              },
                              "name": "bucketInterval",
                              "doc": "Interval for time buckets (e.g. 1 DAY, 2 WEEKs)."
                            },
                            {
                              "type": [
                                "null",
                                "com.linkedin.pegasus2avro.timeseries.TimeWindowSize"
                              ],
                              "name": "lateArrivalGracePeriod",
                              "default": null,
                              "doc": "Grace period after bucket end before considering the bucket complete.\nAllows for late-arriving data; evaluation runs only after bucket_end + grace period."
                            },
                            {
                              "type": "string",
                              "name": "timezone",
                              "doc": "IANA timezone (e.g. \"America/Los_Angeles\") for bucket boundaries."
                            }
                          ],
                          "doc": "Time bucketing strategy for assertion evaluation.\nDefines how to partition data into time buckets for evaluation."
                        }
                      ],
                      "name": "timeBucketingStrategy",
                      "default": null,
                      "doc": "Optional time bucketing strategy for evaluating the assertion over time windows."
                    }
                  ],
                  "doc": "Information about the parameters required to evaluate a volume assertion"
                }
              ],
              "name": "preferredEvaluationParameters",
              "default": null,
              "doc": "Preferred parameters for volume evaluation (source type, time bucketing strategy, etc.)."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "com.linkedin.pegasus2avro.assertion.AssertionAction"
                }
              ],
              "name": "onSuccess",
              "default": null,
              "doc": "Actions to take when the assertion succeeds."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "com.linkedin.pegasus2avro.assertion.AssertionAction"
                }
              ],
              "name": "onFailure",
              "default": null,
              "doc": "Actions to take when the assertion fails."
            }
          ],
          "doc": "Configuration for volume assertions in an Assertion Assignment Rule."
        }
      ],
      "name": "volumeConfig",
      "default": null,
      "doc": "Configuration for volume assertions."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "SubscriptionAssignmentRuleConfig",
          "namespace": "com.linkedin.pegasus2avro.assertion.rule",
          "fields": [
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": {
                    "type": "record",
                    "name": "SubscriberAssignmentConfig",
                    "namespace": "com.linkedin.pegasus2avro.assertion.rule",
                    "fields": [
                      {
                        "java": {
                          "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                        },
                        "type": "string",
                        "name": "subscriberUrn",
                        "doc": "The subscriber URN (corpuser or corpGroup).",
                        "Urn": "Urn"
                      },
                      {
                        "type": {
                          "type": "array",
                          "items": {
                            "type": "enum",
                            "symbolDocs": {
                              "ASSERTION_PASSED": "Assertion run event created with specified states.",
                              "DEPRECATED": "Deprecation status changes.",
                              "DOCUMENTATION_CHANGE": "Documentation change.",
                              "GLOSSARY_TERM_ADDED": "Glossary term changes. Added, removed or proposed.",
                              "INCIDENT_RAISED": "Incident status changes.",
                              "INGESTION_SUCCEEDED": "Ingestion status changes.",
                              "OPERATION_COLUMN_ADDED": "Schema changes.",
                              "OPERATION_ROWS_INSERTED": "Operational metadata changes.",
                              "OWNER_ADDED": "Ownership changes. Added or removed.",
                              "TAG_ADDED": "Tag changes. Added, removed or proposed.",
                              "TEST_PASSED": "Test status changes."
                            },
                            "name": "EntityChangeType",
                            "namespace": "com.linkedin.pegasus2avro.subscription",
                            "symbols": [
                              "OPERATION_COLUMN_ADDED",
                              "OPERATION_COLUMN_REMOVED",
                              "OPERATION_COLUMN_MODIFIED",
                              "OPERATION_ROWS_INSERTED",
                              "OPERATION_ROWS_UPDATED",
                              "OPERATION_ROWS_REMOVED",
                              "ASSERTION_PASSED",
                              "ASSERTION_FAILED",
                              "ASSERTION_ERROR",
                              "INCIDENT_RAISED",
                              "INCIDENT_RESOLVED",
                              "TEST_PASSED",
                              "TEST_FAILED",
                              "DEPRECATED",
                              "UNDEPRECATED",
                              "INGESTION_SUCCEEDED",
                              "INGESTION_FAILED",
                              "DOCUMENTATION_CHANGE",
                              "OWNER_ADDED",
                              "OWNER_REMOVED",
                              "GLOSSARY_TERM_ADDED",
                              "GLOSSARY_TERM_REMOVED",
                              "GLOSSARY_TERM_PROPOSED",
                              "TAG_ADDED",
                              "TAG_REMOVED",
                              "TAG_PROPOSED"
                            ],
                            "doc": "Enum to define change types that can trigger a notification for a subscription."
                          }
                        },
                        "name": "entityChangeTypes",
                        "doc": "Entity change types that trigger notifications for this subscriber."
                      }
                    ],
                    "doc": "Per-subscriber configuration within an Assertion Assignment Rule."
                  }
                }
              ],
              "name": "subscriberConfigs",
              "default": null,
              "doc": "Per-subscriber notification configuration."
            }
          ],
          "doc": "Configuration for subscriptions in an Assertion Assignment Rule."
        }
      ],
      "name": "subscriptionConfig",
      "default": null,
      "doc": "Configuration for subscriptions."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "createdTime",
          "fieldType": "DATETIME"
        }
      },
      "type": [
        "null",
        {
          "type": "record",
          "name": "AuditStamp",
          "namespace": "com.linkedin.pegasus2avro.common",
          "fields": [
            {
              "type": "long",
              "name": "time",
              "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
            },
            {
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": "string",
              "name": "actor",
              "doc": "The entity (e.g. a member URN) which will be credited for moving the resource/association/sub-resource into the specific lifecycle stage. It is also the one used to authorize the change.",
              "Urn": "Urn"
            },
            {
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": [
                "null",
                "string"
              ],
              "name": "impersonator",
              "default": null,
              "doc": "The entity (e.g. a service URN) which performs the change on behalf of the Actor and must be authorized to act as the Actor.",
              "Urn": "Urn"
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "message",
              "default": null,
              "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
            }
          ],
          "doc": "Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage."
        }
      ],
      "name": "created",
      "default": null,
      "doc": "Audit stamp capturing when and by whom this rule was created."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "updatedTime",
          "fieldType": "DATETIME"
        }
      },
      "type": [
        "null",
        "com.linkedin.pegasus2avro.common.AuditStamp"
      ],
      "name": "updated",
      "default": null,
      "doc": "Audit stamp capturing when and by whom this rule was last updated."
    }
  ],
  "doc": "Information about an Assertion Assignment Rule.\nAn Assertion Assignment Rule automatically assigns assertions and subscriptions\nto entities matching a filter."
}