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

Create a Cloud Pub/Sub subscription configuration. More...

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

Public Member Functions

 SubscriptionBuilder ()=default
 
google::pubsub::v1::UpdateSubscriptionRequest BuildUpdateRequest (Subscription const &subscription) &&
 Build a protocol buffer message to update an existing subscription. More...
 
google::pubsub::v1::Subscription BuildCreateRequest (Topic const &topic, Subscription const &subscription) &&
 Build a protocol buffer message to create a new subscription. More...
 
Setters for each protocol buffer field.
SubscriptionBuilderset_push_config (PushConfigBuilder v) &
 
SubscriptionBuilder && set_push_config (PushConfigBuilder v) &&
 
SubscriptionBuilderset_bigquery_config (BigQueryConfigBuilder v) &
 
SubscriptionBuilder && set_bigquery_config (BigQueryConfigBuilder v) &&
 
SubscriptionBuilderset_ack_deadline (std::chrono::seconds v) &
 
SubscriptionBuilder && set_ack_deadline (std::chrono::seconds v) &&
 
SubscriptionBuilderset_retain_acked_messages (bool v) &
 
SubscriptionBuilder && set_retain_acked_messages (bool v) &&
 
template<typename Rep , typename Period >
SubscriptionBuilderset_message_retention_duration (std::chrono::duration< Rep, Period > d) &
 
template<typename Rep , typename Period >
SubscriptionBuilder && set_message_retention_duration (std::chrono::duration< Rep, Period > d) &&
 
SubscriptionBuilderadd_label (std::string const &key, std::string const &value) &
 
SubscriptionBuilder && add_label (std::string const &key, std::string const &value) &&
 
SubscriptionBuilderset_labels (std::vector< std::pair< std::string, std::string >> new_labels) &
 
SubscriptionBuilder && set_labels (std::vector< std::pair< std::string, std::string >> new_labels) &&
 
SubscriptionBuilderclear_labels () &
 
SubscriptionBuilder && clear_labels () &&
 
SubscriptionBuilderenable_message_ordering (bool v) &
 
SubscriptionBuilder && enable_message_ordering (bool v) &&
 
SubscriptionBuilderset_expiration_policy (google::pubsub::v1::ExpirationPolicy v) &
 
SubscriptionBuilder && set_expiration_policy (google::pubsub::v1::ExpirationPolicy v) &&
 
SubscriptionBuilderset_filter (std::string v) &
 
SubscriptionBuilder && set_filter (std::string v) &&
 
SubscriptionBuilderset_dead_letter_policy (google::pubsub::v1::DeadLetterPolicy v) &
 
SubscriptionBuilder && set_dead_letter_policy (google::pubsub::v1::DeadLetterPolicy v) &&
 
SubscriptionBuilderclear_dead_letter_policy () &
 
SubscriptionBuilder && clear_dead_letter_policy () &&
 
SubscriptionBuilderset_retry_policy (google::pubsub::v1::RetryPolicy v) &
 
SubscriptionBuilder && set_retry_policy (google::pubsub::v1::RetryPolicy v) &&
 
SubscriptionBuilderclear_retry_policy () &
 
SubscriptionBuilder && clear_retry_policy () &&
 
SubscriptionBuilderenable_exactly_once_delivery (bool v) &
 
SubscriptionBuilder && enable_exactly_once_delivery (bool v) &&
 

Static Public Member Functions

template<typename Rep , typename Period >
static google::pubsub::v1::ExpirationPolicy MakeExpirationPolicy (std::chrono::duration< Rep, Period > d)
 Construct a google::pubsub::v1::ExpirationPolicy using a C++ duration. More...
 
static google::pubsub::v1::DeadLetterPolicy MakeDeadLetterPolicy (Topic const &dead_letter_topic, std::int32_t max_delivery_attempts=0)
 Construct a google::pubsub::v1::DeadLetterPolicy. More...
 
template<typename Rep1 , typename Period1 , typename Rep2 , typename Period2 >
static google::pubsub::v1::RetryPolicy MakeRetryPolicy (std::chrono::duration< Rep1, Period1 > minimum_backoff, std::chrono::duration< Rep2, Period2 > maximum_backoff)
 Construct a google::pubsub::v1::RetryPolicy using C++ durations. More...
 

Detailed Description

Create a Cloud Pub/Sub subscription configuration.

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

Definition at line 213 of file subscription_builder.h.

Constructor & Destructor Documentation

◆ SubscriptionBuilder()

google::cloud::pubsub::SubscriptionBuilder::SubscriptionBuilder ( )
default

Member Function Documentation

◆ add_label() [1/2]

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

Definition at line 269 of file subscription_builder.h.

◆ add_label() [2/2]

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

Definition at line 277 of file subscription_builder.h.

◆ BuildCreateRequest()

google::pubsub::v1::Subscription google::cloud::pubsub::SubscriptionBuilder::BuildCreateRequest ( Topic const &  topic,
Subscription const &  subscription 
) &&

Build a protocol buffer message to create a new subscription.

◆ BuildUpdateRequest()

google::pubsub::v1::UpdateSubscriptionRequest google::cloud::pubsub::SubscriptionBuilder::BuildUpdateRequest ( Subscription const &  subscription) &&

Build a protocol buffer message to update an existing subscription.

◆ clear_dead_letter_policy() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::clear_dead_letter_policy ( ) &
inline

Definition at line 344 of file subscription_builder.h.

◆ clear_dead_letter_policy() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::clear_dead_letter_policy ( ) &&
inline

Definition at line 349 of file subscription_builder.h.

◆ clear_labels() [1/2]

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

