{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-event-grid/json-schema/azure-event-grid-topic-schema.json",
  "title": "Topic",
  "description": "EventGrid Topic",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-event-grid-topics-api-openapi.yml#/components/schemas/Topic",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/TopicProperties",
      "description": "Properties of the topic.",
      "x-ms-client-flatten": true
    },
    "identity": {
      "$ref": "#/$defs/IdentityInfo",
      "description": "Identity information for the resource."
    },
    "systemData": {
      "$ref": "#/$defs/systemData",
      "description": "The system metadata relating to the Event Grid resource.",
      "type": "object",
      "readOnly": true
    }
  },
  "$defs": {
    "ConnectionState": {
      "description": "ConnectionState information.",
      "type": "object",
      "properties": {
        "status": {
          "description": "Status of the connection.",
          "enum": [
            "Pending",
            "Approved",
            "Rejected",
            "Disconnected"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "PersistedConnectionStatus",
            "modelAsString": true
          }
        },
        "description": {
          "description": "Description of the connection state.",
          "type": "string"
        },
        "actionsRequired": {
          "description": "Actions required (if any).",
          "type": "string"
        }
      }
    },
    "EventTypeInfo": {
      "description": "The event type information for Channels.",
      "type": "object",
      "properties": {
        "kind": {
          "description": "The kind of event type used.",
          "enum": [
            "Inline"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "EventDefinitionKind",
            "modelAsString": true
          }
        },
        "inlineEventTypes": {
          "description": "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.\nAn example of a valid inline event name is \"Contoso.OrderCreated\".\nThe inline event type values are of type InlineEventProperties and will contain additional information for every inline event type.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/InlineEventProperties"
          }
        }
      }
    },
    "IdentityInfo": {
      "description": "The identity information for the resource.",
      "type": "object",
      "properties": {
        "type": {
          "description": "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity.",
          "enum": [
            "None",
            "SystemAssigned",
            "UserAssigned",
            "SystemAssigned, UserAssigned"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "IdentityType",
            "modelAsString": true
          }
        },
        "principalId": {
          "description": "The principal ID of resource identity.",
          "type": "string"
        },
        "tenantId": {
          "description": "The tenant ID of resource.",
          "type": "string"
        },
        "userAssignedIdentities": {
          "description": "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:\n'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.\nThis property is currently not used and reserved for future usage.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/UserIdentityProperties"
          }
        }
      }
    },
    "InboundIpRule": {
      "type": "object",
      "properties": {
        "ipMask": {
          "description": "IP Address in CIDR notation e.g., 10.0.0.0/8.",
          "type": "string"
        },
        "action": {
          "description": "Action to perform based on the match or no match of the IpMask.",
          "enum": [
            "Allow"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "IpActionType",
            "modelAsString": true
          }
        }
      }
    },
    "InlineEventProperties": {
      "description": "Additional information about every inline event.",
      "type": "object",
      "properties": {
        "description": {
          "description": "The description for the inline event.",
          "type": "string"
        },
        "displayName": {
          "description": "The displayName for the inline event.",
          "type": "string"
        },
        "documentationUrl": {
          "description": "The documentationUrl for the inline event.",
          "type": "string"
        },
        "dataSchemaUrl": {
          "description": "The dataSchemaUrl for the inline event.",
          "type": "string"
        }
      }
    },
    "InputSchemaMapping": {
      "description": "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'.",
      "required": [
        "inputSchemaMappingType"
      ],
      "type": "object",
      "properties": {
        "inputSchemaMappingType": {
          "description": "Type of the custom mapping",
          "enum": [
            "Json"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "InputSchemaMappingType",
            "modelAsString": true
          }
        }
      }
    },
    "PrivateEndpoint": {
      "description": "PrivateEndpoint information.",
      "type": "object",
      "properties": {
        "id": {
          "description": "The ARM identifier for Private Endpoint.",
          "type": "string"
        }
      }
    },
    "PrivateEndpointConnection": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ],
      "properties": {
        "properties": {
          "$ref": "#/$defs/PrivateEndpointConnectionProperties",
          "description": "Properties of the PrivateEndpointConnection.",
          "x-ms-client-flatten": true
        }
      }
    },
    "PrivateEndpointConnectionProperties": {
      "description": "Properties of the private endpoint connection resource.",
      "type": "object",
      "properties": {
        "privateEndpoint": {
          "$ref": "#/$defs/PrivateEndpoint",
          "description": "The Private Endpoint resource for this Connection."
        },
        "groupIds": {
          "description": "GroupIds from the private link service resource.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "privateLinkServiceConnectionState": {
          "$ref": "#/$defs/ConnectionState",
          "description": "Details about the state of the connection."
        },
        "provisioningState": {
          "description": "Provisioning state of the Private Endpoint Connection.",
          "enum": [
            "Creating",
            "Updating",
            "Deleting",
            "Succeeded",
            "Canceled",
            "Failed"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "ResourceProvisioningState",
            "modelAsString": true
          }
        }
      }
    },
    "Resource": {
      "description": "Definition of a Resource.",
      "type": "object",
      "properties": {
        "id": {
          "description": "Fully qualified identifier of the resource.",
          "type": "string",
          "readOnly": true
        },
        "name": {
          "description": "Name of the resource.",
          "type": "string",
          "readOnly": true
        },
        "type": {
          "description": "Type of the resource.",
          "type": "string",
          "readOnly": true
        }
      },
      "x-ms-azure-resource": true
    },
    "TopicProperties": {
      "description": "Properties of the Topic.",
      "type": "object",
      "properties": {
        "privateEndpointConnections": {
          "description": "List of private endpoint connections.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PrivateEndpointConnection"
          },
          "readOnly": true
        },
        "provisioningState": {
          "description": "Provisioning state of the topic.",
          "enum": [
            "Creating",
            "Updating",
            "Deleting",
            "Succeeded",
            "Canceled",
            "Failed"
          ],
          "type": "string",
          "readOnly": true,
          "x-ms-enum": {
            "name": "TopicProvisioningState",
            "modelAsString": true
          }
        },
        "endpoint": {
          "description": "Endpoint for the topic.",
          "type": "string",
          "readOnly": true
        },
        "eventTypeInfo": {
          "$ref": "#/$defs/EventTypeInfo",
          "description": "Event Type Information for the user topic. This information is provided by the publisher and can be used by the \nsubscriber to view different types of events that are published."
        },
        "minimumTlsVersionAllowed": {
          "description": "Minimum TLS version of the publisher allowed to publish to this topic",
          "enum": [
            "1.0",
            "1.1",
            "1.2"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "TlsVersion",
            "modelAsString": true
          }
        },
        "inputSchema": {
          "description": "This determines the format that Event Grid should expect for incoming events published to the topic.",
          "enum": [
            "EventGridSchema",
            "CustomEventSchema",
            "CloudEventSchemaV1_0"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "InputSchema",
            "modelAsString": true
          },
          "default": "EventGridSchema"
        },
        "inputSchemaMapping": {
          "$ref": "#/$defs/InputSchemaMapping",
          "description": "This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema."
        },
        "metricResourceId": {
          "description": "Metric resource id for the topic.",
          "type": "string",
          "readOnly": true
        },
        "publicNetworkAccess": {
          "description": "This determines if traffic is allowed over public network. By default it is enabled. \nYou can further restrict to specific IPs by configuring <seealso cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules\" />",
          "enum": [
            "Enabled",
            "Disabled"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "PublicNetworkAccess",
            "modelAsString": true
          },
          "default": "Enabled"
        },
        "inboundIpRules": {
          "description": "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/InboundIpRule"
          },
          "x-ms-identifiers": []
        },
        "disableLocalAuth": {
          "description": "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.",
          "default": false,
          "type": "boolean"
        },
        "dataResidencyBoundary": {
          "description": "Data Residency Boundary of the resource.",
          "enum": [
            "WithinGeopair",
            "WithinRegion"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "DataResidencyBoundary",
            "modelAsString": true
          }
        }
      }
    },
    "TrackedResource": {
      "description": "Definition of a Tracked Resource.",
      "required": [
        "location"
      ],
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ],
      "properties": {
        "location": {
          "description": "Location of the resource.",
          "type": "string",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "tags": {
          "description": "Tags of the resource.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "UserIdentityProperties": {
      "description": "The information about the user identity.",
      "type": "object",
      "properties": {
        "principalId": {
          "description": "The principal id of user assigned identity.",
          "type": "string"
        },
        "clientId": {
          "description": "The client id of user assigned identity.",
          "type": "string"
        }
      }
    },
    "systemData": {
      "type": "object",
      "description": "Metadata pertaining to creation and last modification of the resource.",
      "properties": {
        "createdBy": {
          "type": "string",
          "description": "The identity that created the resource."
        },
        "createdByType": {
          "type": "string",
          "description": "The type of identity that created the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource creation (UTC)."
        },
        "lastModifiedBy": {
          "type": "string",
          "description": "The identity that last modified the resource."
        },
        "lastModifiedByType": {
          "type": "string",
          "description": "The type of identity that last modified the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "lastModifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource last modification (UTC)"
        }
      },
      "readOnly": true
    }
  }
}