Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
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_cloud_storage_config (CloudStorageConfigBuilder v) &
 
SubscriptionBuilder && set_cloud_storage_config (CloudStorageConfigBuilder 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:

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

◆ add_label() [2/2]

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

◆ 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

◆ clear_dead_letter_policy() [2/2]

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

◆ clear_labels() [1/2]

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

◆ clear_labels() [2/2]

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

◆ clear_retry_policy() [1/2]

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

◆ clear_retry_policy() [2/2]

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

◆ enable_exactly_once_delivery() [1/2]

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

◆ enable_exactly_once_delivery() [2/2]

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

◆ enable_message_ordering() [1/2]

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

◆ enable_message_ordering() [2/2]

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

◆ 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.

◆ 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.

◆ 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.

◆ set_ack_deadline() [1/2]

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

◆ set_ack_deadline() [2/2]

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

◆ 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

◆ set_cloud_storage_config() [1/2]

SubscriptionBuilder & google::cloud::pubsub::SubscriptionBuilder::set_cloud_storage_config ( CloudStorageConfigBuilder  v) &

◆ set_cloud_storage_config() [2/2]

SubscriptionBuilder && google::cloud::pubsub::SubscriptionBuilder::set_cloud_storage_config ( CloudStorageConfigBuilder  v) &&
inline

◆ set_dead_letter_policy() [1/2]

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

◆ set_dead_letter_policy() [2/2]

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

◆ set_expiration_policy() [1/2]

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

◆ set_expiration_policy() [2/2]

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

◆ set_filter() [1/2]

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

◆ set_filter() [2/2]

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

◆ set_labels() [1/2]

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

◆ set_labels() [2/2]

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

◆ 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

◆ 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

◆ 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

◆ set_retain_acked_messages() [1/2]

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

◆ set_retain_acked_messages() [2/2]

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

◆ set_retry_policy() [1/2]

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

◆ set_retry_policy() [2/2]

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