Package google.cloud.pubsublite.v1

Index

AdminService

The service that a client application uses to manage topics and subscriptions, such creating, listing, and deleting topics and subscriptions.

CreateSubscription

rpc CreateSubscription(CreateSubscriptionRequest) returns (Subscription)

Creates a new subscription.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateTopic

rpc CreateTopic(CreateTopicRequest) returns (Topic)

Creates a new topic.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteSubscription

rpc DeleteSubscription(DeleteSubscriptionRequest) returns (Empty)

Deletes the specified subscription.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteTopic

rpc DeleteTopic(DeleteTopicRequest) returns (Empty)

Deletes the specified topic.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetSubscription

rpc GetSubscription(GetSubscriptionRequest) returns (Subscription)

Returns the subscription configuration.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetTopic

rpc GetTopic(GetTopicRequest) returns (Topic)

Returns the topic configuration.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetTopicPartitions

rpc GetTopicPartitions(GetTopicPartitionsRequest) returns (TopicPartitions)

Returns the partition information for the requested topic.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListSubscriptions

rpc ListSubscriptions(ListSubscriptionsRequest) returns (ListSubscriptionsResponse)

Returns the list of subscriptions for the given project.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListTopicSubscriptions

rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) returns (ListTopicSubscriptionsResponse)

Lists the subscriptions attached to the specified topic.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListTopics

rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse)

Returns the list of topics for the given project.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateSubscription

rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription)

Updates properties of the specified subscription.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateTopic

rpc UpdateTopic(UpdateTopicRequest) returns (Topic)

Updates properties of the specified topic.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CursorService

The service that a subscriber client application uses to manage committed cursors while receiving messsages. A cursor represents a subscriber's progress within a topic partition for a given subscription.

CommitCursor

rpc CommitCursor(CommitCursorRequest) returns (CommitCursorResponse)

Updates the committed cursor.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListPartitionCursors

rpc ListPartitionCursors(ListPartitionCursorsRequest) returns (ListPartitionCursorsResponse)

Returns all committed cursor information for a subscription.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

StreamingCommitCursor

rpc StreamingCommitCursor(StreamingCommitCursorRequest) returns (StreamingCommitCursorResponse)

Establishes a stream with the server for managing committed cursors.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

PublisherService

The service that a publisher client application uses to publish messages to topics. Published messages are retained by the service for the duration of the retention period configured for the respective topic, and are delivered to subscriber clients upon request (via the SubscriberService).

Publish

rpc Publish(PublishRequest) returns (PublishResponse)

Establishes a stream with the server for publishing messages. Once the stream is initialized, the client publishes messages by sending publish requests on the stream. The server responds with a PublishResponse for each PublishRequest sent by the client, in the same order that the requests were sent. Note that multiple PublishRequests can be in flight simultaneously, but they will be processed by the server in the order that they are sent by the client on a given stream.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

SubscriberService

The service that a subscriber client application uses to receive messages from subscriptions.

Subscribe

rpc Subscribe(SubscribeRequest) returns (SubscribeResponse)

Establishes a stream with the server for receiving messages.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AttributeValues

The values associated with a key of an attribute.

Fields
values[]

bytes

The list of values associated with a key.

CommitCursorRequest

Request for CommitCursor.

Fields
subscription

string

The subscription for which to update the cursor.

partition

int64

The partition for which to update the cursor. Partitions are zero indexed, so partition must be in the range [0, topic.num_partitions).

cursor

Cursor

The new value for the committed cursor.

CommitCursorResponse

Response for CommitCursor.

CreateSubscriptionRequest

Request for CreateSubscription.

Fields
parent

string

Required. The parent location in which to create the subscription. Structured like projects/{project_number}/locations/{location}.

subscription

Subscription

Required. Configuration of the subscription to create. Its name field is ignored.

subscription_id

string

Required. The ID to use for the subscription, which will become the final component of the subscription's name.

This value is structured like: my-sub-name.

CreateTopicRequest

Request for CreateTopic.

Fields
parent

