A service to manipulate topics.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
TopicAdminClient(TopicAdminClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TopicAdminClient const &
|
TopicAdminClient(TopicAdminClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TopicAdminClient &&
|
TopicAdminClient(std::shared_ptr< TopicAdminConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< TopicAdminConnection >
|
opts |
Options
|
Operators
operator=(TopicAdminClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TopicAdminClient const &
|
Returns | |
---|---|
Type | Description |
TopicAdminClient & |
operator=(TopicAdminClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TopicAdminClient &&
|
Returns | |
---|---|
Type | Description |
TopicAdminClient & |
Functions
CreateTopic(std::string const &, Options)
Creates the given topic with the given name.
See the resource name rules.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the topic. It must have the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateTopic(google::pubsub::v1::Topic const &, Options)
Creates the given topic with the given name.
See the resource name rules.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::Topic const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateTopic(google::pubsub::v1::Topic const &, google::protobuf::FieldMask const &, Options)
Updates an existing topic by updating the fields specified in the update mask.
Note that certain properties of a topic are not modifiable.
Parameters | |
---|---|
Name | Description |
topic |
google::pubsub::v1::Topic const &
Required. The updated topic object. |
update_mask |
google::protobuf::FieldMask const &
Required. Indicates which fields in the provided topic to update. Must be specified and non-empty. Note that if |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateTopic(google::pubsub::v1::UpdateTopicRequest const &, Options)
Updates an existing topic by updating the fields specified in the update mask.
Note that certain properties of a topic are not modifiable.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::UpdateTopicRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetTopic(std::string const &, Options)
Gets the configuration of a topic.
Parameters | |
---|---|
Name | Description |
topic |
std::string const &
Required. The name of the topic to get. Format is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetTopic(google::pubsub::v1::GetTopicRequest const &, Options)
Gets the configuration of a topic.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::GetTopicRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::Topic > | the result of the RPC. The response message type (google.pubsub.v1.Topic) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListTopics(std::string const &, Options)
Lists matching topics.
Parameters | |
---|---|
Name | Description |
project |
std::string const &
Required. The name of the project in which to list topics. Format is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::pubsub::v1::Topic > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTopics(google::pubsub::v1::ListTopicsRequest, Options)
Lists matching topics.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::ListTopicsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::pubsub::v1::Topic > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTopicSubscriptions(std::string const &, Options)
Lists the names of the attached subscriptions on this topic.
Parameters | |
---|---|
Name | Description |
topic |
std::string const &
Required. The name of the topic that subscriptions are attached to. Format is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::string > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTopicSubscriptions(google::pubsub::v1::ListTopicSubscriptionsRequest, Options)
Lists the names of the attached subscriptions on this topic.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::ListTopicSubscriptionsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::string > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTopicSnapshots(std::string const &, Options)
Lists the names of the snapshots on this topic.
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.
Parameters | |
---|---|
Name | Description |
topic |
std::string const &
Required. The name of the topic that snapshots are attached to. Format is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::string > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTopicSnapshots(google::pubsub::v1::ListTopicSnapshotsRequest, Options)
Lists the names of the snapshots on this topic.
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.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::ListTopicSnapshotsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< std::string > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
DeleteTopic(std::string const &, Options)
Deletes the topic with the given name.
Returns NOT_FOUND
if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their topic
field is set to _deleted-topic_
.
Parameters | |
---|---|
Name | Description |
topic |
std::string const &
Required. Name of the topic to delete. Format is |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
DeleteTopic(google::pubsub::v1::DeleteTopicRequest const &, Options)
Deletes the topic with the given name.
Returns NOT_FOUND
if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their topic
field is set to _deleted-topic_
.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::DeleteTopicRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
DetachSubscription(google::pubsub::v1::DetachSubscriptionRequest const &, Options)
Detaches a subscription from this topic.
All messages retained in the subscription are dropped. Subsequent Pull
and StreamingPull
requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.
Parameters | |
---|---|
Name | Description |
request |
google::pubsub::v1::DetachSubscriptionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::pubsub::v1::DetachSubscriptionResponse > | the result of the RPC. The response message type (google.pubsub.v1.DetachSubscriptionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |