-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPubSubSubscription.php
More file actions
969 lines (898 loc) · 43.5 KB
/
PubSubSubscription.php
File metadata and controls
969 lines (898 loc) · 43.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/bigquery/analyticshub/v1/pubsub.proto
namespace Google\Cloud\BigQuery\AnalyticsHub\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;
/**
* Defines the destination Pub/Sub subscription.
* If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
* `pubsub_export_config`, or `pubsublite_export_config`
* is set, then the subscriber will pull and ack messages using API methods. At
* most one of these fields may be set.
*
* Generated from protobuf message <code>google.cloud.bigquery.analyticshub.v1.PubSubSubscription</code>
*/
class PubSubSubscription extends \Google\Protobuf\Internal\Message
{
/**
* Required. Name of the subscription.
* Format is `projects/{project}/subscriptions/{sub}`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*/
protected $name = '';
/**
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $push_config = null;
/**
* Optional. If delivery to BigQuery is used with this subscription, this
* field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $bigquery_config = null;
/**
* Optional. If delivery to Google Cloud Storage is used with this
* subscription, this field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $cloud_storage_config = null;
/**
* Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
* waits for the subscriber to acknowledge receipt before resending the
* message. In the interval after the message is delivered and before it is
* acknowledged, it is considered to be _outstanding_. During that time
* period, the message will not be redelivered (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* non-streaming pull or send the `ack_id` in a
* `StreamingModifyAckDeadlineRequest` if using streaming pull.
* The minimum custom deadline you can specify is 10 seconds.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* If this parameter is 0, a default value of 10 seconds is used.
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
*
* Generated from protobuf field <code>int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $ack_deadline_seconds = 0;
/**
* Optional. Indicates whether to retain acknowledged messages. If true, then
* messages are not expunged from the subscription's backlog, even if they are
* acknowledged, until they fall out of the `message_retention_duration`
* window. This must be true if you would like to [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
* Generated from protobuf field <code>bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $retain_acked_messages = false;
/**
* Optional. How long to retain unacknowledged messages in the subscription's
* backlog, from the moment a message is published. If `retain_acked_messages`
* is true, then this also configures the retention of acknowledged messages,
* and thus configures how far back in time a `Seek` can be done. Defaults to
* 7 days. Cannot be more than 31 days or less than 10 minutes.
*
* Generated from protobuf field <code>.google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $message_retention_duration = null;
/**
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
* Generated from protobuf field <code>map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
private $labels;
/**
* Optional. If true, messages published with the same `ordering_key` in
* `PubsubMessage` will be delivered to the subscribers in the order in which
* they are received by the Pub/Sub system. Otherwise, they may be delivered
* in any order.
*
* Generated from protobuf field <code>bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $enable_message_ordering = false;
/**
* Optional. A policy that specifies the conditions for this subscription's
* expiration. A subscription is considered active as long as any connected
* subscriber is successfully consuming messages from the subscription or is
* issuing operations on the subscription. If `expiration_policy` is not set,
* a *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $expiration_policy = null;
/**
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Generated from protobuf field <code>string filter = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $filter = '';
/**
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}\@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $dead_letter_policy = null;
/**
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $retry_policy = null;
/**
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
* Generated from protobuf field <code>bool detached = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $detached = false;
/**
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
* Generated from protobuf field <code>bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $enable_exactly_once_delivery = false;
/**
* Optional. Transforms to be applied to messages before they are delivered to
* subscribers. Transforms are applied in the order specified.
*
* Generated from protobuf field <code>repeated .google.cloud.bigquery.analyticshub.v1.MessageTransform message_transforms = 25 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
private $message_transforms;
/**
* Optional. Input only. Immutable. Tag keys/values directly bound to this
* resource. For example:
* "123/environment": "production",
* "123/costCenter": "marketing"
*
* Generated from protobuf field <code>map<string, string> tags = 26 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
*/
private $tags;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* Required. Name of the subscription.
* Format is `projects/{project}/subscriptions/{sub}`.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\PushConfig $push_config
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\BigQueryConfig $bigquery_config
* Optional. If delivery to BigQuery is used with this subscription, this
* field is used to configure it.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\CloudStorageConfig $cloud_storage_config
* Optional. If delivery to Google Cloud Storage is used with this
* subscription, this field is used to configure it.
* @type int $ack_deadline_seconds
* Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
* waits for the subscriber to acknowledge receipt before resending the
* message. In the interval after the message is delivered and before it is
* acknowledged, it is considered to be _outstanding_. During that time
* period, the message will not be redelivered (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* non-streaming pull or send the `ack_id` in a
* `StreamingModifyAckDeadlineRequest` if using streaming pull.
* The minimum custom deadline you can specify is 10 seconds.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* If this parameter is 0, a default value of 10 seconds is used.
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
* @type bool $retain_acked_messages
* Optional. Indicates whether to retain acknowledged messages. If true, then
* messages are not expunged from the subscription's backlog, even if they are
* acknowledged, until they fall out of the `message_retention_duration`
* window. This must be true if you would like to [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
* @type \Google\Protobuf\Duration $message_retention_duration
* Optional. How long to retain unacknowledged messages in the subscription's
* backlog, from the moment a message is published. If `retain_acked_messages`
* is true, then this also configures the retention of acknowledged messages,
* and thus configures how far back in time a `Seek` can be done. Defaults to
* 7 days. Cannot be more than 31 days or less than 10 minutes.
* @type array|\Google\Protobuf\Internal\MapField $labels
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
* @type bool $enable_message_ordering
* Optional. If true, messages published with the same `ordering_key` in
* `PubsubMessage` will be delivered to the subscribers in the order in which
* they are received by the Pub/Sub system. Otherwise, they may be delivered
* in any order.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\ExpirationPolicy $expiration_policy
* Optional. A policy that specifies the conditions for this subscription's
* expiration. A subscription is considered active as long as any connected
* subscriber is successfully consuming messages from the subscription or is
* issuing operations on the subscription. If `expiration_policy` is not set,
* a *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
* @type string $filter
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DeadLetterPolicy $dead_letter_policy
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}\@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\RetryPolicy $retry_policy
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
* @type bool $detached
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
* @type bool $enable_exactly_once_delivery
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\MessageTransform[] $message_transforms
* Optional. Transforms to be applied to messages before they are delivered to
* subscribers. Transforms are applied in the order specified.
* @type array|\Google\Protobuf\Internal\MapField $tags
* Optional. Input only. Immutable. Tag keys/values directly bound to this
* resource. For example:
* "123/environment": "production",
* "123/costCenter": "marketing"
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Pubsub::initOnce();
parent::__construct($data);
}
/**
* Required. Name of the subscription.
* Format is `projects/{project}/subscriptions/{sub}`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Required. Name of the subscription.
* Format is `projects/{project}/subscriptions/{sub}`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\PushConfig|null
*/
public function getPushConfig()
{
return $this->push_config;
}
public function hasPushConfig()
{
return isset($this->push_config);
}
public function clearPushConfig()
{
unset($this->push_config);
}
/**
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\PushConfig $var
* @return $this
*/
public function setPushConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\PushConfig::class);
$this->push_config = $var;
return $this;
}
/**
* Optional. If delivery to BigQuery is used with this subscription, this
* field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\BigQueryConfig|null
*/
public function getBigqueryConfig()
{
return $this->bigquery_config;
}
public function hasBigqueryConfig()
{
return isset($this->bigquery_config);
}
public function clearBigqueryConfig()
{
unset($this->bigquery_config);
}
/**
* Optional. If delivery to BigQuery is used with this subscription, this
* field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.BigQueryConfig bigquery_config = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\BigQueryConfig $var
* @return $this
*/
public function setBigqueryConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\BigQueryConfig::class);
$this->bigquery_config = $var;
return $this;
}
/**
* Optional. If delivery to Google Cloud Storage is used with this
* subscription, this field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\CloudStorageConfig|null
*/
public function getCloudStorageConfig()
{
return $this->cloud_storage_config;
}
public function hasCloudStorageConfig()
{
return isset($this->cloud_storage_config);
}
public function clearCloudStorageConfig()
{
unset($this->cloud_storage_config);
}
/**
* Optional. If delivery to Google Cloud Storage is used with this
* subscription, this field is used to configure it.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\CloudStorageConfig $var
* @return $this
*/
public function setCloudStorageConfig($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\CloudStorageConfig::class);
$this->cloud_storage_config = $var;
return $this;
}
/**
* Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
* waits for the subscriber to acknowledge receipt before resending the
* message. In the interval after the message is delivered and before it is
* acknowledged, it is considered to be _outstanding_. During that time
* period, the message will not be redelivered (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* non-streaming pull or send the `ack_id` in a
* `StreamingModifyAckDeadlineRequest` if using streaming pull.
* The minimum custom deadline you can specify is 10 seconds.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* If this parameter is 0, a default value of 10 seconds is used.
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
*
* Generated from protobuf field <code>int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return int
*/
public function getAckDeadlineSeconds()
{
return $this->ack_deadline_seconds;
}
/**
* Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
* waits for the subscriber to acknowledge receipt before resending the
* message. In the interval after the message is delivered and before it is
* acknowledged, it is considered to be _outstanding_. During that time
* period, the message will not be redelivered (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* non-streaming pull or send the `ack_id` in a
* `StreamingModifyAckDeadlineRequest` if using streaming pull.
* The minimum custom deadline you can specify is 10 seconds.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* If this parameter is 0, a default value of 10 seconds is used.
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
*
* Generated from protobuf field <code>int32 ack_deadline_seconds = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param int $var
* @return $this
*/
public function setAckDeadlineSeconds($var)
{
GPBUtil::checkInt32($var);
$this->ack_deadline_seconds = $var;
return $this;
}
/**
* Optional. Indicates whether to retain acknowledged messages. If true, then
* messages are not expunged from the subscription's backlog, even if they are
* acknowledged, until they fall out of the `message_retention_duration`
* window. This must be true if you would like to [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
* Generated from protobuf field <code>bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return bool
*/
public function getRetainAckedMessages()
{
return $this->retain_acked_messages;
}
/**
* Optional. Indicates whether to retain acknowledged messages. If true, then
* messages are not expunged from the subscription's backlog, even if they are
* acknowledged, until they fall out of the `message_retention_duration`
* window. This must be true if you would like to [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
* Generated from protobuf field <code>bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param bool $var
* @return $this
*/
public function setRetainAckedMessages($var)
{
GPBUtil::checkBool($var);
$this->retain_acked_messages = $var;
return $this;
}
/**
* Optional. How long to retain unacknowledged messages in the subscription's
* backlog, from the moment a message is published. If `retain_acked_messages`
* is true, then this also configures the retention of acknowledged messages,
* and thus configures how far back in time a `Seek` can be done. Defaults to
* 7 days. Cannot be more than 31 days or less than 10 minutes.
*
* Generated from protobuf field <code>.google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Protobuf\Duration|null
*/
public function getMessageRetentionDuration()
{
return $this->message_retention_duration;
}
public function hasMessageRetentionDuration()
{
return isset($this->message_retention_duration);
}
public function clearMessageRetentionDuration()
{
unset($this->message_retention_duration);
}
/**
* Optional. How long to retain unacknowledged messages in the subscription's
* backlog, from the moment a message is published. If `retain_acked_messages`
* is true, then this also configures the retention of acknowledged messages,
* and thus configures how far back in time a `Seek` can be done. Defaults to
* 7 days. Cannot be more than 31 days or less than 10 minutes.
*
* Generated from protobuf field <code>.google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Protobuf\Duration $var
* @return $this
*/
public function setMessageRetentionDuration($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
$this->message_retention_duration = $var;
return $this;
}
/**
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
* Generated from protobuf field <code>map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Protobuf\Internal\MapField
*/
public function getLabels()
{
return $this->labels;
}
/**
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
* Generated from protobuf field <code>map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param array|\Google\Protobuf\Internal\MapField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
$this->labels = $arr;
return $this;
}
/**
* Optional. If true, messages published with the same `ordering_key` in
* `PubsubMessage` will be delivered to the subscribers in the order in which
* they are received by the Pub/Sub system. Otherwise, they may be delivered
* in any order.
*
* Generated from protobuf field <code>bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return bool
*/
public function getEnableMessageOrdering()
{
return $this->enable_message_ordering;
}
/**
* Optional. If true, messages published with the same `ordering_key` in
* `PubsubMessage` will be delivered to the subscribers in the order in which
* they are received by the Pub/Sub system. Otherwise, they may be delivered
* in any order.
*
* Generated from protobuf field <code>bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param bool $var
* @return $this
*/
public function setEnableMessageOrdering($var)
{
GPBUtil::checkBool($var);
$this->enable_message_ordering = $var;
return $this;
}
/**
* Optional. A policy that specifies the conditions for this subscription's
* expiration. A subscription is considered active as long as any connected
* subscriber is successfully consuming messages from the subscription or is
* issuing operations on the subscription. If `expiration_policy` is not set,
* a *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ExpirationPolicy|null
*/
public function getExpirationPolicy()
{
return $this->expiration_policy;
}
public function hasExpirationPolicy()
{
return isset($this->expiration_policy);
}
public function clearExpirationPolicy()
{
unset($this->expiration_policy);
}
/**
* Optional. A policy that specifies the conditions for this subscription's
* expiration. A subscription is considered active as long as any connected
* subscriber is successfully consuming messages from the subscription or is
* issuing operations on the subscription. If `expiration_policy` is not set,
* a *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\ExpirationPolicy $var
* @return $this
*/
public function setExpirationPolicy($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\ExpirationPolicy::class);
$this->expiration_policy = $var;
return $this;
}
/**
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Generated from protobuf field <code>string filter = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return string
*/
public function getFilter()
{
return $this->filter;
}
/**
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Generated from protobuf field <code>string filter = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param string $var
* @return $this
*/
public function setFilter($var)
{
GPBUtil::checkString($var, True);
$this->filter = $var;
return $this;
}
/**
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}\@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DeadLetterPolicy|null
*/
public function getDeadLetterPolicy()
{
return $this->dead_letter_policy;
}
public function hasDeadLetterPolicy()
{
return isset($this->dead_letter_policy);
}
public function clearDeadLetterPolicy()
{
unset($this->dead_letter_policy);
}
/**
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}\@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\DeadLetterPolicy $var
* @return $this
*/
public function setDeadLetterPolicy($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\DeadLetterPolicy::class);
$this->dead_letter_policy = $var;
return $this;
}
/**
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Cloud\BigQuery\AnalyticsHub\V1\RetryPolicy|null
*/
public function getRetryPolicy()
{
return $this->retry_policy;
}
public function hasRetryPolicy()
{
return isset($this->retry_policy);
}
public function clearRetryPolicy()
{
unset($this->retry_policy);
}
/**
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Generated from protobuf field <code>.google.cloud.bigquery.analyticshub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\RetryPolicy $var
* @return $this
*/
public function setRetryPolicy($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\RetryPolicy::class);
$this->retry_policy = $var;
return $this;
}
/**
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
* Generated from protobuf field <code>bool detached = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return bool
*/
public function getDetached()
{
return $this->detached;
}
/**
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
* Generated from protobuf field <code>bool detached = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param bool $var
* @return $this
*/
public function setDetached($var)
{
GPBUtil::checkBool($var);
$this->detached = $var;
return $this;
}
/**
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
* Generated from protobuf field <code>bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return bool
*/
public function getEnableExactlyOnceDelivery()
{
return $this->enable_exactly_once_delivery;
}
/**
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
* Generated from protobuf field <code>bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param bool $var
* @return $this
*/
public function setEnableExactlyOnceDelivery($var)
{
GPBUtil::checkBool($var);
$this->enable_exactly_once_delivery = $var;
return $this;
}
/**
* Optional. Transforms to be applied to messages before they are delivered to
* subscribers. Transforms are applied in the order specified.
*
* Generated from protobuf field <code>repeated .google.cloud.bigquery.analyticshub.v1.MessageTransform message_transforms = 25 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return RepeatedField<\Google\Cloud\BigQuery\AnalyticsHub\V1\MessageTransform>
*/
public function getMessageTransforms()
{
return $this->message_transforms;
}
/**
* Optional. Transforms to be applied to messages before they are delivered to
* subscribers. Transforms are applied in the order specified.
*
* Generated from protobuf field <code>repeated .google.cloud.bigquery.analyticshub.v1.MessageTransform message_transforms = 25 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\BigQuery\AnalyticsHub\V1\MessageTransform[] $var
* @return $this
*/
public function setMessageTransforms($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\MessageTransform::class);
$this->message_transforms = $arr;
return $this;
}
/**
* Optional. Input only. Immutable. Tag keys/values directly bound to this
* resource. For example:
* "123/environment": "production",
* "123/costCenter": "marketing"
*
* Generated from protobuf field <code>map<string, string> tags = 26 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
* @return \Google\Protobuf\Internal\MapField
*/
public function getTags()
{
return $this->tags;
}
/**
* Optional. Input only. Immutable. Tag keys/values directly bound to this
* resource. For example:
* "123/environment": "production",
* "123/costCenter": "marketing"
*
* Generated from protobuf field <code>map<string, string> tags = 26 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
* @param array|\Google\Protobuf\Internal\MapField $var
* @return $this
*/
public function setTags($var)
{
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
$this->tags = $arr;
return $this;
}
}