{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/google-cloud-pubsub/refs/heads/main/json-schema/google-cloud-pubsub-topic-schema.json",
  "title": "Google Cloud Pub/Sub Topic",
  "description": "Represents a Pub/Sub topic, which is a named resource to which messages are sent by publishers.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the topic in the format projects/{project}/topics/{topic}."
    },
    "labels": {
      "type": "object",
      "description": "User labels for the topic.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "messageStoragePolicy": {
      "type": "object",
      "description": "Policy constraining the set of Google Cloud regions where messages published to the topic may be stored.",
      "properties": {
        "allowedPersistenceRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of IDs of Google Cloud regions where messages published to the topic may be persisted."
        }
      }
    },
    "kmsKeyName": {
      "type": "string",
      "description": "The resource name of the Cloud KMS CryptoKey used to protect access to messages published on this topic."
    },
    "schemaSettings": {
      "type": "object",
      "description": "Settings for validating messages published against a schema.",
      "properties": {
        "schema": {
          "type": "string",
          "description": "The name of the schema that messages published should be validated against."
        },
        "encoding": {
          "type": "string",
          "enum": ["ENCODING_UNSPECIFIED", "JSON", "BINARY"],
          "description": "The encoding of messages validated against the schema."
        },
        "firstRevisionId": {
          "type": "string"
        },
        "lastRevisionId": {
          "type": "string"
        }
      }
    },
    "satisfiesPzs": {
      "type": "boolean",
      "description": "Reserved for future use."
    },
    "messageRetentionDuration": {
      "type": "string",
      "description": "How long to retain unacknowledged messages in the topic's backlog, from the moment a message is published."
    }
  },
  "required": ["name"]
}
