{
  "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",
      "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."
    },
    {
      "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",
      "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 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."
    },
    {
      "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."
                          },
                          "name": "NotificationSinkType",
                          "namespace": "com.linkedin.pegasus2avro.event.notification",
                          "symbols": [
                            "SLACK",
                            "EMAIL"
                          ],
                          "doc": "A type of sink / platform to send a notification to."
                        }
                      },
                      "name": "sinkTypes",
                      "doc": "Sink types that notifications are sent to."
                    },
                    {
                      "type": [
                        "null",
                        {
                          "type": "record",
                          "name": "SlackNotificationSettings",
                          "namespace": "com.linkedin.pegasus2avro.event.notification.settings",
                          "fields": [
                            {
                              "type": [
                                "null",
                                "string"
                              ],
                              "name": "userHandle",
                              "default": null,
                              "doc": "Optional user handle"
                            },
                            {
                              "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"
                    }
                  ],
                  "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."
}