string

Required. The parent location in which to create the topic. Structured like projects/{project_number}/locations/{location}.

topic

Topic

Required. Configuration of the topic to create. Its name field is ignored.

topic_id

string

Required. The ID to use for the topic, which will become the final component of the topic's name.

This value is structured like: my-topic-name.

Cursor

A cursor that describes the position of a message within a topic partition.

Fields
offset

int64

The offset of a message within a topic partition. Must be greater than or equal 0.

DeleteSubscriptionRequest

Request for DeleteSubscription.

Fields
name

string

Required. The name of the subscription to delete.

DeleteTopicRequest

Request for DeleteTopic.

Fields
name

string

Required. The name of the topic to delete.

FlowControlRequest

Request to grant tokens to the server, requesting delivery of messages when they become available.

Fields
allowed_messages

int64

The number of message tokens to grant. Must be greater than or equal to 0.

allowed_bytes

int64

The number of byte tokens to grant. Must be greater than or equal to 0.

GetSubscriptionRequest

Request for GetSubscription.

Fields
name

string

Required. The name of the subscription whose configuration to return.

GetTopicPartitionsRequest

Request for GetTopicPartitions.

Fields
name

string

Required. The topic whose partition information to return.

GetTopicRequest

Request for GetTopic.

Fields
name

string

Required. The name of the topic whose configuration to return.

InitialCommitCursorRequest

The first streaming request that must be sent on a newly-opened stream. The client must wait for the response before sending subsequent requests on the stream.

Fields
subscription

string

The subscription for which to manage committed cursors.

partition

int64

The partition for which to manage committed cursors. Partitions are zero indexed, so partition must be in the range [0, topic.num_partitions).

InitialCommitCursorResponse

Response to an InitialCommitCursorRequest.

InitialPublishRequest

The first request that must be sent on a newly-opened stream.

Fields
topic

string

The topic to which messages will be written.

partition

int64

The partition within the topic to which messages will be written. Partitions are zero indexed, so partition must be in the range [0, topic.num_partitions).

InitialPublishResponse

Response to an InitialPublishRequest.

InitialSubscribeRequest

The first request that must be sent on a newly-opened stream. The client must wait for the response before sending subsequent requests on the stream.

Fields
subscription

string

The subscription from which to receive messages.

partition

int64

The partition from which to receive messages. Partitions are zero indexed, so partition must be in the range [0, topic.num_partitions).

InitialSubscribeResponse

Response to an InitialSubscribeRequest.

Fields
cursor

Cursor

The cursor from which the subscriber will start receiving messages once flow control tokens become available.

ListPartitionCursorsRequest

Request for ListPartitionCursors.

Fields
parent

string

Required. The subscription for which to retrieve cursors. Structured like projects/{project_number}/locations/{location}/subscriptions/{subscription_id}.

page_size

int32

The maximum number of cursors to return. The service may return fewer than this value. If unset or zero, all cursors for the parent will be returned.

page_token

string

A page token, received from a previous ListPartitionCursors call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListPartitionCursors must match the call that provided the page token.

ListPartitionCursorsResponse

Response for ListPartitionCursors

Fields
partition_cursors[]

PartitionCursor

The partition cursors from this request.

next_page_token

string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

ListSubscriptionsRequest

Request for ListSubscriptions.

Fields
parent

string

Required. The parent whose subscriptions are to be listed. Structured like projects/{project_number}/locations/{location}.

page_size

int32

The maximum number of subscriptions to return. The service may return fewer than this value. If unset or zero, all subscriptions for the parent will be returned.

page_token

string

A page token, received from a previous ListSubscriptions call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListSubscriptions must match the call that provided the page token.

ListSubscriptionsResponse

Response for ListSubscriptions.

Fields
subscriptions[]

Subscription

The list of subscriptions in the requested parent. The order of the subscriptions is unspecified.

next_page_token

string

A token that can be sent as page_token to retrieve the next page of results. If this field is omitted, there are no more results.

ListTopicSubscriptionsRequest

