{
  "type": "record",
  "Aspect": {
    "name": "subscriptionInfo"
  },
  "name": "SubscriptionInfo",
  "namespace": "com.linkedin.pegasus2avro.subscription",
  "fields": [
    {
      "Searchable": {
        "fieldType": "URN"
      },
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      },
      "type": "string",
      "name": "actorUrn",
      "doc": "Actor Urn who will be notified ",
      "Urn": "Urn"
    },
    {
      "Searchable": {
        "fieldType": "KEYWORD"
      },
      "type": "string",
      "name": "actorType",
      "doc": "Actor type"
    },
    {
      "Searchable": {
        "/*": {
          "fieldName": "subscriptionTypes",
          "fieldType": "KEYWORD"
        }
      },
      "type": {
        "type": "array",
        "items": {
          "type": "enum",
          "symbolDocs": {
            "ENTITY_CHANGE": "Triggered via direct changes on an entity.",
            "UPSTREAM_ENTITY_CHANGE": "Triggered via upstream changes on an entity."
          },
          "name": "SubscriptionType",
          "namespace": "com.linkedin.pegasus2avro.subscription",
          "symbols": [
            "ENTITY_CHANGE",
            "UPSTREAM_ENTITY_CHANGE"
          ],
          "doc": "Enum to define the different types of subscriptions."
        }
      },
      "name": "types",
      "doc": "The subscription types."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "createdOn",
          "fieldType": "DATETIME"
        }
      },
      "type": {
        "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": "createdOn",
      "doc": "AuditStamp for when the subscription was created"
    },
    {
      "type": "com.linkedin.pegasus2avro.common.AuditStamp",
      "name": "updatedOn",
      "doc": "AuditStamp for when the subscription was updated"
    },
    {
      "Searchable": {
        "fieldType": "URN"
      },
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      },
      "type": [
        "null",
        "string"
      ],
      "name": "entityUrn",
      "default": null,
      "doc": "Optional entity Urn - top level for now (Dataset, container etc. )",
      "Urn": "Urn"
    },
    {
      "Relationship": {
        "/*/filter/includeAssertions/*": {
          "entityTypes": [
            "assertion"
          ],
          "name": "SubscribedAssertions"
        }
      },
      "Searchable": {
        "/*/entityChangeType": {
          "fieldName": "entityChangeTypes",
          "fieldType": "KEYWORD"
        },
        "/*/filter/includeAssertions/*": {
          "fieldName": "subscribedAssertions",
          "fieldType": "URN"
        }
      },
      "type": [
        "null",
        {
          "type": "array",
          "items": {
            "type": "record",
            "name": "EntityChangeDetails",
            "namespace": "com.linkedin.pegasus2avro.subscription",
            "fields": [
              {
                "type": {
                  "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": "entityChangeType",
                "doc": "Change type that triggers a notification for the subscription."
              },
              {
                "type": [
                  "null",
                  {
                    "type": "record",
                    "name": "EntityChangeDetailsFilter",
                    "namespace": "com.linkedin.pegasus2avro.subscription",
                    "fields": [
                      {
                        "type": [
                          "null",
                          {
                            "type": "array",
                            "items": "string"
                          }
                        ],
                        "name": "includeAssertions",
                        "default": null,
                        "doc": "A list of assertions to inclusively filter when generating notifications.\nUsed for EntityChangeType values of ASSERTION_PASSED, ASSERTION_FAILED, ASSERTION_ERROR.\nEffectively allows for 'assertion level subscriptions'",
                        "Urn": "Urn",
                        "urn_is_array": true
                      }
                    ],
                    "doc": "Details for filtering notifications relating to an EntityChangeType. Used by Subscriptions to determine how to\nfilter out change types when triggering a notification."
                  }
                ],
                "name": "filter",
                "default": null,
                "doc": "Optional filter that can be applied to exclude or include specific entity change events"
              }
            ],
            "doc": "Details involving an EntityChangeType. Used by Subscriptions to determine which\nchange types should trigger a notification."
          }
        }
      ],
      "name": "entityChangeTypes",
      "default": null,
      "doc": "Change types that trigger a notification for the subscription."
    },
    {
      "Searchable": {
        "/*/sourceEntity": {
          "fieldName": "managedBySourceEntities",
          "fieldType": "URN"
        }
      },
      "type": [
        "null",
        {
          "type": "array",
          "items": {
            "type": "record",
            "name": "SubscriptionManagedBy",
            "namespace": "com.linkedin.pegasus2avro.subscription",
            "fields": [
              {
                "java": {
                  "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                },
                "type": "string",
                "name": "sourceEntity",
                "doc": "The source entity managing this subscription.",
                "Urn": "Urn"
              },
              {
                "type": [
                  "null",
                  {
                    "type": "array",
                    "items": "com.linkedin.pegasus2avro.subscription.EntityChangeType"
                  }
                ],
                "name": "lastAppliedChangeTypes",
                "default": null,
                "doc": "Optional list of typed change categories most recently applied by this source entity."
              }
            ]
          }
        }
      ],
      "name": "managedBy",
      "default": null,
      "doc": "Operational metadata about source entities currently managing this subscription.\nA subscription may be managed by multiple source entities."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "SubscriptionNotificationConfig",
          "namespace": "com.linkedin.pegasus2avro.subscription",
          "fields": [
            {
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "NotificationSettings",
                  "namespace": "com.linkedin.pegasus2avro.event.notification.settings",
                  "fields": [
                    {
                      "type": {
                        "type": "array",
                        "items": {
                          "type": "enum",
                          "symbolDocs": {
                            "EMAIL": "Email target type.",
                            "SLACK": "Slack target type.",
                            "TEAMS": "Microsoft Teams target type."
                          },
                          "name": "NotificationSinkType",
                          "namespace": "com.linkedin.pegasus2avro.event.notification",
                          "symbols": [
                            "SLACK",
                            "EMAIL",
                            "TEAMS"
                          ],
                          "doc": "A type of sink / platform to send a notification to."
                        }
                      },
                      "name": "sinkTypes",
                      "doc": "Sink types that notifications are sent to. This is a top-level on/off switch."
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "SlackNotificationSettings",
                          "namespace": "com.linkedin.pegasus2avro.event.notification.settings",
                          "fields": [
                            {
                              "type": [
                                "null",
                                {
                                  "type": "record",
                                  "name": "SlackUser",
                                  "namespace": "com.linkedin.pegasus2avro.settings.global",
                                  "fields": [
                                    {
                                      "Searchable": {
                                        "fieldType": "KEYWORD",
                                        "queryByDefault": false
                                      },
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "slackUserId",
                                      "default": null,
                                      "doc": "The Slack user ID (Slack member UUID).\nThis is the primary identifier used for Slack messaging via DM.\nSearchable to enable lookup of DataHub users by their Slack ID."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "email",
                                      "default": null,
                                      "doc": "The user's email address (fallback identifier).\nUsed when Slack user ID is not available or for email-based user resolution."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "displayName",
                                      "default": null,
                                      "doc": "The user's display name (cached value, may be stale).\nRetrieved from Slack API and cached for performance."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "long"
                                      ],
                                      "name": "lastUpdated",
                                      "default": null,
                                      "doc": "The timestamp when the cached display name was last updated.\nUsed for TTL-based cache invalidation (milliseconds since epoch)."
                                    }
                                  ],
                                  "doc": "Slack user information with cached display name and multiple ID support.\nFollows the same caching pattern as TeamsUser for consistency."
                                }
                              ],
                              "name": "user",
                              "default": null,
                              "doc": "Optional structured user information with cached metadata.\nSupports Slack user ID with cached display name and email."
                            },
                            {
                              "deprecated": true,
                              "type": [
                                "null",
                                "string"
                              ],
                              "name": "userHandle",
                              "default": null,
                              "doc": "Optional user handle (deprecated - use 'user' field instead).\nKept for backward compatibility with existing implementations."
                            },
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": "string"
                                }
                              ],
                              "name": "channels",
                              "default": null,
                              "doc": "Optional list of channels to send notifications to"
                            }
                          ],
                          "doc": "Slack Notification settings for an actor."
                        }
                      ],
                      "name": "slackSettings",
                      "default": null,
                      "doc": "Slack Notification Settings"
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "EmailNotificationSettings",
                          "namespace": "com.linkedin.pegasus2avro.event.notification.settings",
                          "fields": [
                            {
                              "type": "string",
                              "name": "email",
                              "doc": "Optional user or group email address"
                            }
                          ],
                          "doc": "Email Notification settings for an actor."
                        }
                      ],
                      "name": "emailSettings",
                      "default": null,
                      "doc": "Email Notification Settings"
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "TeamsNotificationSettings",
                          "namespace": "com.linkedin.pegasus2avro.event.notification.settings",
                          "fields": [
                            {
                              "type": [
                                "null",
                                {
                                  "type": "record",
                                  "name": "TeamsUser",
                                  "namespace": "com.linkedin.pegasus2avro.settings.global",
                                  "fields": [
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "teamsUserId",
                                      "default": null,
                                      "doc": "The Teams user ID (internal Teams identifier).\nThis is the primary identifier used for Teams messaging."
                                    },
                                    {
                                      "Searchable": {
                                        "fieldType": "KEYWORD",
                                        "queryByDefault": false
                                      },
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "azureUserId",
                                      "default": null,
                                      "doc": "The Azure AD user ID (Azure Active Directory object ID).\nThis is the primary identifier for Azure AD operations and Microsoft Graph API calls."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "email",
                                      "default": null,
                                      "doc": "The user's email address (fallback identifier).\nUsed when other IDs are not available or for email-based user resolution."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "string"
                                      ],
                                      "name": "displayName",
                                      "default": null,
                                      "doc": "The user's display name (cached value, may be stale).\nRetrieved from Microsoft Graph API and cached for performance."
                                    },
                                    {
                                      "type": [
                                        "null",
                                        "long"
                                      ],
                                      "name": "lastUpdated",
                                      "default": null,
                                      "doc": "The timestamp when the cached display name was last updated.\nUsed for TTL-based cache invalidation (milliseconds since epoch)."
                                    }
                                  ],
                                  "doc": "Teams user information with cached display name and multiple ID support.\nFollows the same caching pattern as TeamsChannel for consistency."
                                }
                              ],
                              "name": "user",
                              "default": null,
                              "doc": "Optional structured user information with cached metadata.\nSupports both Azure AD user ID and Teams user ID with cached display name."
                            },
                            {
                              "type": [
                                "null",
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "record",
                                    "name": "TeamsChannel",
                                    "namespace": "com.linkedin.pegasus2avro.settings.global",
                                    "fields": [
                                      {
                                        "type": "string",
                                        "name": "id",
                                        "doc": "The Teams channel ID (internal Teams identifier)."
                                      },
                                      {
                                        "type": [
                                          "null",
                                          "string"
                                        ],
                                        "name": "name",
                                        "default": null,
                                        "doc": "The Teams channel display name (cached value, may be stale)."
                                      },
                                      {
                                        "type": [
                                          "null",
                                          "long"
                                        ],
                                        "name": "lastUpdated",
                                        "default": null,
                                        "doc": "The timestamp when the cached name was last updated.\nUsed for TTL-based cache invalidation."
                                      }
                                    ],
                                    "doc": "Teams channel information with cached display name."
                                  }
                                }
                              ],
                              "name": "channels",
                              "default": null,
                              "doc": "Optional list of structured channels with cached metadata"
                            }
                          ],
                          "doc": "Microsoft Teams Notification settings for an actor."
                        }
                      ],
                      "name": "teamsSettings",
                      "default": null,
                      "doc": "Microsoft Teams Notification Settings"
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "map",
                          "values": {
                            "type": "record",
                            "name": "NotificationSetting",
                            "namespace": "com.linkedin.pegasus2avro.settings",
                            "fields": [
                              {
                                "type": {
                                  "type": "enum",
                                  "symbolDocs": {
                                    "DISABLED": "Setting is disabled.",
                                    "ENABLED": "Setting is enabled."
                                  },
                                  "name": "NotificationSettingValue",
                                  "namespace": "com.linkedin.pegasus2avro.settings",
                                  "symbols": [
                                    "ENABLED",
                                    "DISABLED"
                                  ]
                                },
                                "name": "value",
                                "doc": "Integrations between DataHub & other platforms."
                              },
                              {
                                "type": [
                                  "null",
                                  {
                                    "type": "map",
                                    "values": "string"
                                  }
                                ],
                                "name": "params",
                                "default": null,
                                "doc": "Custom set of setting parameters.\nCurrently used to store sink enabled / disabled settings.\nE.g. slack.enabled = true, email.enabled = false"
                              }
                            ]
                          }
                        }
                      ],
                      "name": "settings",
                      "default": null,
                      "doc": "User or Group Notification Scenario Settings.\n\nA map of notification scenario type to the settings associated with it.\nFor a list of all scenario types to notify on, check out NotificationScenarioType enum."
                    }
                  ],
                  "doc": "Notification settings for an actor or subscription."
                }
              ],
              "name": "notificationSettings",
              "default": null,
              "doc": "Notification settings for the subscription."
            }
          ]
        }
      ],
      "name": "notificationConfig",
      "default": null,
      "doc": "Optional notification config."
    }
  ],
  "doc": "Subscription info."
}