Type Definitions
AcknowledgeRequest
Request for the Acknowledge method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The subscription whose message is being acknowledged.
Format is |
ackIds |
Array.<string> |
The acknowledgment ID for the messages being acknowledged that was returned
by the Pub/Sub system in the |
- Source:
- See:
CreateSnapshotRequest
Request for the CreateSnapshot
method.
Properties:
Name | Type | Description |
---|---|---|
name |
string |
Optional user-provided name for this snapshot.
If the name is not provided in the request, the server will assign a random
name for this snapshot on the same project as the subscription.
Note that for REST API requests, you must specify a name. See the
resource name rules.
Format is |
subscription |
string |
The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
labels |
Object.<string, string> |
- Source:
- See:
DeadLetterPolicy
Dead lettering is done on a best effort basis. The same message might be dead lettered multiple times.
If validation on any of the fields fails at subscription creation/updation, the create/update subscription request will fail.
Properties:
Name | Type | Description |
---|---|---|
deadLetterTopic |
string |
The name of the topic to which dead letter messages should be published.
Format is The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost. |
maxDeliveryAttempts |
number |
The maximum number of delivery attempts for any message. The value must be between 5 and 100. The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgement deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines. This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used. |
- Source:
- See:
DeleteSnapshotRequest
Request for the DeleteSnapshot
method.
Properties:
Name | Type | Description |
---|---|---|
snapshot |
string |
The name of the snapshot to delete.
Format is |
- Source:
- See:
DeleteSubscriptionRequest
Request for the DeleteSubscription method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The subscription to delete.
Format is |
- Source:
- See:
DeleteTopicRequest
Request for the DeleteTopic
method.
Properties:
Name | Type | Description |
---|---|---|
topic |
string |
Name of the topic to delete.
Format is |
- Source:
- See:
ExpirationPolicy
A policy that specifies the conditions for resource expiration (i.e., automatic resource deletion).
Properties:
Name | Type | Description |
---|---|---|
ttl |
Object |
Specifies the "time-to-live" duration for an associated resource. The
resource expires if it is not active for a period of This object should have the same structure as Duration |
- Source:
- See:
GetSnapshotRequest
Request for the GetSnapshot method.
Properties:
Name | Type | Description |
---|---|---|
snapshot |
string |
The name of the snapshot to get.
Format is |
- Source:
- See:
GetSubscriptionRequest
Request for the GetSubscription method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The name of the subscription to get.
Format is |
- Source:
- See:
GetTopicRequest
Request for the GetTopic method.
Properties:
Name | Type | Description |
---|---|---|
topic |
string |
The name of the topic to get.
Format is |
- Source:
- See:
ListSnapshotsRequest
Request for the ListSnapshots
method.
Properties:
Name | Type | Description |
---|---|---|
project |
string |
The name of the project in which to list snapshots.
Format is |
pageSize |
number |
Maximum number of snapshots to return. |
pageToken |
string |
The value returned by the last |
- Source:
- See:
ListSnapshotsResponse
Response for the ListSnapshots
method.
Properties:
Name | Type | Description |
---|---|---|
snapshots |
Array.<Object> |
The resulting snapshots. This object should have the same structure as Snapshot |
nextPageToken |
string |
If not empty, indicates that there may be more snapshot that match the
request; this value should be passed in a new |
- Source:
- See:
ListSubscriptionsRequest
Request for the ListSubscriptions
method.
Properties:
Name | Type | Description |
---|---|---|
project |
string |
The name of the project in which to list subscriptions.
Format is |
pageSize |
number |
Maximum number of subscriptions to return. |
pageToken |
string |
The value returned by the last |
- Source:
- See:
ListSubscriptionsResponse
Response for the ListSubscriptions
method.
Properties:
Name | Type | Description |
---|---|---|
subscriptions |
Array.<Object> |
The subscriptions that match the request. This object should have the same structure as Subscription |
nextPageToken |
string |
If not empty, indicates that there may be more subscriptions that match
the request; this value should be passed in a new
|
- Source:
- See:
ListTopicSnapshotsRequest
Request for the ListTopicSnapshots
method.
Properties:
Name | Type | Description |
---|---|---|
topic |
string |
The name of the topic that snapshots are attached to.
Format is |
pageSize |
number |
Maximum number of snapshot names to return. |
pageToken |
string |
The value returned by the last |
- Source:
- See:
ListTopicSnapshotsResponse
Response for the ListTopicSnapshots
method.
Properties:
Name | Type | Description |
---|---|---|
snapshots |
Array.<string> |
The names of the snapshots that match the request. |
nextPageToken |
string |
If not empty, indicates that there may be more snapshots that match
the request; this value should be passed in a new
|
- Source:
- See:
ListTopicsRequest
Request for the ListTopics
method.
Properties:
Name | Type | Description |
---|---|---|
project |
string |
The name of the project in which to list topics.
Format is |
pageSize |
number |
Maximum number of topics to return. |
pageToken |
string |
The value returned by the last |
- Source:
- See:
ListTopicsResponse
Response for the ListTopics
method.
Properties:
Name | Type | Description |
---|---|---|
topics |
Array.<Object> |
The resulting topics. This object should have the same structure as Topic |
nextPageToken |
string |
If not empty, indicates that there may be more topics that match the
request; this value should be passed in a new |
- Source:
- See:
ListTopicSubscriptionsRequest
Request for the ListTopicSubscriptions
method.
Properties:
Name | Type | Description |
---|---|---|
topic |
string |
The name of the topic that subscriptions are attached to.
Format is |
pageSize |
number |
Maximum number of subscription names to return. |
pageToken |
string |
The value returned by the last |
- Source:
- See:
ListTopicSubscriptionsResponse
Response for the ListTopicSubscriptions
method.
Properties:
Name | Type | Description |
---|---|---|
subscriptions |
Array.<string> |
The names of the subscriptions that match the request. |
nextPageToken |
string |
If not empty, indicates that there may be more subscriptions that match
the request; this value should be passed in a new
|
- Source:
- See:
MessageStoragePolicy
Properties:
Name | Type | Description |
---|---|---|
allowedPersistenceRegions |
Array.<string> |
A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration. |
- Source:
- See:
ModifyAckDeadlineRequest
Request for the ModifyAckDeadline method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The name of the subscription.
Format is |
ackIds |
Array.<string> |
List of acknowledgment IDs. |
ackDeadlineSeconds |
number |
The new ack deadline with respect to the time this request was sent to
the Pub/Sub system. For example, if the value is 10, the new
ack deadline will expire 10 seconds after the |
- Source:
- See:
ModifyPushConfigRequest
Request for the ModifyPushConfig method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The name of the subscription.
Format is |
pushConfig |
Object |
The push configuration for future deliveries. An empty This object should have the same structure as PushConfig |
- Source:
- See:
OidcToken
Contains information needed for generating an OpenID Connect token.
Properties:
Name | Type | Description |
---|---|---|
serviceAccountEmail |
string |
Service account email to be used for generating the OIDC token. The caller (for CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account. |
audience |
string |
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used. |
- Source:
- See:
PublishRequest
Request for the Publish method.
Properties:
Name | Type | Description |
---|---|---|
topic |
string |
The messages in the request will be published on this topic.
Format is |
messages |
Array.<Object> |
The messages to publish. This object should have the same structure as PubsubMessage |
- Source:
- See:
PublishResponse
Response for the Publish
method.
Properties:
Name | Type | Description |
---|---|---|
messageIds |
Array.<string> |
The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic. |
- Source:
- See:
PubsubMessage
A message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the corresponding client library documentation for more information. See Quotas and limits for more information about message limits.
Properties:
Name | Type | Description |
---|---|---|
data |
Buffer |
The message data field. If this field is empty, the message must contain at least one attribute. |
attributes |
Object.<string, string> |
Optional attributes for this message. |
messageId |
string |
ID of this message, assigned by the server when the message is published.
Guaranteed to be unique within the topic. This value may be read by a
subscriber that receives a |
publishTime |
Object |
The time at which the message was published, populated by the server when
it receives the This object should have the same structure as Timestamp |
orderingKey |
string |
Identifies related messages for which publish order should be respected.
If a |
- Source:
- See:
PullRequest
Request for the Pull
method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The subscription from which messages should be pulled.
Format is |
returnImmediately |
boolean |
If this field set to true, the system will respond immediately even if
it there are no messages available to return in the |
maxMessages |
number |
The maximum number of messages to return for this request. Must be a positive integer. The Pub/Sub system may return fewer than the number specified. |
- Source:
- See:
PullResponse
Response for the Pull
method.
Properties:
Name | Type | Description |
---|---|---|
receivedMessages |
Array.<Object> |
Received Pub/Sub messages. The list will be empty if there are no more
messages available in the backlog. For JSON, the response can be entirely
empty. The Pub/Sub system may return fewer than the This object should have the same structure as ReceivedMessage |
- Source:
- See:
PushConfig
Configuration for a push delivery endpoint.
Properties:
Name | Type | Description |
---|---|---|
pushEndpoint |
string |
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push". |
attributes |
Object.<string, string> |
Endpoint configuration attributes that can be used to control different aspects of the message delivery. The only currently supported attribute is If not present during the The only supported values for the
For example:
|
oidcToken |
Object |
If specified, Pub/Sub will generate and attach an OIDC JWT token as an
This object should have the same structure as OidcToken |
- Source:
- See:
ReceivedMessage
A message and its corresponding acknowledgment ID.
Properties:
Name | Type | Description |
---|---|---|
ackId |
string |
This ID can be used to acknowledge the received message. |
message |
Object |
The message. This object should have the same structure as PubsubMessage |
deliveryAttempt |
number |
Delivery attempt counter is 1 + (the sum of number of NACKs and number of ack_deadline exceeds) for this message. A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline exceeds event is whenever a message is not acknowledged within ack_deadline. Note that ack_deadline is initially Subscription.ackDeadlineSeconds, but may get extended automatically by the client library. The first delivery of a given message will have this value as 1. The value is calculated at best effort and is approximate. If a DeadLetterPolicy is not set on the subscription, this will be 0. EXPERIMENTAL: This feature is part of a closed alpha release. This API might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. |
- Source:
- See:
SeekRequest
Request for the Seek
method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The subscription to affect. |
time |
Object |
The time to seek to.
Messages retained in the subscription that were published before this
time are marked as acknowledged, and messages retained in the
subscription that were published after this time are marked as
unacknowledged. Note that this operation affects only those messages
retained in the subscription (configured by the combination of
This object should have the same structure as Timestamp |
snapshot |
string |
The snapshot to seek to. The snapshot's topic must be the same as that of
the provided subscription.
Format is |
- Source:
- See:
SeekResponse
Response for the Seek
method (this response is empty).
- Source:
- See:
Snapshot
A snapshot resource. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
Properties:
Name | Type | Description |
---|---|---|
name |
string |
The name of the snapshot. |
topic |
string |
The name of the topic from which this snapshot is retaining messages. |
expireTime |
Object |
The snapshot is guaranteed to exist up until this time.
A newly-created snapshot expires no later than 7 days from the time of its
creation. Its exact lifetime is determined at creation by the existing
backlog in the source subscription. Specifically, the lifetime of the
snapshot is This object should have the same structure as Timestamp |
labels |
Object.<string, string> |
- Source:
- See:
StreamingPullRequest
Request for the StreamingPull
streaming RPC method. This request is used to
establish the initial stream as well as to stream acknowledgements and ack
deadline modifications from the client to the server.
Properties:
Name | Type | Description |
---|---|---|
subscription |
string |
The subscription for which to initialize the new stream. This must be
provided in the first request on the stream, and must not be set in
subsequent requests from client to server.
Format is |
ackIds |
Array.<string> |
List of acknowledgement IDs for acknowledging previously received messages
(received on this stream or a different stream). If an ack ID has expired,
the corresponding message may be redelivered later. Acknowledging a message
more than once will not result in an error. If the acknowledgement ID is
malformed, the stream will be aborted with status |
modifyDeadlineSeconds |
Array.<number> |
The list of new ack deadlines for the IDs listed in
|
modifyDeadlineAckIds |
Array.<string> |
List of acknowledgement IDs whose deadline will be modified based on the
corresponding element in |
streamAckDeadlineSeconds |
number |
The ack deadline to use for the stream. This must be provided in the first request on the stream, but it can also be updated on subsequent requests from client to server. The minimum deadline you can specify is 10 seconds. The maximum deadline you can specify is 600 seconds (10 minutes). |
- Source:
- See:
StreamingPullResponse
Response for the StreamingPull
method. This response is used to stream
messages from the server to the client.
Properties:
Name | Type | Description |
---|---|---|
receivedMessages |
Array.<Object> |
Received Pub/Sub messages. This will not be empty. This object should have the same structure as ReceivedMessage |
- Source:
- See:
Subscription
A subscription resource.
Properties:
Name | Type | Description |
---|---|---|
name |
string |
The name of the subscription. It must have the format
|
topic |
string |
The name of the topic from which this subscription is receiving messages.
Format is |
pushConfig |
Object |
If push delivery is used with this subscription, this field is
used to configure it. An empty This object should have the same structure as PushConfig |
ackDeadlineSeconds |
number |
The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
retainAckedMessages |
boolean |
Indicates whether to retain acknowledged messages. If true, then
messages are not expunged from the subscription's backlog, even if they are
acknowledged, until they fall out of the |
messageRetentionDuration |
Object |
How long to retain unacknowledged messages in the subscription's backlog,
from the moment a message is published.
If This object should have the same structure as Duration |
labels |
Object.<string, string> | |
enableMessageOrdering |
boolean |
If true, messages published with the same |
expirationPolicy |
Object |
A policy that specifies the conditions for this subscription's expiration.
A subscription is considered active as long as any connected subscriber is
successfully consuming messages from the subscription or is issuing
operations on the subscription. If This object should have the same structure as ExpirationPolicy |
deadLetterPolicy |
Object |
A policy that specifies the conditions for dead lettering messages in this subscription. If dead_letter_policy is not set, dead lettering is disabled. The Cloud Pub/Sub service account associated with this subscriptions's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Acknowledge() messages on this subscription. EXPERIMENTAL: This feature is part of a closed alpha release. This API might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. This object should have the same structure as DeadLetterPolicy |
- Source:
- See:
Topic
A topic resource.
Properties:
Name | Type | Description |
---|---|---|
name |
string |
The name of the topic. It must have the format
|
labels |
Object.<string, string> | |
messageStoragePolicy |
Object |
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. This object should have the same structure as MessageStoragePolicy |
kmsKeyName |
string |
The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is |
- Source:
- See:
UpdateSnapshotRequest
Request for the UpdateSnapshot method.
Properties:
Name | Type | Description |
---|---|---|
snapshot |
Object |
The updated snapshot object. This object should have the same structure as Snapshot |
updateMask |
Object |
Indicates which fields in the provided snapshot to update. Must be specified and non-empty. This object should have the same structure as FieldMask |
- Source:
- See:
UpdateSubscriptionRequest
Request for the UpdateSubscription method.
Properties:
Name | Type | Description |
---|---|---|
subscription |
Object |
The updated subscription object. This object should have the same structure as Subscription |
updateMask |
Object |
Indicates which fields in the provided subscription to update. Must be specified and non-empty. This object should have the same structure as FieldMask |
- Source:
- See:
UpdateTopicRequest
Request for the UpdateTopic method.
Properties:
Name | Type | Description |
---|---|---|
topic |
Object |
The updated topic object. This object should have the same structure as Topic |
updateMask |
Object |
Indicates which fields in the provided topic to update. Must be specified
and non-empty. Note that if This object should have the same structure as FieldMask |