Request for ListTopicSubscriptions.

Fields
name

string

Required. The name of the topic whose subscriptions to list.

page_size

int32

The maximum number of subscriptions to return. The service may return fewer than this value. If unset or zero, all subscriptions for the given topic will be returned.

page_token

string

A page token, received from a previous ListTopicSubscriptions call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListTopicSubscriptions must match the call that provided the page token.

ListTopicSubscriptionsResponse

Response for ListTopicSubscriptions.

Fields
subscriptions[]

string

The names of subscriptions attached to the topic. The order of the subscriptions is unspecified.

next_page_token

string

A token that can be sent as page_token to retrieve the next page of results. If this field is omitted, there are no more results.

ListTopicsRequest

Request for ListTopics.

Fields
parent

string

Required. The parent whose topics are to be listed. Structured like projects/{project_number}/locations/{location}.

page_size

int32

The maximum number of topics to return. The service may return fewer than this value. If unset or zero, all topics for the parent will be returned.

page_token

string

A page token, received from a previous ListTopics call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListTopics must match the call that provided the page token.

ListTopicsResponse

Response for ListTopics.

Fields
topics[]

Topic

The list of topic in the requested parent. The order of the topics is unspecified.

next_page_token

string

A token that can be sent as page_token to retrieve the next page of results. If this field is omitted, there are no more results.

MessagePublishRequest

Request to publish messages to the topic.

Fields
messages[]

PubSubMessage

MessagePublishResponse

Response to a MessagePublishRequest.

Fields
start_cursor

Cursor

The cursor of the first published message in the batch. The cursors for any remaining messages in the batch are guaranteed to be sequential.

MessageResponse

Response containing a list of messages. Upon delivering a MessageResponse to the client, the server: * Updates the stream's delivery cursor to one greater than the cursor of the last message in the list. * Subtracts the total number of bytes and messages from the tokens available to the server.

Fields
messages[]

SequencedMessage

Messages from the topic partition.

PartitionCursor

A pair of a Cursor and the partition it is for.

Fields
partition

int64

The partition this is for.

cursor

Cursor

The value of the cursor.

PubSubMessage

A message that is published by publishers and delivered to subscribers.

Fields
key

bytes

The key used for routing messages to partitions or for compaction (e.g., keep the last N messages per key). If the key is empty, the message is routed to an arbitrary partition.

data

bytes

The payload of the message.

attributes

map<string, AttributeValues>

Optional attributes that can be used for message metadata/headers.

event_time

Timestamp

An optional, user-specified event time.

PublishRequest

Request sent from the client to the server on a stream.

Fields

Union field request_type.

request_type can be only one of the following:

initial_request

InitialPublishRequest

Initial request on the stream.

message_publish_request

MessagePublishRequest

Request to publish messages.

PublishResponse

Response to a PublishRequest.

Fields

Union field response_type.

response_type can be only one of the following:

initial_response

InitialPublishResponse

Initial response on the stream.

message_response

MessagePublishResponse

Response to publishing messages.

SeekRequest

Request to update the stream's delivery cursor based on the given target. Resets the server available tokens to 0. SeekRequests may not be sent while another SeekRequest is outstanding (i.e., has not received a SeekResponse) on the same stream. SeekRequests past head result in stream breakage.

Fields
Union field target. The target to seek to. Must be set. target can be only one of the following:
named_target

NamedTarget

A named target.

cursor

Cursor

A target corresponding to the cursor, pointing to anywhere in the topic partition.

NamedTarget

A special target in the partition that takes no other parameters.

Enums
NAMED_TARGET_UNSPECIFIED Default value. This value is unused.
HEAD A target corresponding to the most recently published message in the partition.
COMMITTED_CURSOR A target corresponding to the committed cursor for the given subscription and topic partition.

SeekResponse

Response to a SeekRequest.

Fields
cursor

Cursor

The new delivery cursor for the current stream.

SequencedCommitCursorRequest

Streaming request to update the committed cursor. Subsequent SequencedCommitCursorRequests override outstanding ones.

