Google Cloud Pub/Sub C++ Client  2.5.0
A C++ Client Library for Google Cloud Pub/Sub
Public Member Functions | List of all members
google::cloud::pubsub::TopicBuilder Class Reference

Builds requests to create or update a Cloud Pub/Sub topic. More...

#include <google/cloud/pubsub/topic_builder.h>

Public Member Functions

 TopicBuilder (Topic const &topic)
 
google::pubsub::v1::Topic BuildCreateRequest () &&
 Build a protocol buffer message to create a new topic. More...
 
google::pubsub::v1::UpdateTopicRequest BuildUpdateRequest () &&
 Build a protocol buffer message to update an existing topic. More...
 
Setters for each protocol buffer field.
TopicBuilderadd_label (std::string const &key, std::string const &value) &
 
TopicBuilder && add_label (std::string const &key, std::string const &value) &&
 
TopicBuilderclear_labels () &
 
TopicBuilder && clear_labels () &&
 
TopicBuilderadd_allowed_persistence_region (std::string region) &
 
TopicBuilder && add_allowed_persistence_region (std::string region) &&
 
TopicBuilderclear_allowed_persistence_regions () &
 
TopicBuilder && clear_allowed_persistence_regions () &&
 
TopicBuilderset_kms_key_name (std::string key_name) &
 
TopicBuilder && set_kms_key_name (std::string key_name) &&
 
TopicBuilderset_schema (pubsub::Schema const &schema) &
 
TopicBuilder && set_schema (pubsub::Schema const &schema) &&
 
TopicBuilderset_encoding (google::pubsub::v1::Encoding encoding) &
 
TopicBuilder && set_encoding (google::pubsub::v1::Encoding encoding) &&
 
template<typename Rep , typename Period >
TopicBuilderset_message_retention_duration (std::chrono::duration< Rep, Period > d) &
 
template<typename Rep , typename Period >
TopicBuilder && set_message_retention_duration (std::chrono::duration< Rep, Period > d) &&
 
TopicBuilderset_message_retention_duration (google::protobuf::Duration const &d) &
 
TopicBuilder && set_message_retention_duration (google::protobuf::Duration const &d) &&
 

Detailed Description

Builds requests to create or update a Cloud Pub/Sub topic.

Makes it easier to create the protobuf messages consumed by TopicAdminClient. The main advantages are:

Definition at line 40 of file topic_builder.h.

Constructor & Destructor Documentation

◆ TopicBuilder()

google::cloud::pubsub::TopicBuilder::TopicBuilder ( Topic const &  topic)
inlineexplicit

Definition at line 42 of file topic_builder.h.

Member Function Documentation

◆ add_allowed_persistence_region() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::add_allowed_persistence_region ( std::string  region) &
inline

Definition at line 73 of file topic_builder.h.

◆ add_allowed_persistence_region() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::add_allowed_persistence_region ( std::string  region) &&
inline

Definition at line 79 of file topic_builder.h.

◆ add_label() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::add_label ( std::string const &  key,
std::string const &  value 
) &
inline

Definition at line 54 of file topic_builder.h.

◆ add_label() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::add_label ( std::string const &  key,
std::string const &  value 
) &&
inline

Definition at line 61 of file topic_builder.h.

◆ BuildCreateRequest()

google::pubsub::v1::Topic google::cloud::pubsub::TopicBuilder::BuildCreateRequest ( ) &&

Build a protocol buffer message to create a new topic.

◆ BuildUpdateRequest()

google::pubsub::v1::UpdateTopicRequest google::cloud::pubsub::TopicBuilder::BuildUpdateRequest ( ) &&

Build a protocol buffer message to update an existing topic.

◆ clear_allowed_persistence_regions() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::clear_allowed_persistence_regions ( ) &
inline

Definition at line 83 of file topic_builder.h.

◆ clear_allowed_persistence_regions() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::clear_allowed_persistence_regions ( ) &&
inline

Definition at line 89 of file topic_builder.h.

◆ clear_labels() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::clear_labels ( ) &
inline

Definition at line 66 of file topic_builder.h.

◆ clear_labels() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::clear_labels ( ) &&
inline

Definition at line 71 of file topic_builder.h.

◆ set_encoding() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::set_encoding ( google::pubsub::v1::Encoding  encoding) &
inline

Definition at line 110 of file topic_builder.h.

◆ set_encoding() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::set_encoding ( google::pubsub::v1::Encoding  encoding) &&
inline

Definition at line 115 of file topic_builder.h.

◆ set_kms_key_name() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::set_kms_key_name ( std::string  key_name) &
inline

Definition at line 93 of file topic_builder.h.

◆ set_kms_key_name() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::set_kms_key_name ( std::string  key_name) &&
inline

Definition at line 98 of file topic_builder.h.

◆ set_message_retention_duration() [1/4]

TopicBuilder& google::cloud::pubsub::TopicBuilder::set_message_retention_duration ( google::protobuf::Duration const &  d) &
inline

Definition at line 132 of file topic_builder.h.

◆ set_message_retention_duration() [2/4]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::set_message_retention_duration ( google::protobuf::Duration const &  d) &&
inline

Definition at line 138 of file topic_builder.h.

◆ set_message_retention_duration() [3/4]

template<typename Rep , typename Period >
TopicBuilder& google::cloud::pubsub::TopicBuilder::set_message_retention_duration ( std::chrono::duration< Rep, Period >  d) &
inline

Definition at line 120 of file topic_builder.h.

◆ set_message_retention_duration() [4/4]

template<typename Rep , typename Period >
TopicBuilder&& google::cloud::pubsub::TopicBuilder::set_message_retention_duration ( std::chrono::duration< Rep, Period >  d) &&
inline

Definition at line 128 of file topic_builder.h.

◆ set_schema() [1/2]

TopicBuilder& google::cloud::pubsub::TopicBuilder::set_schema ( pubsub::Schema const &  schema) &
inline

Definition at line 102 of file topic_builder.h.

◆ set_schema() [2/2]

TopicBuilder&& google::cloud::pubsub::TopicBuilder::set_schema ( pubsub::Schema const &  schema) &&
inline

Definition at line 107 of file topic_builder.h.