Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
subscription_builder.h
1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIPTION_BUILDER_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIPTION_BUILDER_H
17
18#include "google/cloud/pubsub/subscription.h"
19#include "google/cloud/pubsub/topic.h"
20#include "google/cloud/pubsub/version.h"
21#include "google/cloud/internal/time_utils.h"
22#include <google/protobuf/util/field_mask_util.h>
23#include <google/pubsub/v1/pubsub.pb.h>
24#include <chrono>
25#include <set>
26#include <string>
27#include <vector>
28
29namespace google {
30namespace cloud {
31namespace pubsub {
32GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35/**
36 * Helper class to create google::pubsub::v1::PushConfig protos.
37 *
38 * Makes it easier to create the protobuf messages consumed by
39 * `SubscriptionAdminClient`. The main advantages are:
40 *
41 * - Use a fluent API to set multiple values when constructing complex objects.
42 * - Automatically compute the set of paths for update requests.
43 */
45 public:
46 PushConfigBuilder() = default;
47 explicit PushConfigBuilder(std::string push_endpoint) {
48 set_push_endpoint(std::move(push_endpoint));
49 }
50
51 /// Build a protocol buffer message to update an existing push config.
52 google::pubsub::v1::ModifyPushConfigRequest BuildModifyPushConfig(
53 Subscription const& subscription) &&;
54
55 /// @name Setters for each protocol buffer field.
56 ///@{
57 PushConfigBuilder& set_push_endpoint(std::string v) & {
58 proto_.set_push_endpoint(std::move(v));
59 paths_.insert("push_endpoint");
60 return *this;
61 }
62 PushConfigBuilder&& set_push_endpoint(std::string v) && {
63 return std::move(set_push_endpoint(std::move(v)));
64 }
65
66 PushConfigBuilder& add_attribute(std::string const& key,
67 std::string const& value) & {
68 proto_.mutable_attributes()->insert(
69 google::protobuf::Map<std::string, std::string>::value_type(key,
70 value));
71 paths_.insert("attributes");
72 return *this;
73 }
74 PushConfigBuilder&& add_attribute(std::string const& key,
75 std::string const& value) && {
76 return std::move(add_attribute(key, value));
77 }
78
80 std::vector<std::pair<std::string, std::string>> attr) & {
81 google::protobuf::Map<std::string, std::string> attributes;
82 for (auto& kv : attr) {
83 attributes[kv.first] = std::move(kv.second);
84 }
85 proto_.mutable_attributes()->swap(attributes);
86 paths_.insert("attributes");
87 return *this;
88 }
90 std::vector<std::pair<std::string, std::string>> attr) && {
91 return std::move(set_attributes(std::move(attr)));
92 }
93
95 proto_.mutable_attributes()->clear();
96 paths_.insert("attributes");
97 return *this;
98 }
100 return std::move(clear_attributes());
101 }
102
103 static google::pubsub::v1::PushConfig::OidcToken MakeOidcToken(
104 std::string service_account_email) {
105 google::pubsub::v1::PushConfig::OidcToken proto;
106 proto.set_service_account_email(std::move(service_account_email));
107 return proto;
108 }
109
110 static google::pubsub::v1::PushConfig::OidcToken MakeOidcToken(
111 std::string service_account_email, std::string audience) {
112 google::pubsub::v1::PushConfig::OidcToken proto;
113 proto.set_service_account_email(std::move(service_account_email));
114 proto.set_audience(std::move(audience));
115 return proto;
116 }
117
119 google::pubsub::v1::PushConfig::OidcToken token) & {
120 *proto_.mutable_oidc_token() = std::move(token);
121 paths_.insert("oidc_token");
122 return *this;
123 }
125 google::pubsub::v1::PushConfig::OidcToken token) && {
126 return std::move(set_authentication(std::move(token)));
127 }
128 ///@}
129
130 private:
131 friend class SubscriptionBuilder;
132 google::pubsub::v1::PushConfig proto_;
133 std::set<std::string> paths_;
134};
135
136/**
137 * A helper class to build `google::pubsub::v1::BigQueryConfig` protos.
138 *
139 * Makes it easier to create the protobuf messages consumed by
140 * `SubscriptionAdminClient`. The main advantages are:
141 *
142 * - Use a fluent API to set multiple values when constructing complex objects.
143 * - Automatically compute the set of paths for update requests.
144 */
146 public:
147 BigQueryConfigBuilder() = default;
148
149 /// @name Setters for each protocol buffer field.
150 ///@{
151 BigQueryConfigBuilder& set_table(std::string full_path) & {
152 *proto_.mutable_table() = std::move(full_path);
153 paths_.insert("table");
154 return *this;
155 }
156 BigQueryConfigBuilder&& set_table(std::string full_path) && {
157 return std::move(set_table(std::move(full_path)));
158 }
159 BigQueryConfigBuilder& set_table(std::string const& project_id,
160 std::string const& data_set_id,
161 std::string const& table_id) & {
162 return set_table(project_id + ':' + data_set_id + '.' + table_id);
163 }
164 BigQueryConfigBuilder&& set_table(std::string const& project_id,
165 std::string const& data_set_id,
166 std::string const& table_id) && {
167 return std::move(set_table(project_id, data_set_id, table_id));
168 }
169
171 proto_.set_use_topic_schema(v);
172 paths_.insert("use_topic_schema");
173 return *this;
174 }
176 return std::move(set_use_topic_schema(v));
177 }
178
180 proto_.set_write_metadata(v);
181 paths_.insert("write_metadata");
182 return *this;
183 }
185 return std::move(set_write_metadata(v));
186 }
187
189 proto_.set_drop_unknown_fields(v);
190 paths_.insert("drop_unknown_fields");
191 return *this;
192 }
194 return std::move(set_drop_unknown_fields(v));
195 }
196 ///@}
197
198 private:
199 friend class SubscriptionBuilder;
200 google::pubsub::v1::BigQueryConfig proto_;
201 std::set<std::string> paths_;
202};
203
204/**
205 * A helper class to build `google::pubsub::v1::CloudStorageConfig` protos.
206 *
207 * Makes it easier to create the protobuf messages consumed by
208 * `SubscriptionAdminClient`. The main advantages are:
209 *
210 * - Use a fluent API to set multiple values when constructing complex objects.
211 * - Automatically compute the set of paths for update requests.
212 */
214 public:
215 CloudStorageConfigBuilder() = default;
216
217 /// @name Setters for each protocol buffer field.
218 ///@{
219 CloudStorageConfigBuilder& set_bucket(std::string bucket) & {
220 *proto_.mutable_bucket() = std::move(bucket);
221 paths_.insert("bucket");
222 return *this;
223 }
224 CloudStorageConfigBuilder&& set_bucket(std::string bucket) && {
225 return std::move(set_bucket(std::move(bucket)));
226 }
227
229 std::string filename_prefix) & {
230 *proto_.mutable_filename_prefix() = std::move(filename_prefix);
231 paths_.insert("filename_prefix");
232 return *this;
233 }
235 std::string filename_prefix) && {
236 return std::move(set_filename_prefix(std::move(filename_prefix)));
237 }
238
240 std::string filename_suffix) & {
241 *proto_.mutable_filename_suffix() = std::move(filename_suffix);
242 paths_.insert("filename_suffix");
243 return *this;
244 }
246 std::string filename_suffix) && {
247 return std::move(set_filename_suffix(std::move(filename_suffix)));
248 }
249
250 static google::pubsub::v1::CloudStorageConfig::AvroConfig MakeAvroConfig(
251 bool write_metadata) {
252 google::pubsub::v1::CloudStorageConfig::AvroConfig proto;
253 proto.set_write_metadata(write_metadata);
254 return proto;
255 }
256
258 google::pubsub::v1::CloudStorageConfig::AvroConfig avro_config) & {
259 *proto_.mutable_avro_config() = std::move(avro_config);
260 paths_.insert("avro_config");
261 return *this;
262 }
264 google::pubsub::v1::CloudStorageConfig::AvroConfig avro_config) && {
265 return std::move(set_avro_config(std::move(avro_config)));
266 }
267
268 template <typename Rep, typename Period>
270 std::chrono::duration<Rep, Period> d) & {
271 *proto_.mutable_max_duration() =
272 google::cloud::internal::ToDurationProto(d);
273 paths_.insert("max_duration");
274 return *this;
275 }
276 template <typename Rep, typename Period>
278 std::chrono::duration<Rep, Period> d) && {
279 return std::move(set_max_duration(d));
280 }
282 google::protobuf::Duration const& d) & {
283 *proto_.mutable_max_duration() = d;
284 paths_.insert("max_duration");
285 return *this;
286 }
288 google::protobuf::Duration const& d) && {
289 return std::move(set_max_duration(d));
290 }
291
293 proto_.set_max_bytes(v);
294 paths_.insert("max_bytes");
295 return *this;
296 }
298 return std::move(set_max_bytes(v));
299 }
300 ///@}
301
302 private:
303 friend class SubscriptionBuilder;
304 google::pubsub::v1::CloudStorageConfig proto_;
305 std::set<std::string> paths_;
306};
307
308/**
309 * Create a Cloud Pub/Sub subscription configuration.
310 *
311 * Makes it easier to create the protobuf messages consumed by
312 * `SubscriptionAdminClient`. The main advantages are:
313 *
314 * - Use a fluent API to set multiple values when constructing complex objects.
315 * - Automatically compute the set of paths for update requests.
316 */
318 public:
319 SubscriptionBuilder() = default;
320
321 /// Build a protocol buffer message to update an existing subscription.
322 google::pubsub::v1::UpdateSubscriptionRequest BuildUpdateRequest(
323 Subscription const& subscription) &&;
324
325 /// Build a protocol buffer message to create a new subscription.
326 google::pubsub::v1::Subscription BuildCreateRequest(
327 Topic const& topic, Subscription const& subscription) &&;
328
329 /// @name Setters for each protocol buffer field.
330 ///@{
333 return std::move(set_push_config(std::move(v)));
334 }
335
338 return std::move(set_bigquery_config(std::move(v)));
339 }
340
344 return std::move(set_cloud_storage_config(std::move(v)));
345 }
346
347 SubscriptionBuilder& set_ack_deadline(std::chrono::seconds v) & {
348 proto_.set_ack_deadline_seconds(static_cast<std::int32_t>(v.count()));
349 paths_.insert("ack_deadline_seconds");
350 return *this;
351 }
352 SubscriptionBuilder&& set_ack_deadline(std::chrono::seconds v) && {
353 return std::move(set_ack_deadline(v));
354 }
355
357 proto_.set_retain_acked_messages(v);
358 paths_.insert("retain_acked_messages");
359 return *this;
360 }
362 return std::move(set_retain_acked_messages(v));
363 }
364
365 template <typename Rep, typename Period>
367 std::chrono::duration<Rep, Period> d) & {
368 *proto_.mutable_message_retention_duration() =
369 google::cloud::internal::ToDurationProto(std::move(d));
370 paths_.insert("message_retention_duration");
371 return *this;
372 }
373 template <typename Rep, typename Period>
375 std::chrono::duration<Rep, Period> d) && {
376 return std::move(set_message_retention_duration(d));
377 }
378
379 SubscriptionBuilder& add_label(std::string const& key,
380 std::string const& value) & {
381 using value_type =
382 google::protobuf::Map<std::string, std::string>::value_type;
383 proto_.mutable_labels()->insert(value_type(key, value));
384 paths_.insert("labels");
385 return *this;
386 }
387 SubscriptionBuilder&& add_label(std::string const& key,
388 std::string const& value) && {
389 return std::move(add_label(key, value));
390 }
391
393 std::vector<std::pair<std::string, std::string>> new_labels) & {
394 google::protobuf::Map<std::string, std::string> labels;
395 for (auto& kv : new_labels) {
396 labels[kv.first] = std::move(kv.second);
397 }
398 proto_.mutable_labels()->swap(labels);
399 paths_.insert("labels");
400 return *this;
401 }
403 std::vector<std::pair<std::string, std::string>> new_labels) && {
404 return std::move(set_labels(std::move(new_labels)));
405 }
406
408 proto_.clear_labels();
409 paths_.insert("labels");
410 return *this;
411 }
412 SubscriptionBuilder&& clear_labels() && { return std::move(clear_labels()); }
413
415 proto_.set_enable_message_ordering(v);
416 paths_.insert("enable_message_ordering");
417 return *this;
418 }
420 return std::move(enable_message_ordering(v));
421 }
422
424 google::pubsub::v1::ExpirationPolicy v) & {
425 *proto_.mutable_expiration_policy() = std::move(v);
426 paths_.insert("expiration_policy");
427 return *this;
428 }
430 google::pubsub::v1::ExpirationPolicy v) && {
431 return std::move(set_expiration_policy(std::move(v)));
432 }
433
434 SubscriptionBuilder& set_filter(std::string v) & {
435 proto_.set_filter(std::move(v));
436 paths_.insert("filter");
437 return *this;
438 }
439 SubscriptionBuilder&& set_filter(std::string v) && {
440 return std::move(set_filter(std::move(v)));
441 }
442
444 google::pubsub::v1::DeadLetterPolicy v) & {
445 *proto_.mutable_dead_letter_policy() = std::move(v);
446 paths_.insert("dead_letter_policy");
447 return *this;
448 }
450 google::pubsub::v1::DeadLetterPolicy v) && {
451 return std::move(set_dead_letter_policy(std::move(v)));
452 }
453
455 proto_.clear_dead_letter_policy();
456 paths_.insert("dead_letter_policy");
457 return *this;
458 }
460 return std::move(clear_dead_letter_policy());
461 }
462
463 SubscriptionBuilder& set_retry_policy(google::pubsub::v1::RetryPolicy v) & {
464 *proto_.mutable_retry_policy() = std::move(v);
465 paths_.insert("retry_policy");
466 return *this;
467 }
468 SubscriptionBuilder&& set_retry_policy(google::pubsub::v1::RetryPolicy v) && {
469 return std::move(set_retry_policy(std::move(v)));
470 }
471
473 proto_.clear_retry_policy();
474 paths_.insert("retry_policy");
475 return *this;
476 }
478 return std::move(clear_retry_policy());
479 }
480
482 proto_.set_enable_exactly_once_delivery(v);
483 paths_.insert("enable_exactly_once_delivery");
484 return *this;
485 }
487 return std::move(enable_exactly_once_delivery(v));
488 }
489 ///@}
490
491 /**
492 * Construct a `google::pubsub::v1::ExpirationPolicy` using a C++ duration.
493 *
494 * This is a convenience function to create the `set_expiration_policy()`
495 * argument.
496 */
497 template <typename Rep, typename Period>
498 static google::pubsub::v1::ExpirationPolicy MakeExpirationPolicy(
499 std::chrono::duration<Rep, Period> d) {
500 google::pubsub::v1::ExpirationPolicy result;
501 *result.mutable_ttl() =
502 google::cloud::internal::ToDurationProto(std::move(d));
503 return result;
504 }
505
506 /**
507 * Construct a `google::pubsub::v1::DeadLetterPolicy`.
508 *
509 * This is a convenience function to create the `set_dead_letter_policy()`
510 * argument.
511 */
512 static google::pubsub::v1::DeadLetterPolicy MakeDeadLetterPolicy(
513 Topic const& dead_letter_topic, std::int32_t max_delivery_attempts = 0) {
514 google::pubsub::v1::DeadLetterPolicy result;
515 result.set_dead_letter_topic(dead_letter_topic.FullName());
516 result.set_max_delivery_attempts(max_delivery_attempts);
517 return result;
518 }
519
520 /**
521 * Construct a `google::pubsub::v1::RetryPolicy` using C++ durations.
522 *
523 * This is a convenience function to create the `set_retry_policy()`
524 * argument.
525 */
526 template <typename Rep1, typename Period1, typename Rep2, typename Period2>
527 static google::pubsub::v1::RetryPolicy MakeRetryPolicy(
528 std::chrono::duration<Rep1, Period1> minimum_backoff,
529 std::chrono::duration<Rep2, Period2> maximum_backoff) {
530 google::pubsub::v1::RetryPolicy result;
531 *result.mutable_minimum_backoff() =
532 google::cloud::internal::ToDurationProto(minimum_backoff);
533 *result.mutable_maximum_backoff() =
534 google::cloud::internal::ToDurationProto(maximum_backoff);
535 return result;
536 }
537
538 private:
539 google::pubsub::v1::Subscription proto_;
540 std::set<std::string> paths_;
541};
542
543GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
544} // namespace pubsub
545} // namespace cloud
546} // namespace google
547
548#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIPTION_BUILDER_H
A helper class to build google::pubsub::v1::BigQueryConfig protos.
Definition: subscription_builder.h:145
BigQueryConfigBuilder & set_drop_unknown_fields(bool v) &
Definition: subscription_builder.h:188
BigQueryConfigBuilder & set_table(std::string full_path) &
Definition: subscription_builder.h:151
BigQueryConfigBuilder && set_use_topic_schema(bool v) &&
Definition: subscription_builder.h:175
BigQueryConfigBuilder && set_write_metadata(bool v) &&
Definition: subscription_builder.h:184
BigQueryConfigBuilder && set_table(std::string full_path) &&
Definition: subscription_builder.h:156
BigQueryConfigBuilder & set_use_topic_schema(bool v) &
Definition: subscription_builder.h:170
BigQueryConfigBuilder & set_write_metadata(bool v) &
Definition: subscription_builder.h:179
BigQueryConfigBuilder & set_table(std::string const &project_id, std::string const &data_set_id, std::string const &table_id) &
Definition: subscription_builder.h:159
BigQueryConfigBuilder && set_drop_unknown_fields(bool v) &&
Definition: subscription_builder.h:193
BigQueryConfigBuilder && set_table(std::string const &project_id, std::string const &data_set_id, std::string const &table_id) &&
Definition: subscription_builder.h:164
A helper class to build google::pubsub::v1::CloudStorageConfig protos.
Definition: subscription_builder.h:213
CloudStorageConfigBuilder & set_max_duration(std::chrono::duration< Rep, Period > d) &
Definition: subscription_builder.h:269
CloudStorageConfigBuilder && set_avro_config(google::pubsub::v1::CloudStorageConfig::AvroConfig avro_config) &&
Definition: subscription_builder.h:263
CloudStorageConfigBuilder && set_max_duration(google::protobuf::Duration const &d) &&
Definition: subscription_builder.h:287
CloudStorageConfigBuilder & set_avro_config(google::pubsub::v1::CloudStorageConfig::AvroConfig avro_config) &
Definition: subscription_builder.h:257
CloudStorageConfigBuilder && set_max_duration(std::chrono::duration< Rep, Period > d) &&
Definition: subscription_builder.h:277
CloudStorageConfigBuilder && set_bucket(std::string bucket) &&
Definition: subscription_builder.h:224
CloudStorageConfigBuilder & set_max_bytes(int v) &
Definition: subscription_builder.h:292
static google::pubsub::v1::CloudStorageConfig::AvroConfig MakeAvroConfig(bool write_metadata)
Definition: subscription_builder.h:250
CloudStorageConfigBuilder && set_filename_prefix(std::string filename_prefix) &&
Definition: subscription_builder.h:234
CloudStorageConfigBuilder & set_max_duration(google::protobuf::Duration const &d) &
Definition: subscription_builder.h:281
CloudStorageConfigBuilder & set_filename_prefix(std::string filename_prefix) &
Definition: subscription_builder.h:228
CloudStorageConfigBuilder & set_bucket(std::string bucket) &
Definition: subscription_builder.h:219
CloudStorageConfigBuilder && set_filename_suffix(std::string filename_suffix) &&
Definition: subscription_builder.h:245
CloudStorageConfigBuilder && set_max_bytes(int v) &&
Definition: subscription_builder.h:297
CloudStorageConfigBuilder & set_filename_suffix(std::string filename_suffix) &
Definition: subscription_builder.h:239
Helper class to create google::pubsub::v1::PushConfig protos.
Definition: subscription_builder.h:44
PushConfigBuilder && clear_attributes() &&
Definition: subscription_builder.h:99
static google::pubsub::v1::PushConfig::OidcToken MakeOidcToken(std::string service_account_email)
Definition: subscription_builder.h:103
PushConfigBuilder & clear_attributes() &
Definition: subscription_builder.h:94
google::pubsub::v1::ModifyPushConfigRequest BuildModifyPushConfig(Subscription const &subscription) &&
Build a protocol buffer message to update an existing push config.
PushConfigBuilder & set_attributes(std::vector< std::pair< std::string, std::string > > attr) &
Definition: subscription_builder.h:79
PushConfigBuilder & add_attribute(std::string const &key, std::string const &value) &
Definition: subscription_builder.h:66
PushConfigBuilder && set_push_endpoint(std::string v) &&
Definition: subscription_builder.h:62
PushConfigBuilder & set_authentication(google::pubsub::v1::PushConfig::OidcToken token) &
Definition: subscription_builder.h:118
PushConfigBuilder & set_push_endpoint(std::string v) &
Definition: subscription_builder.h:57
static google::pubsub::v1::PushConfig::OidcToken MakeOidcToken(std::string service_account_email, std::string audience)
Definition: subscription_builder.h:110
PushConfigBuilder && set_authentication(google::pubsub::v1::PushConfig::OidcToken token) &&
Definition: subscription_builder.h:124
PushConfigBuilder && add_attribute(std::string const &key, std::string const &value) &&
Definition: subscription_builder.h:74
PushConfigBuilder(std::string push_endpoint)
Definition: subscription_builder.h:47
PushConfigBuilder && set_attributes(std::vector< std::pair< std::string, std::string > > attr) &&
Definition: subscription_builder.h:89
Create a Cloud Pub/Sub subscription configuration.
Definition: subscription_builder.h:317
static google::pubsub::v1::DeadLetterPolicy MakeDeadLetterPolicy(Topic const &dead_letter_topic, std::int32_t max_delivery_attempts=0)
Construct a google::pubsub::v1::DeadLetterPolicy.
Definition: subscription_builder.h:512
SubscriptionBuilder & enable_exactly_once_delivery(bool v) &
Definition: subscription_builder.h:481
SubscriptionBuilder && set_dead_letter_policy(google::pubsub::v1::DeadLetterPolicy v) &&
Definition: subscription_builder.h:449
static google::pubsub::v1::ExpirationPolicy MakeExpirationPolicy(std::chrono::duration< Rep, Period > d)
Construct a google::pubsub::v1::ExpirationPolicy using a C++ duration.
Definition: subscription_builder.h:498
SubscriptionBuilder && clear_labels() &&
Definition: subscription_builder.h:412
SubscriptionBuilder && set_retry_policy(google::pubsub::v1::RetryPolicy v) &&
Definition: subscription_builder.h:468
SubscriptionBuilder && set_retain_acked_messages(bool v) &&
Definition: subscription_builder.h:361
SubscriptionBuilder && clear_retry_policy() &&
Definition: subscription_builder.h:477
google::pubsub::v1::Subscription BuildCreateRequest(Topic const &topic, Subscription const &subscription) &&
Build a protocol buffer message to create a new subscription.
SubscriptionBuilder & set_retry_policy(google::pubsub::v1::RetryPolicy v) &
Definition: subscription_builder.h:463
SubscriptionBuilder && set_bigquery_config(BigQueryConfigBuilder v) &&
Definition: subscription_builder.h:337
SubscriptionBuilder && set_push_config(PushConfigBuilder v) &&
Definition: subscription_builder.h:332
SubscriptionBuilder & clear_dead_letter_policy() &
Definition: subscription_builder.h:454
SubscriptionBuilder & clear_retry_policy() &
Definition: subscription_builder.h:472
SubscriptionBuilder & add_label(std::string const &key, std::string const &value) &
Definition: subscription_builder.h:379
SubscriptionBuilder & clear_labels() &
Definition: subscription_builder.h:407
SubscriptionBuilder & set_labels(std::vector< std::pair< std::string, std::string > > new_labels) &
Definition: subscription_builder.h:392
SubscriptionBuilder && set_ack_deadline(std::chrono::seconds v) &&
Definition: subscription_builder.h:352
SubscriptionBuilder & set_push_config(PushConfigBuilder v) &
SubscriptionBuilder & set_expiration_policy(google::pubsub::v1::ExpirationPolicy v) &
Definition: subscription_builder.h:423
SubscriptionBuilder & set_dead_letter_policy(google::pubsub::v1::DeadLetterPolicy v) &
Definition: subscription_builder.h:443
SubscriptionBuilder && set_message_retention_duration(std::chrono::duration< Rep, Period > d) &&
Definition: subscription_builder.h:374
SubscriptionBuilder & set_retain_acked_messages(bool v) &
Definition: subscription_builder.h:356
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.
Definition: subscription_builder.h:527
SubscriptionBuilder && set_labels(std::vector< std::pair< std::string, std::string > > new_labels) &&
Definition: subscription_builder.h:402
SubscriptionBuilder && set_filter(std::string v) &&
Definition: subscription_builder.h:439
SubscriptionBuilder & set_filter(std::string v) &
Definition: subscription_builder.h:434
SubscriptionBuilder & set_bigquery_config(BigQueryConfigBuilder v) &
SubscriptionBuilder && set_expiration_policy(google::pubsub::v1::ExpirationPolicy v) &&
Definition: subscription_builder.h:429
SubscriptionBuilder & set_cloud_storage_config(CloudStorageConfigBuilder v) &
SubscriptionBuilder & set_ack_deadline(std::chrono::seconds v) &
Definition: subscription_builder.h:347
SubscriptionBuilder & enable_message_ordering(bool v) &
Definition: subscription_builder.h:414
SubscriptionBuilder && clear_dead_letter_policy() &&
Definition: subscription_builder.h:459
SubscriptionBuilder && enable_exactly_once_delivery(bool v) &&
Definition: subscription_builder.h:486
SubscriptionBuilder && add_label(std::string const &key, std::string const &value) &&
Definition: subscription_builder.h:387
SubscriptionBuilder & set_message_retention_duration(std::chrono::duration< Rep, Period > d) &
Definition: subscription_builder.h:366
SubscriptionBuilder && set_cloud_storage_config(CloudStorageConfigBuilder v) &&
Definition: subscription_builder.h:342
SubscriptionBuilder && enable_message_ordering(bool v) &&
Definition: subscription_builder.h:419
google::pubsub::v1::UpdateSubscriptionRequest BuildUpdateRequest(Subscription const &subscription) &&
Build a protocol buffer message to update an existing subscription.
Objects of this class identify a Cloud Pub/Sub subscription.
Definition: subscription.h:37
Objects of this class identify a Cloud Pub/Sub topic.
Definition: topic.h:37
std::string FullName() const
Returns the fully qualified topic name as a string of the form: "projects/<project-id>/topics/<topic-...
Contains all the Cloud Pub/Sub C++ client types and functions.
Definition: ack_handler.h:25
The namespace Google Cloud Platform C++ client libraries.