Fields
cursor

Cursor

The new value for the committed cursor.

SequencedCommitCursorResponse

Response to a SequencedCommitCursorRequest.

Fields
acknowledged_commits

int64

The number of outstanding SequencedCommitCursorRequests acknowledged by this response. Note that SequencedCommitCursorRequests are acknowledged in the order that they are received.

SequencedMessage

Fields
cursor

Cursor

The position of a message within the partition where it is stored.

publish_time

Timestamp

The time when the message was received by the server when it was first published.

message

PubSubMessage

The user message.

size_bytes

int64

The size in bytes of this message for flow control and quota purposes.

StreamingCommitCursorRequest

A request sent from the client to the server on a stream.

Fields

Union field request.

request can be only one of the following:

initial

InitialCommitCursorRequest

Initial request on the stream.

commit

SequencedCommitCursorRequest

Request to commit a new cursor value.

StreamingCommitCursorResponse

Response to a StreamingCommitCursorRequest.

Fields

Union field request.

request can be only one of the following:

initial

InitialCommitCursorResponse

Initial response on the stream.

commit

SequencedCommitCursorResponse

Response to committing a new cursor value.

SubscribeRequest

A request sent from the client to the server on a stream.

Fields

Union field request.

request can be only one of the following:

initial

InitialSubscribeRequest

Initial request on the stream.

seek

SeekRequest

Request to update the stream's delivery cursor.

flow_control

FlowControlRequest

Request to grant tokens to the server,

SubscribeResponse

Response to SubscribeRequest.

Fields

Union field response.

response can be only one of the following:

initial

InitialSubscribeResponse

Initial response on the stream.

seek

SeekResponse

Response to a Seek operation.

messages

MessageResponse

Response containing messages from the topic partition.

Subscription

Metadata about a subscription resource.

Fields
name

string

The name of the subscription. Structured like: projects/{project_number}/locations/{location}/subscriptions/{subscription_id}

topic

string

The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}

delivery_config

DeliveryConfig

The settings for this subscription's message delivery.

DeliveryConfig

The settings for a subscription's message delivery.

Fields
delivery_requirement

DeliveryRequirement

The DeliveryRequirement for this subscription.

DeliveryRequirement

When this subscription should send messages to subscribers relative to messages persistence in storage. For details, see Creating Lite subscriptions.

Enums
DELIVERY_REQUIREMENT_UNSPECIFIED Default value. This value is unused.
DELIVER_IMMEDIATELY The server does not wait for a published message to be successfully written to storage before delivering it to subscribers.
DELIVER_AFTER_STORED The server will not deliver a published message to subscribers until the message has been successfully written to storage. This will result in higher end-to-end latency, but consistent delivery.

Topic

Metadata about a topic resource.

Fields
name

string

The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}

partition_config

PartitionConfig

The settings for this topic's partitions.

retention_config

RetentionConfig

The settings for this topic's message retention.

PartitionConfig

The settings for a topic's partitions.

Fields
count

int64

The number of partitions in the topic. Must be at least 1.

scale

int32

Every partition in the topic is allocated throughput equivalent to scale times the standard partition throughput (4 MiB/s). This is also reflected in the cost of this topic; a topic with scale of 2 and count of 10 is charged for 20 partitions. This value must be in the range [1,4].

RetentionConfig

The settings for a topic's message retention.

Fields
per_partition_bytes

int64

The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic's partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of period.

period

Duration

How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below per_partition_bytes.

TopicPartitions

Response for GetTopicPartitions.

Fields
partition_count

int64

The number of partitions in the topic.

UpdateSubscriptionRequest

Request for UpdateSubscription.

Fields
subscription

Subscription

Required. The subscription to update. Its name field must be populated. Topic field must not be populated.

update_mask

FieldMask

Required. A mask specifying the subscription fields to change.

UpdateTopicRequest

Request for UpdateTopic.

Fields
topic

Topic

Required. The topic to update. Its name field must be populated.

update_mask

FieldMask

Required. A mask specifying the topic fields to change.