|
| 1 | +# Google Cloud Pub/Sub Bindings |
| 2 | + |
| 3 | +This document defines how to describe Google Cloud Pub/Sub specific information with AsyncAPI. |
| 4 | + |
| 5 | +<a name="version"></a> |
| 6 | + |
| 7 | +## Version |
| 8 | + |
| 9 | +Current version is `1.0.0`. |
| 10 | + |
| 11 | +<a name="channel"></a> |
| 12 | + |
| 13 | +## Channel Binding Object |
| 14 | + |
| 15 | +The `Channel Bindings Object` is used to describe the Google Cloud Pub/Sub specific |
| 16 | +[Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/create) details with AsyncAPI. |
| 17 | + |
| 18 | +Field Name | Type | Description |
| 19 | +---|---|--- |
| 20 | +`bindingVersion`|String|The current version is `1.0.0` |
| 21 | +`labels`|Object|An object of key-value pairs _(These are used to categorize Cloud Resources like Cloud Pub/Sub Topics.)_ |
| 22 | +`messageRetentionDuration`|String|Indicates the minimum duration to retain a message after it is published to the topic _(Must be a valid [Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration).)_ |
| 23 | +`messageStoragePolicy`|[Message Storage Policy Object](#message-storage-policy-object)|Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored |
| 24 | +`schemaSettings`|[Schema Settings Object](#schema-settings-object)|Settings for validating messages published against a schema |
| 25 | + |
| 26 | +<a name="message-storage-policy-object"></a> |
| 27 | + |
| 28 | +### Message Storage Policy Object |
| 29 | + |
| 30 | +The `Message Storage Policy Object` is used to describe the Google Cloud Pub/Sub |
| 31 | +[MessageStoragePolicy](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#MessageStoragePolicy) |
| 32 | +Object with AsyncAPI. |
| 33 | + |
| 34 | +Field Name | Type | Description |
| 35 | +---|---|--- |
| 36 | +`allowedPersistenceRegions`|String[]|A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage |
| 37 | + |
| 38 | +<a name="schema-settings-object"></a> |
| 39 | + |
| 40 | +### Schema Settings Object |
| 41 | + |
| 42 | +The `Schema Settings Object` is used to describe the Google Cloud Pub/Sub |
| 43 | +[SchemaSettings](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#SchemaSettings) Object with |
| 44 | +AsyncAPI. |
| 45 | + |
| 46 | +Field Name | Type | Description |
| 47 | +---|---|--- |
| 48 | +`encoding`|String|The encoding of the message _(Must be one of the possible [Encoding](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#encoding) values.)_ |
| 49 | +`firstRevisionId`|String|The minimum _(inclusive)_ revision allowed for validating messages |
| 50 | +`lastRevisionId`|String|The maximum _(inclusive)_ revision allowed for validating messages |
| 51 | +`name`|String|The name of the schema that messages published should be validated against _(Format is `projects/{project}/schemas/{schema}`.)_ |
| 52 | + |
| 53 | +<a name="message"></a> |
| 54 | + |
| 55 | +## Message Binding Object |
| 56 | + |
| 57 | +The `Message Binding Object` is used to describe the Google Cloud Pub/Sub specific |
| 58 | +[PubsubMessage](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage) details, alongside with pertintent |
| 59 | +parts of the Google Cloud Pub/Sub |
| 60 | +[Schema](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Schema) |
| 61 | +Object, with AsyncAPI. |
| 62 | + |
| 63 | +Field Name | Type | Description |
| 64 | +---|---|--- |
| 65 | +`bindingVersion`|String|The current version is `1.0.0` |
| 66 | +`attributes`|Object|An object of key-value pairs _(Attributes for this message.)_ |
| 67 | +`orderingKey`|String|if non-empty, identifies related messages for which publish order should be respected |
| 68 | +`schema`|[Schema Definition Object](#schema-definition-object)|Describes the schema used to validate the payload of this message |
| 69 | + |
| 70 | +<a name="schema-definition-object"></a> |
| 71 | + |
| 72 | +### Schema Definition Object |
| 73 | + |
| 74 | +The `Schema Definition Object` is used to describe the Google Cloud Pub/Sub |
| 75 | +[Schema]([Schema](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Schema)) Object with AsyncAPI. |
| 76 | +While some of this information could be, or is, described using native AsyncAPI, for consistency it makes sense to |
| 77 | +provide this information here at all times, especially for cases where AsyncAPI does not natively support describing |
| 78 | +payloads using a supported Google Cloud Pub/Sub schema format like Protobuf. |
| 79 | + |
| 80 | +Field Name | Type | Description |
| 81 | +---|---|--- |
| 82 | +`definition`|String|The definition of the schema |
| 83 | +`name`|String|The name of the schema |
| 84 | +`type`|String|The type of the schema |
| 85 | + |
| 86 | +<a name="operation"></a> |
| 87 | + |
| 88 | +## Operation Binding Object |
| 89 | + |
| 90 | +This object MUST NOT contain any properties. Its name is reserved for future use. |
| 91 | + |
| 92 | +<a name="server"></a> |
| 93 | + |
| 94 | +## Server Binding Object |
| 95 | + |
| 96 | +This object MUST NOT contain any properties. Its name is reserved for future use. |
0 commit comments