Definition at line 297 of file subscription_builder.h.

◆ clear_labels() [2/2]

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

Definition at line 302 of file subscription_builder.h.

◆ clear_retry_policy() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::clear_retry_policy ( ) &
inline

Definition at line 362 of file subscription_builder.h.

◆ clear_retry_policy() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::clear_retry_policy ( ) &&
inline

Definition at line 367 of file subscription_builder.h.

◆ enable_exactly_once_delivery() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::enable_exactly_once_delivery ( bool  v) &
inline

Definition at line 371 of file subscription_builder.h.

◆ enable_exactly_once_delivery() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::enable_exactly_once_delivery ( bool  v) &&
inline

Definition at line 376 of file subscription_builder.h.

◆ enable_message_ordering() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::enable_message_ordering ( bool  v) &
inline

Definition at line 304 of file subscription_builder.h.

◆ enable_message_ordering() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::enable_message_ordering ( bool  v) &&
inline

Definition at line 309 of file subscription_builder.h.

◆ MakeDeadLetterPolicy()

static google::pubsub::v1::DeadLetterPolicy google::cloud::pubsub::SubscriptionBuilder::MakeDeadLetterPolicy ( Topic const &  dead_letter_topic,
std::int32_t  max_delivery_attempts = 0 
)
inlinestatic

Construct a google::pubsub::v1::DeadLetterPolicy.

This is a convenience function to create the set_dead_letter_policy() argument.

Definition at line 402 of file subscription_builder.h.

◆ MakeExpirationPolicy()

template<typename Rep , typename Period >
static google::pubsub::v1::ExpirationPolicy google::cloud::pubsub::SubscriptionBuilder::MakeExpirationPolicy ( std::chrono::duration< Rep, Period >  d)
inlinestatic

Construct a google::pubsub::v1::ExpirationPolicy using a C++ duration.

This is a convenience function to create the set_expiration_policy() argument.

Definition at line 388 of file subscription_builder.h.

◆ MakeRetryPolicy()

template<typename Rep1 , typename Period1 , typename Rep2 , typename Period2 >
static google::pubsub::v1::RetryPolicy google::cloud::pubsub::SubscriptionBuilder::MakeRetryPolicy ( std::chrono::duration< Rep1, Period1 >  minimum_backoff,
std::chrono::duration< Rep2, Period2 >  maximum_backoff 
)
inlinestatic

Construct a google::pubsub::v1::RetryPolicy using C++ durations.

This is a convenience function to create the set_retry_policy() argument.

Definition at line 417 of file subscription_builder.h.

◆ set_ack_deadline() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_ack_deadline ( std::chrono::seconds  v) &
inline

Definition at line 237 of file subscription_builder.h.

◆ set_ack_deadline() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_ack_deadline ( std::chrono::seconds  v) &&
inline

Definition at line 242 of file subscription_builder.h.

◆ set_bigquery_config() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_bigquery_config ( BigQueryConfigBuilder  v) &

◆ set_bigquery_config() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_bigquery_config ( BigQueryConfigBuilder  v) &&
inline

Definition at line 233 of file subscription_builder.h.

◆ set_dead_letter_policy() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_dead_letter_policy ( google::pubsub::v1::DeadLetterPolicy  v) &
inline

Definition at line 333 of file subscription_builder.h.

◆ set_dead_letter_policy() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_dead_letter_policy ( google::pubsub::v1::DeadLetterPolicy  v) &&
inline

Definition at line 339 of file subscription_builder.h.

◆ set_expiration_policy() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_expiration_policy ( google::pubsub::v1::ExpirationPolicy  v) &
inline

Definition at line 313 of file subscription_builder.h.

◆ set_expiration_policy() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_expiration_policy ( google::pubsub::v1::ExpirationPolicy  v) &&
inline

Definition at line 319 of file subscription_builder.h.

◆ set_filter() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_filter ( std::string  v) &
inline

Definition at line 324 of file subscription_builder.h.

◆ set_filter() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_filter ( std::string  v) &&
inline

Definition at line 329 of file subscription_builder.h.

◆ set_labels() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_labels ( std::vector< std::pair< std::string, std::string >>  new_labels) &
inline

Definition at line 282 of file subscription_builder.h.

◆ set_labels() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_labels ( std::vector< std::pair< std::string, std::string >>  new_labels) &&
inline

Definition at line 292 of file subscription_builder.h.

◆ set_message_retention_duration() [1/2]

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

Definition at line 256 of file subscription_builder.h.

◆ set_message_retention_duration() [2/2]

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

Definition at line 264 of file subscription_builder.h.

◆ set_push_config() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_push_config ( PushConfigBuilder  v) &

◆ set_push_config() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_push_config ( PushConfigBuilder  v) &&
inline

Definition at line 228 of file subscription_builder.h.

◆ set_retain_acked_messages() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_retain_acked_messages ( bool  v) &
inline

Definition at line 246 of file subscription_builder.h.

◆ set_retain_acked_messages() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_retain_acked_messages ( bool  v) &&
inline

Definition at line 251 of file subscription_builder.h.

◆ set_retry_policy() [1/2]

SubscriptionBuilder& google::cloud::pubsub::SubscriptionBuilder::set_retry_policy ( google::pubsub::v1::RetryPolicy  v) &
inline

Definition at line 353 of file subscription_builder.h.

◆ set_retry_policy() [2/2]

SubscriptionBuilder&& google::cloud::pubsub::SubscriptionBuilder::set_retry_policy ( google::pubsub::v1::RetryPolicy  v) &&
inline

Definition at line 358 of file subscription_builder.h.