• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/tasks/v2/queue.proto
18 
19 package com.google.cloud.tasks.v2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Retry config.
26  * These settings determine when a failed task attempt is retried.
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.tasks.v2.RetryConfig}
30  */
31 public final class RetryConfig extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2.RetryConfig)
34     RetryConfigOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use RetryConfig.newBuilder() to construct.
RetryConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private RetryConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
RetryConfig()41   private RetryConfig() {}
42 
43   @java.lang.Override
44   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)45   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
46     return new RetryConfig();
47   }
48 
49   @java.lang.Override
getUnknownFields()50   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
51     return this.unknownFields;
52   }
53 
getDescriptor()54   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
55     return com.google.cloud.tasks.v2.QueueProto
56         .internal_static_google_cloud_tasks_v2_RetryConfig_descriptor;
57   }
58 
59   @java.lang.Override
60   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()61       internalGetFieldAccessorTable() {
62     return com.google.cloud.tasks.v2.QueueProto
63         .internal_static_google_cloud_tasks_v2_RetryConfig_fieldAccessorTable
64         .ensureFieldAccessorsInitialized(
65             com.google.cloud.tasks.v2.RetryConfig.class,
66             com.google.cloud.tasks.v2.RetryConfig.Builder.class);
67   }
68 
69   public static final int MAX_ATTEMPTS_FIELD_NUMBER = 1;
70   private int maxAttempts_ = 0;
71   /**
72    *
73    *
74    * <pre>
75    * Number of attempts per task.
76    * Cloud Tasks will attempt the task `max_attempts` times (that is, if the
77    * first attempt fails, then there will be `max_attempts - 1` retries). Must
78    * be &gt;= -1.
79    * If unspecified when the queue is created, Cloud Tasks will pick the
80    * default.
81    * -1 indicates unlimited attempts.
82    * This field has the same meaning as
83    * [task_retry_limit in
84    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
85    * </pre>
86    *
87    * <code>int32 max_attempts = 1;</code>
88    *
89    * @return The maxAttempts.
90    */
91   @java.lang.Override
getMaxAttempts()92   public int getMaxAttempts() {
93     return maxAttempts_;
94   }
95 
96   public static final int MAX_RETRY_DURATION_FIELD_NUMBER = 2;
97   private com.google.protobuf.Duration maxRetryDuration_;
98   /**
99    *
100    *
101    * <pre>
102    * If positive, `max_retry_duration` specifies the time limit for
103    * retrying a failed task, measured from when the task was first
104    * attempted. Once `max_retry_duration` time has passed *and* the
105    * task has been attempted
106    * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
107    * further attempts will be made and the task will be deleted.
108    * If zero, then the task age is unlimited.
109    * If unspecified when the queue is created, Cloud Tasks will pick the
110    * default.
111    * `max_retry_duration` will be truncated to the nearest second.
112    * This field has the same meaning as
113    * [task_age_limit in
114    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
115    * </pre>
116    *
117    * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
118    *
119    * @return Whether the maxRetryDuration field is set.
120    */
121   @java.lang.Override
hasMaxRetryDuration()122   public boolean hasMaxRetryDuration() {
123     return maxRetryDuration_ != null;
124   }
125   /**
126    *
127    *
128    * <pre>
129    * If positive, `max_retry_duration` specifies the time limit for
130    * retrying a failed task, measured from when the task was first
131    * attempted. Once `max_retry_duration` time has passed *and* the
132    * task has been attempted
133    * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
134    * further attempts will be made and the task will be deleted.
135    * If zero, then the task age is unlimited.
136    * If unspecified when the queue is created, Cloud Tasks will pick the
137    * default.
138    * `max_retry_duration` will be truncated to the nearest second.
139    * This field has the same meaning as
140    * [task_age_limit in
141    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
142    * </pre>
143    *
144    * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
145    *
146    * @return The maxRetryDuration.
147    */
148   @java.lang.Override
getMaxRetryDuration()149   public com.google.protobuf.Duration getMaxRetryDuration() {
150     return maxRetryDuration_ == null
151         ? com.google.protobuf.Duration.getDefaultInstance()
152         : maxRetryDuration_;
153   }
154   /**
155    *
156    *
157    * <pre>
158    * If positive, `max_retry_duration` specifies the time limit for
159    * retrying a failed task, measured from when the task was first
160    * attempted. Once `max_retry_duration` time has passed *and* the
161    * task has been attempted
162    * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
163    * further attempts will be made and the task will be deleted.
164    * If zero, then the task age is unlimited.
165    * If unspecified when the queue is created, Cloud Tasks will pick the
166    * default.
167    * `max_retry_duration` will be truncated to the nearest second.
168    * This field has the same meaning as
169    * [task_age_limit in
170    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
171    * </pre>
172    *
173    * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
174    */
175   @java.lang.Override
getMaxRetryDurationOrBuilder()176   public com.google.protobuf.DurationOrBuilder getMaxRetryDurationOrBuilder() {
177     return maxRetryDuration_ == null
178         ? com.google.protobuf.Duration.getDefaultInstance()
179         : maxRetryDuration_;
180   }
181 
182   public static final int MIN_BACKOFF_FIELD_NUMBER = 3;
183   private com.google.protobuf.Duration minBackoff_;
184   /**
185    *
186    *
187    * <pre>
188    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
189    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
190    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
191    * after it fails, if the queue's
192    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
193    * should be retried.
194    * If unspecified when the queue is created, Cloud Tasks will pick the
195    * default.
196    * `min_backoff` will be truncated to the nearest second.
197    * This field has the same meaning as
198    * [min_backoff_seconds in
199    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
200    * </pre>
201    *
202    * <code>.google.protobuf.Duration min_backoff = 3;</code>
203    *
204    * @return Whether the minBackoff field is set.
205    */
206   @java.lang.Override
hasMinBackoff()207   public boolean hasMinBackoff() {
208     return minBackoff_ != null;
209   }
210   /**
211    *
212    *
213    * <pre>
214    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
215    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
216    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
217    * after it fails, if the queue's
218    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
219    * should be retried.
220    * If unspecified when the queue is created, Cloud Tasks will pick the
221    * default.
222    * `min_backoff` will be truncated to the nearest second.
223    * This field has the same meaning as
224    * [min_backoff_seconds in
225    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
226    * </pre>
227    *
228    * <code>.google.protobuf.Duration min_backoff = 3;</code>
229    *
230    * @return The minBackoff.
231    */
232   @java.lang.Override
getMinBackoff()233   public com.google.protobuf.Duration getMinBackoff() {
234     return minBackoff_ == null ? com.google.protobuf.Duration.getDefaultInstance() : minBackoff_;
235   }
236   /**
237    *
238    *
239    * <pre>
240    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
241    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
242    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
243    * after it fails, if the queue's
244    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
245    * should be retried.
246    * If unspecified when the queue is created, Cloud Tasks will pick the
247    * default.
248    * `min_backoff` will be truncated to the nearest second.
249    * This field has the same meaning as
250    * [min_backoff_seconds in
251    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
252    * </pre>
253    *
254    * <code>.google.protobuf.Duration min_backoff = 3;</code>
255    */
256   @java.lang.Override
getMinBackoffOrBuilder()257   public com.google.protobuf.DurationOrBuilder getMinBackoffOrBuilder() {
258     return minBackoff_ == null ? com.google.protobuf.Duration.getDefaultInstance() : minBackoff_;
259   }
260 
261   public static final int MAX_BACKOFF_FIELD_NUMBER = 4;
262   private com.google.protobuf.Duration maxBackoff_;
263   /**
264    *
265    *
266    * <pre>
267    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
268    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
269    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
270    * after it fails, if the queue's
271    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
272    * should be retried.
273    * If unspecified when the queue is created, Cloud Tasks will pick the
274    * default.
275    * `max_backoff` will be truncated to the nearest second.
276    * This field has the same meaning as
277    * [max_backoff_seconds in
278    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
279    * </pre>
280    *
281    * <code>.google.protobuf.Duration max_backoff = 4;</code>
282    *
283    * @return Whether the maxBackoff field is set.
284    */
285   @java.lang.Override
hasMaxBackoff()286   public boolean hasMaxBackoff() {
287     return maxBackoff_ != null;
288   }
289   /**
290    *
291    *
292    * <pre>
293    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
294    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
295    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
296    * after it fails, if the queue's
297    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
298    * should be retried.
299    * If unspecified when the queue is created, Cloud Tasks will pick the
300    * default.
301    * `max_backoff` will be truncated to the nearest second.
302    * This field has the same meaning as
303    * [max_backoff_seconds in
304    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
305    * </pre>
306    *
307    * <code>.google.protobuf.Duration max_backoff = 4;</code>
308    *
309    * @return The maxBackoff.
310    */
311   @java.lang.Override
getMaxBackoff()312   public com.google.protobuf.Duration getMaxBackoff() {
313     return maxBackoff_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxBackoff_;
314   }
315   /**
316    *
317    *
318    * <pre>
319    * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
320    * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
321    * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
322    * after it fails, if the queue's
323    * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
324    * should be retried.
325    * If unspecified when the queue is created, Cloud Tasks will pick the
326    * default.
327    * `max_backoff` will be truncated to the nearest second.
328    * This field has the same meaning as
329    * [max_backoff_seconds in
330    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
331    * </pre>
332    *
333    * <code>.google.protobuf.Duration max_backoff = 4;</code>
334    */
335   @java.lang.Override
getMaxBackoffOrBuilder()336   public com.google.protobuf.DurationOrBuilder getMaxBackoffOrBuilder() {
337     return maxBackoff_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxBackoff_;
338   }
339 
340   public static final int MAX_DOUBLINGS_FIELD_NUMBER = 5;
341   private int maxDoublings_ = 0;
342   /**
343    *
344    *
345    * <pre>
346    * The time between retries will double `max_doublings` times.
347    * A task's retry interval starts at
348    * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles
349    * `max_doublings` times, then increases linearly, and finally
350    * retries retries at intervals of
351    * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to
352    * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times.
353    * For example, if
354    * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s,
355    * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and
356    * `max_doublings` is 3, then the a task will first be retried in
357    * 10s. The retry interval will double three times, and then
358    * increase linearly by 2^3 * 10s.  Finally, the task will retry at
359    * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff]
360    * until the task has been attempted
361    * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus,
362    * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
363    * If unspecified when the queue is created, Cloud Tasks will pick the
364    * default.
365    * This field has the same meaning as
366    * [max_doublings in
367    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
368    * </pre>
369    *
370    * <code>int32 max_doublings = 5;</code>
371    *
372    * @return The maxDoublings.
373    */
374   @java.lang.Override
getMaxDoublings()375   public int getMaxDoublings() {
376     return maxDoublings_;
377   }
378 
379   private byte memoizedIsInitialized = -1;
380 
381   @java.lang.Override
isInitialized()382   public final boolean isInitialized() {
383     byte isInitialized = memoizedIsInitialized;
384     if (isInitialized == 1) return true;
385     if (isInitialized == 0) return false;
386 
387     memoizedIsInitialized = 1;
388     return true;
389   }
390 
391   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)392   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
393     if (maxAttempts_ != 0) {
394       output.writeInt32(1, maxAttempts_);
395     }
396     if (maxRetryDuration_ != null) {
397       output.writeMessage(2, getMaxRetryDuration());
398     }
399     if (minBackoff_ != null) {
400       output.writeMessage(3, getMinBackoff());
401     }
402     if (maxBackoff_ != null) {
403       output.writeMessage(4, getMaxBackoff());
404     }
405     if (maxDoublings_ != 0) {
406       output.writeInt32(5, maxDoublings_);
407     }
408     getUnknownFields().writeTo(output);
409   }
410 
411   @java.lang.Override
getSerializedSize()412   public int getSerializedSize() {
413     int size = memoizedSize;
414     if (size != -1) return size;
415 
416     size = 0;
417     if (maxAttempts_ != 0) {
418       size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, maxAttempts_);
419     }
420     if (maxRetryDuration_ != null) {
421       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxRetryDuration());
422     }
423     if (minBackoff_ != null) {
424       size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMinBackoff());
425     }
426     if (maxBackoff_ != null) {
427       size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMaxBackoff());
428     }
429     if (maxDoublings_ != 0) {
430       size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxDoublings_);
431     }
432     size += getUnknownFields().getSerializedSize();
433     memoizedSize = size;
434     return size;
435   }
436 
437   @java.lang.Override
equals(final java.lang.Object obj)438   public boolean equals(final java.lang.Object obj) {
439     if (obj == this) {
440       return true;
441     }
442     if (!(obj instanceof com.google.cloud.tasks.v2.RetryConfig)) {
443       return super.equals(obj);
444     }
445     com.google.cloud.tasks.v2.RetryConfig other = (com.google.cloud.tasks.v2.RetryConfig) obj;
446 
447     if (getMaxAttempts() != other.getMaxAttempts()) return false;
448     if (hasMaxRetryDuration() != other.hasMaxRetryDuration()) return false;
449     if (hasMaxRetryDuration()) {
450       if (!getMaxRetryDuration().equals(other.getMaxRetryDuration())) return false;
451     }
452     if (hasMinBackoff() != other.hasMinBackoff()) return false;
453     if (hasMinBackoff()) {
454       if (!getMinBackoff().equals(other.getMinBackoff())) return false;
455     }
456     if (hasMaxBackoff() != other.hasMaxBackoff()) return false;
457     if (hasMaxBackoff()) {
458       if (!getMaxBackoff().equals(other.getMaxBackoff())) return false;
459     }
460     if (getMaxDoublings() != other.getMaxDoublings()) return false;
461     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
462     return true;
463   }
464 
465   @java.lang.Override
hashCode()466   public int hashCode() {
467     if (memoizedHashCode != 0) {
468       return memoizedHashCode;
469     }
470     int hash = 41;
471     hash = (19 * hash) + getDescriptor().hashCode();
472     hash = (37 * hash) + MAX_ATTEMPTS_FIELD_NUMBER;
473     hash = (53 * hash) + getMaxAttempts();
474     if (hasMaxRetryDuration()) {
475       hash = (37 * hash) + MAX_RETRY_DURATION_FIELD_NUMBER;
476       hash = (53 * hash) + getMaxRetryDuration().hashCode();
477     }
478     if (hasMinBackoff()) {
479       hash = (37 * hash) + MIN_BACKOFF_FIELD_NUMBER;
480       hash = (53 * hash) + getMinBackoff().hashCode();
481     }
482     if (hasMaxBackoff()) {
483       hash = (37 * hash) + MAX_BACKOFF_FIELD_NUMBER;
484       hash = (53 * hash) + getMaxBackoff().hashCode();
485     }
486     hash = (37 * hash) + MAX_DOUBLINGS_FIELD_NUMBER;
487     hash = (53 * hash) + getMaxDoublings();
488     hash = (29 * hash) + getUnknownFields().hashCode();
489     memoizedHashCode = hash;
490     return hash;
491   }
492 
parseFrom(java.nio.ByteBuffer data)493   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(java.nio.ByteBuffer data)
494       throws com.google.protobuf.InvalidProtocolBufferException {
495     return PARSER.parseFrom(data);
496   }
497 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)498   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
499       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
500       throws com.google.protobuf.InvalidProtocolBufferException {
501     return PARSER.parseFrom(data, extensionRegistry);
502   }
503 
parseFrom(com.google.protobuf.ByteString data)504   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(com.google.protobuf.ByteString data)
505       throws com.google.protobuf.InvalidProtocolBufferException {
506     return PARSER.parseFrom(data);
507   }
508 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)509   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
510       com.google.protobuf.ByteString data,
511       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
512       throws com.google.protobuf.InvalidProtocolBufferException {
513     return PARSER.parseFrom(data, extensionRegistry);
514   }
515 
parseFrom(byte[] data)516   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(byte[] data)
517       throws com.google.protobuf.InvalidProtocolBufferException {
518     return PARSER.parseFrom(data);
519   }
520 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)521   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
522       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
523       throws com.google.protobuf.InvalidProtocolBufferException {
524     return PARSER.parseFrom(data, extensionRegistry);
525   }
526 
parseFrom(java.io.InputStream input)527   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(java.io.InputStream input)
528       throws java.io.IOException {
529     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
530   }
531 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)532   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
533       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
534       throws java.io.IOException {
535     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
536         PARSER, input, extensionRegistry);
537   }
538 
parseDelimitedFrom(java.io.InputStream input)539   public static com.google.cloud.tasks.v2.RetryConfig parseDelimitedFrom(java.io.InputStream input)
540       throws java.io.IOException {
541     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
542   }
543 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)544   public static com.google.cloud.tasks.v2.RetryConfig parseDelimitedFrom(
545       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
546       throws java.io.IOException {
547     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
548         PARSER, input, extensionRegistry);
549   }
550 
parseFrom( com.google.protobuf.CodedInputStream input)551   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
552       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
553     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
554   }
555 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)556   public static com.google.cloud.tasks.v2.RetryConfig parseFrom(
557       com.google.protobuf.CodedInputStream input,
558       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
559       throws java.io.IOException {
560     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
561         PARSER, input, extensionRegistry);
562   }
563 
564   @java.lang.Override
newBuilderForType()565   public Builder newBuilderForType() {
566     return newBuilder();
567   }
568 
newBuilder()569   public static Builder newBuilder() {
570     return DEFAULT_INSTANCE.toBuilder();
571   }
572 
newBuilder(com.google.cloud.tasks.v2.RetryConfig prototype)573   public static Builder newBuilder(com.google.cloud.tasks.v2.RetryConfig prototype) {
574     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
575   }
576 
577   @java.lang.Override
toBuilder()578   public Builder toBuilder() {
579     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
580   }
581 
582   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)583   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
584     Builder builder = new Builder(parent);
585     return builder;
586   }
587   /**
588    *
589    *
590    * <pre>
591    * Retry config.
592    * These settings determine when a failed task attempt is retried.
593    * </pre>
594    *
595    * Protobuf type {@code google.cloud.tasks.v2.RetryConfig}
596    */
597   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
598       implements
599       // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2.RetryConfig)
600       com.google.cloud.tasks.v2.RetryConfigOrBuilder {
getDescriptor()601     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
602       return com.google.cloud.tasks.v2.QueueProto
603           .internal_static_google_cloud_tasks_v2_RetryConfig_descriptor;
604     }
605 
606     @java.lang.Override
607     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()608         internalGetFieldAccessorTable() {
609       return com.google.cloud.tasks.v2.QueueProto
610           .internal_static_google_cloud_tasks_v2_RetryConfig_fieldAccessorTable
611           .ensureFieldAccessorsInitialized(
612               com.google.cloud.tasks.v2.RetryConfig.class,
613               com.google.cloud.tasks.v2.RetryConfig.Builder.class);
614     }
615 
616     // Construct using com.google.cloud.tasks.v2.RetryConfig.newBuilder()
Builder()617     private Builder() {}
618 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)619     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
620       super(parent);
621     }
622 
623     @java.lang.Override
clear()624     public Builder clear() {
625       super.clear();
626       bitField0_ = 0;
627       maxAttempts_ = 0;
628       maxRetryDuration_ = null;
629       if (maxRetryDurationBuilder_ != null) {
630         maxRetryDurationBuilder_.dispose();
631         maxRetryDurationBuilder_ = null;
632       }
633       minBackoff_ = null;
634       if (minBackoffBuilder_ != null) {
635         minBackoffBuilder_.dispose();
636         minBackoffBuilder_ = null;
637       }
638       maxBackoff_ = null;
639       if (maxBackoffBuilder_ != null) {
640         maxBackoffBuilder_.dispose();
641         maxBackoffBuilder_ = null;
642       }
643       maxDoublings_ = 0;
644       return this;
645     }
646 
647     @java.lang.Override
getDescriptorForType()648     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
649       return com.google.cloud.tasks.v2.QueueProto
650           .internal_static_google_cloud_tasks_v2_RetryConfig_descriptor;
651     }
652 
653     @java.lang.Override
getDefaultInstanceForType()654     public com.google.cloud.tasks.v2.RetryConfig getDefaultInstanceForType() {
655       return com.google.cloud.tasks.v2.RetryConfig.getDefaultInstance();
656     }
657 
658     @java.lang.Override
build()659     public com.google.cloud.tasks.v2.RetryConfig build() {
660       com.google.cloud.tasks.v2.RetryConfig result = buildPartial();
661       if (!result.isInitialized()) {
662         throw newUninitializedMessageException(result);
663       }
664       return result;
665     }
666 
667     @java.lang.Override
buildPartial()668     public com.google.cloud.tasks.v2.RetryConfig buildPartial() {
669       com.google.cloud.tasks.v2.RetryConfig result =
670           new com.google.cloud.tasks.v2.RetryConfig(this);
671       if (bitField0_ != 0) {
672         buildPartial0(result);
673       }
674       onBuilt();
675       return result;
676     }
677 
buildPartial0(com.google.cloud.tasks.v2.RetryConfig result)678     private void buildPartial0(com.google.cloud.tasks.v2.RetryConfig result) {
679       int from_bitField0_ = bitField0_;
680       if (((from_bitField0_ & 0x00000001) != 0)) {
681         result.maxAttempts_ = maxAttempts_;
682       }
683       if (((from_bitField0_ & 0x00000002) != 0)) {
684         result.maxRetryDuration_ =
685             maxRetryDurationBuilder_ == null ? maxRetryDuration_ : maxRetryDurationBuilder_.build();
686       }
687       if (((from_bitField0_ & 0x00000004) != 0)) {
688         result.minBackoff_ = minBackoffBuilder_ == null ? minBackoff_ : minBackoffBuilder_.build();
689       }
690       if (((from_bitField0_ & 0x00000008) != 0)) {
691         result.maxBackoff_ = maxBackoffBuilder_ == null ? maxBackoff_ : maxBackoffBuilder_.build();
692       }
693       if (((from_bitField0_ & 0x00000010) != 0)) {
694         result.maxDoublings_ = maxDoublings_;
695       }
696     }
697 
698     @java.lang.Override
clone()699     public Builder clone() {
700       return super.clone();
701     }
702 
703     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)704     public Builder setField(
705         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
706       return super.setField(field, value);
707     }
708 
709     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)710     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
711       return super.clearField(field);
712     }
713 
714     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)715     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
716       return super.clearOneof(oneof);
717     }
718 
719     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)720     public Builder setRepeatedField(
721         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
722       return super.setRepeatedField(field, index, value);
723     }
724 
725     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)726     public Builder addRepeatedField(
727         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
728       return super.addRepeatedField(field, value);
729     }
730 
731     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)732     public Builder mergeFrom(com.google.protobuf.Message other) {
733       if (other instanceof com.google.cloud.tasks.v2.RetryConfig) {
734         return mergeFrom((com.google.cloud.tasks.v2.RetryConfig) other);
735       } else {
736         super.mergeFrom(other);
737         return this;
738       }
739     }
740 
mergeFrom(com.google.cloud.tasks.v2.RetryConfig other)741     public Builder mergeFrom(com.google.cloud.tasks.v2.RetryConfig other) {
742       if (other == com.google.cloud.tasks.v2.RetryConfig.getDefaultInstance()) return this;
743       if (other.getMaxAttempts() != 0) {
744         setMaxAttempts(other.getMaxAttempts());
745       }
746       if (other.hasMaxRetryDuration()) {
747         mergeMaxRetryDuration(other.getMaxRetryDuration());
748       }
749       if (other.hasMinBackoff()) {
750         mergeMinBackoff(other.getMinBackoff());
751       }
752       if (other.hasMaxBackoff()) {
753         mergeMaxBackoff(other.getMaxBackoff());
754       }
755       if (other.getMaxDoublings() != 0) {
756         setMaxDoublings(other.getMaxDoublings());
757       }
758       this.mergeUnknownFields(other.getUnknownFields());
759       onChanged();
760       return this;
761     }
762 
763     @java.lang.Override
isInitialized()764     public final boolean isInitialized() {
765       return true;
766     }
767 
768     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)769     public Builder mergeFrom(
770         com.google.protobuf.CodedInputStream input,
771         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
772         throws java.io.IOException {
773       if (extensionRegistry == null) {
774         throw new java.lang.NullPointerException();
775       }
776       try {
777         boolean done = false;
778         while (!done) {
779           int tag = input.readTag();
780           switch (tag) {
781             case 0:
782               done = true;
783               break;
784             case 8:
785               {
786                 maxAttempts_ = input.readInt32();
787                 bitField0_ |= 0x00000001;
788                 break;
789               } // case 8
790             case 18:
791               {
792                 input.readMessage(
793                     getMaxRetryDurationFieldBuilder().getBuilder(), extensionRegistry);
794                 bitField0_ |= 0x00000002;
795                 break;
796               } // case 18
797             case 26:
798               {
799                 input.readMessage(getMinBackoffFieldBuilder().getBuilder(), extensionRegistry);
800                 bitField0_ |= 0x00000004;
801                 break;
802               } // case 26
803             case 34:
804               {
805                 input.readMessage(getMaxBackoffFieldBuilder().getBuilder(), extensionRegistry);
806                 bitField0_ |= 0x00000008;
807                 break;
808               } // case 34
809             case 40:
810               {
811                 maxDoublings_ = input.readInt32();
812                 bitField0_ |= 0x00000010;
813                 break;
814               } // case 40
815             default:
816               {
817                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
818                   done = true; // was an endgroup tag
819                 }
820                 break;
821               } // default:
822           } // switch (tag)
823         } // while (!done)
824       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
825         throw e.unwrapIOException();
826       } finally {
827         onChanged();
828       } // finally
829       return this;
830     }
831 
832     private int bitField0_;
833 
834     private int maxAttempts_;
835     /**
836      *
837      *
838      * <pre>
839      * Number of attempts per task.
840      * Cloud Tasks will attempt the task `max_attempts` times (that is, if the
841      * first attempt fails, then there will be `max_attempts - 1` retries). Must
842      * be &gt;= -1.
843      * If unspecified when the queue is created, Cloud Tasks will pick the
844      * default.
845      * -1 indicates unlimited attempts.
846      * This field has the same meaning as
847      * [task_retry_limit in
848      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
849      * </pre>
850      *
851      * <code>int32 max_attempts = 1;</code>
852      *
853      * @return The maxAttempts.
854      */
855     @java.lang.Override
getMaxAttempts()856     public int getMaxAttempts() {
857       return maxAttempts_;
858     }
859     /**
860      *
861      *
862      * <pre>
863      * Number of attempts per task.
864      * Cloud Tasks will attempt the task `max_attempts` times (that is, if the
865      * first attempt fails, then there will be `max_attempts - 1` retries). Must
866      * be &gt;= -1.
867      * If unspecified when the queue is created, Cloud Tasks will pick the
868      * default.
869      * -1 indicates unlimited attempts.
870      * This field has the same meaning as
871      * [task_retry_limit in
872      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
873      * </pre>
874      *
875      * <code>int32 max_attempts = 1;</code>
876      *
877      * @param value The maxAttempts to set.
878      * @return This builder for chaining.
879      */
setMaxAttempts(int value)880     public Builder setMaxAttempts(int value) {
881 
882       maxAttempts_ = value;
883       bitField0_ |= 0x00000001;
884       onChanged();
885       return this;
886     }
887     /**
888      *
889      *
890      * <pre>
891      * Number of attempts per task.
892      * Cloud Tasks will attempt the task `max_attempts` times (that is, if the
893      * first attempt fails, then there will be `max_attempts - 1` retries). Must
894      * be &gt;= -1.
895      * If unspecified when the queue is created, Cloud Tasks will pick the
896      * default.
897      * -1 indicates unlimited attempts.
898      * This field has the same meaning as
899      * [task_retry_limit in
900      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
901      * </pre>
902      *
903      * <code>int32 max_attempts = 1;</code>
904      *
905      * @return This builder for chaining.
906      */
clearMaxAttempts()907     public Builder clearMaxAttempts() {
908       bitField0_ = (bitField0_ & ~0x00000001);
909       maxAttempts_ = 0;
910       onChanged();
911       return this;
912     }
913 
914     private com.google.protobuf.Duration maxRetryDuration_;
915     private com.google.protobuf.SingleFieldBuilderV3<
916             com.google.protobuf.Duration,
917             com.google.protobuf.Duration.Builder,
918             com.google.protobuf.DurationOrBuilder>
919         maxRetryDurationBuilder_;
920     /**
921      *
922      *
923      * <pre>
924      * If positive, `max_retry_duration` specifies the time limit for
925      * retrying a failed task, measured from when the task was first
926      * attempted. Once `max_retry_duration` time has passed *and* the
927      * task has been attempted
928      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
929      * further attempts will be made and the task will be deleted.
930      * If zero, then the task age is unlimited.
931      * If unspecified when the queue is created, Cloud Tasks will pick the
932      * default.
933      * `max_retry_duration` will be truncated to the nearest second.
934      * This field has the same meaning as
935      * [task_age_limit in
936      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
937      * </pre>
938      *
939      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
940      *
941      * @return Whether the maxRetryDuration field is set.
942      */
hasMaxRetryDuration()943     public boolean hasMaxRetryDuration() {
944       return ((bitField0_ & 0x00000002) != 0);
945     }
946     /**
947      *
948      *
949      * <pre>
950      * If positive, `max_retry_duration` specifies the time limit for
951      * retrying a failed task, measured from when the task was first
952      * attempted. Once `max_retry_duration` time has passed *and* the
953      * task has been attempted
954      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
955      * further attempts will be made and the task will be deleted.
956      * If zero, then the task age is unlimited.
957      * If unspecified when the queue is created, Cloud Tasks will pick the
958      * default.
959      * `max_retry_duration` will be truncated to the nearest second.
960      * This field has the same meaning as
961      * [task_age_limit in
962      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
963      * </pre>
964      *
965      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
966      *
967      * @return The maxRetryDuration.
968      */
getMaxRetryDuration()969     public com.google.protobuf.Duration getMaxRetryDuration() {
970       if (maxRetryDurationBuilder_ == null) {
971         return maxRetryDuration_ == null
972             ? com.google.protobuf.Duration.getDefaultInstance()
973             : maxRetryDuration_;
974       } else {
975         return maxRetryDurationBuilder_.getMessage();
976       }
977     }
978     /**
979      *
980      *
981      * <pre>
982      * If positive, `max_retry_duration` specifies the time limit for
983      * retrying a failed task, measured from when the task was first
984      * attempted. Once `max_retry_duration` time has passed *and* the
985      * task has been attempted
986      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
987      * further attempts will be made and the task will be deleted.
988      * If zero, then the task age is unlimited.
989      * If unspecified when the queue is created, Cloud Tasks will pick the
990      * default.
991      * `max_retry_duration` will be truncated to the nearest second.
992      * This field has the same meaning as
993      * [task_age_limit in
994      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
995      * </pre>
996      *
997      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
998      */
setMaxRetryDuration(com.google.protobuf.Duration value)999     public Builder setMaxRetryDuration(com.google.protobuf.Duration value) {
1000       if (maxRetryDurationBuilder_ == null) {
1001         if (value == null) {
1002           throw new NullPointerException();
1003         }
1004         maxRetryDuration_ = value;
1005       } else {
1006         maxRetryDurationBuilder_.setMessage(value);
1007       }
1008       bitField0_ |= 0x00000002;
1009       onChanged();
1010       return this;
1011     }
1012     /**
1013      *
1014      *
1015      * <pre>
1016      * If positive, `max_retry_duration` specifies the time limit for
1017      * retrying a failed task, measured from when the task was first
1018      * attempted. Once `max_retry_duration` time has passed *and* the
1019      * task has been attempted
1020      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1021      * further attempts will be made and the task will be deleted.
1022      * If zero, then the task age is unlimited.
1023      * If unspecified when the queue is created, Cloud Tasks will pick the
1024      * default.
1025      * `max_retry_duration` will be truncated to the nearest second.
1026      * This field has the same meaning as
1027      * [task_age_limit in
1028      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1029      * </pre>
1030      *
1031      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1032      */
setMaxRetryDuration(com.google.protobuf.Duration.Builder builderForValue)1033     public Builder setMaxRetryDuration(com.google.protobuf.Duration.Builder builderForValue) {
1034       if (maxRetryDurationBuilder_ == null) {
1035         maxRetryDuration_ = builderForValue.build();
1036       } else {
1037         maxRetryDurationBuilder_.setMessage(builderForValue.build());
1038       }
1039       bitField0_ |= 0x00000002;
1040       onChanged();
1041       return this;
1042     }
1043     /**
1044      *
1045      *
1046      * <pre>
1047      * If positive, `max_retry_duration` specifies the time limit for
1048      * retrying a failed task, measured from when the task was first
1049      * attempted. Once `max_retry_duration` time has passed *and* the
1050      * task has been attempted
1051      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1052      * further attempts will be made and the task will be deleted.
1053      * If zero, then the task age is unlimited.
1054      * If unspecified when the queue is created, Cloud Tasks will pick the
1055      * default.
1056      * `max_retry_duration` will be truncated to the nearest second.
1057      * This field has the same meaning as
1058      * [task_age_limit in
1059      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1060      * </pre>
1061      *
1062      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1063      */
mergeMaxRetryDuration(com.google.protobuf.Duration value)1064     public Builder mergeMaxRetryDuration(com.google.protobuf.Duration value) {
1065       if (maxRetryDurationBuilder_ == null) {
1066         if (((bitField0_ & 0x00000002) != 0)
1067             && maxRetryDuration_ != null
1068             && maxRetryDuration_ != com.google.protobuf.Duration.getDefaultInstance()) {
1069           getMaxRetryDurationBuilder().mergeFrom(value);
1070         } else {
1071           maxRetryDuration_ = value;
1072         }
1073       } else {
1074         maxRetryDurationBuilder_.mergeFrom(value);
1075       }
1076       bitField0_ |= 0x00000002;
1077       onChanged();
1078       return this;
1079     }
1080     /**
1081      *
1082      *
1083      * <pre>
1084      * If positive, `max_retry_duration` specifies the time limit for
1085      * retrying a failed task, measured from when the task was first
1086      * attempted. Once `max_retry_duration` time has passed *and* the
1087      * task has been attempted
1088      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1089      * further attempts will be made and the task will be deleted.
1090      * If zero, then the task age is unlimited.
1091      * If unspecified when the queue is created, Cloud Tasks will pick the
1092      * default.
1093      * `max_retry_duration` will be truncated to the nearest second.
1094      * This field has the same meaning as
1095      * [task_age_limit in
1096      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1097      * </pre>
1098      *
1099      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1100      */
clearMaxRetryDuration()1101     public Builder clearMaxRetryDuration() {
1102       bitField0_ = (bitField0_ & ~0x00000002);
1103       maxRetryDuration_ = null;
1104       if (maxRetryDurationBuilder_ != null) {
1105         maxRetryDurationBuilder_.dispose();
1106         maxRetryDurationBuilder_ = null;
1107       }
1108       onChanged();
1109       return this;
1110     }
1111     /**
1112      *
1113      *
1114      * <pre>
1115      * If positive, `max_retry_duration` specifies the time limit for
1116      * retrying a failed task, measured from when the task was first
1117      * attempted. Once `max_retry_duration` time has passed *and* the
1118      * task has been attempted
1119      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1120      * further attempts will be made and the task will be deleted.
1121      * If zero, then the task age is unlimited.
1122      * If unspecified when the queue is created, Cloud Tasks will pick the
1123      * default.
1124      * `max_retry_duration` will be truncated to the nearest second.
1125      * This field has the same meaning as
1126      * [task_age_limit in
1127      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1128      * </pre>
1129      *
1130      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1131      */
getMaxRetryDurationBuilder()1132     public com.google.protobuf.Duration.Builder getMaxRetryDurationBuilder() {
1133       bitField0_ |= 0x00000002;
1134       onChanged();
1135       return getMaxRetryDurationFieldBuilder().getBuilder();
1136     }
1137     /**
1138      *
1139      *
1140      * <pre>
1141      * If positive, `max_retry_duration` specifies the time limit for
1142      * retrying a failed task, measured from when the task was first
1143      * attempted. Once `max_retry_duration` time has passed *and* the
1144      * task has been attempted
1145      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1146      * further attempts will be made and the task will be deleted.
1147      * If zero, then the task age is unlimited.
1148      * If unspecified when the queue is created, Cloud Tasks will pick the
1149      * default.
1150      * `max_retry_duration` will be truncated to the nearest second.
1151      * This field has the same meaning as
1152      * [task_age_limit in
1153      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1154      * </pre>
1155      *
1156      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1157      */
getMaxRetryDurationOrBuilder()1158     public com.google.protobuf.DurationOrBuilder getMaxRetryDurationOrBuilder() {
1159       if (maxRetryDurationBuilder_ != null) {
1160         return maxRetryDurationBuilder_.getMessageOrBuilder();
1161       } else {
1162         return maxRetryDuration_ == null
1163             ? com.google.protobuf.Duration.getDefaultInstance()
1164             : maxRetryDuration_;
1165       }
1166     }
1167     /**
1168      *
1169      *
1170      * <pre>
1171      * If positive, `max_retry_duration` specifies the time limit for
1172      * retrying a failed task, measured from when the task was first
1173      * attempted. Once `max_retry_duration` time has passed *and* the
1174      * task has been attempted
1175      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no
1176      * further attempts will be made and the task will be deleted.
1177      * If zero, then the task age is unlimited.
1178      * If unspecified when the queue is created, Cloud Tasks will pick the
1179      * default.
1180      * `max_retry_duration` will be truncated to the nearest second.
1181      * This field has the same meaning as
1182      * [task_age_limit in
1183      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1184      * </pre>
1185      *
1186      * <code>.google.protobuf.Duration max_retry_duration = 2;</code>
1187      */
1188     private com.google.protobuf.SingleFieldBuilderV3<
1189             com.google.protobuf.Duration,
1190             com.google.protobuf.Duration.Builder,
1191             com.google.protobuf.DurationOrBuilder>
getMaxRetryDurationFieldBuilder()1192         getMaxRetryDurationFieldBuilder() {
1193       if (maxRetryDurationBuilder_ == null) {
1194         maxRetryDurationBuilder_ =
1195             new com.google.protobuf.SingleFieldBuilderV3<
1196                 com.google.protobuf.Duration,
1197                 com.google.protobuf.Duration.Builder,
1198                 com.google.protobuf.DurationOrBuilder>(
1199                 getMaxRetryDuration(), getParentForChildren(), isClean());
1200         maxRetryDuration_ = null;
1201       }
1202       return maxRetryDurationBuilder_;
1203     }
1204 
1205     private com.google.protobuf.Duration minBackoff_;
1206     private com.google.protobuf.SingleFieldBuilderV3<
1207             com.google.protobuf.Duration,
1208             com.google.protobuf.Duration.Builder,
1209             com.google.protobuf.DurationOrBuilder>
1210         minBackoffBuilder_;
1211     /**
1212      *
1213      *
1214      * <pre>
1215      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1216      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1217      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1218      * after it fails, if the queue's
1219      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1220      * should be retried.
1221      * If unspecified when the queue is created, Cloud Tasks will pick the
1222      * default.
1223      * `min_backoff` will be truncated to the nearest second.
1224      * This field has the same meaning as
1225      * [min_backoff_seconds in
1226      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1227      * </pre>
1228      *
1229      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1230      *
1231      * @return Whether the minBackoff field is set.
1232      */
hasMinBackoff()1233     public boolean hasMinBackoff() {
1234       return ((bitField0_ & 0x00000004) != 0);
1235     }
1236     /**
1237      *
1238      *
1239      * <pre>
1240      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1241      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1242      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1243      * after it fails, if the queue's
1244      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1245      * should be retried.
1246      * If unspecified when the queue is created, Cloud Tasks will pick the
1247      * default.
1248      * `min_backoff` will be truncated to the nearest second.
1249      * This field has the same meaning as
1250      * [min_backoff_seconds in
1251      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1252      * </pre>
1253      *
1254      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1255      *
1256      * @return The minBackoff.
1257      */
getMinBackoff()1258     public com.google.protobuf.Duration getMinBackoff() {
1259       if (minBackoffBuilder_ == null) {
1260         return minBackoff_ == null
1261             ? com.google.protobuf.Duration.getDefaultInstance()
1262             : minBackoff_;
1263       } else {
1264         return minBackoffBuilder_.getMessage();
1265       }
1266     }
1267     /**
1268      *
1269      *
1270      * <pre>
1271      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1272      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1273      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1274      * after it fails, if the queue's
1275      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1276      * should be retried.
1277      * If unspecified when the queue is created, Cloud Tasks will pick the
1278      * default.
1279      * `min_backoff` will be truncated to the nearest second.
1280      * This field has the same meaning as
1281      * [min_backoff_seconds in
1282      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1283      * </pre>
1284      *
1285      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1286      */
setMinBackoff(com.google.protobuf.Duration value)1287     public Builder setMinBackoff(com.google.protobuf.Duration value) {
1288       if (minBackoffBuilder_ == null) {
1289         if (value == null) {
1290           throw new NullPointerException();
1291         }
1292         minBackoff_ = value;
1293       } else {
1294         minBackoffBuilder_.setMessage(value);
1295       }
1296       bitField0_ |= 0x00000004;
1297       onChanged();
1298       return this;
1299     }
1300     /**
1301      *
1302      *
1303      * <pre>
1304      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1305      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1306      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1307      * after it fails, if the queue's
1308      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1309      * should be retried.
1310      * If unspecified when the queue is created, Cloud Tasks will pick the
1311      * default.
1312      * `min_backoff` will be truncated to the nearest second.
1313      * This field has the same meaning as
1314      * [min_backoff_seconds in
1315      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1316      * </pre>
1317      *
1318      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1319      */
setMinBackoff(com.google.protobuf.Duration.Builder builderForValue)1320     public Builder setMinBackoff(com.google.protobuf.Duration.Builder builderForValue) {
1321       if (minBackoffBuilder_ == null) {
1322         minBackoff_ = builderForValue.build();
1323       } else {
1324         minBackoffBuilder_.setMessage(builderForValue.build());
1325       }
1326       bitField0_ |= 0x00000004;
1327       onChanged();
1328       return this;
1329     }
1330     /**
1331      *
1332      *
1333      * <pre>
1334      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1335      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1336      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1337      * after it fails, if the queue's
1338      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1339      * should be retried.
1340      * If unspecified when the queue is created, Cloud Tasks will pick the
1341      * default.
1342      * `min_backoff` will be truncated to the nearest second.
1343      * This field has the same meaning as
1344      * [min_backoff_seconds in
1345      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1346      * </pre>
1347      *
1348      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1349      */
mergeMinBackoff(com.google.protobuf.Duration value)1350     public Builder mergeMinBackoff(com.google.protobuf.Duration value) {
1351       if (minBackoffBuilder_ == null) {
1352         if (((bitField0_ & 0x00000004) != 0)
1353             && minBackoff_ != null
1354             && minBackoff_ != com.google.protobuf.Duration.getDefaultInstance()) {
1355           getMinBackoffBuilder().mergeFrom(value);
1356         } else {
1357           minBackoff_ = value;
1358         }
1359       } else {
1360         minBackoffBuilder_.mergeFrom(value);
1361       }
1362       bitField0_ |= 0x00000004;
1363       onChanged();
1364       return this;
1365     }
1366     /**
1367      *
1368      *
1369      * <pre>
1370      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1371      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1372      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1373      * after it fails, if the queue's
1374      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1375      * should be retried.
1376      * If unspecified when the queue is created, Cloud Tasks will pick the
1377      * default.
1378      * `min_backoff` will be truncated to the nearest second.
1379      * This field has the same meaning as
1380      * [min_backoff_seconds in
1381      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1382      * </pre>
1383      *
1384      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1385      */
clearMinBackoff()1386     public Builder clearMinBackoff() {
1387       bitField0_ = (bitField0_ & ~0x00000004);
1388       minBackoff_ = null;
1389       if (minBackoffBuilder_ != null) {
1390         minBackoffBuilder_.dispose();
1391         minBackoffBuilder_ = null;
1392       }
1393       onChanged();
1394       return this;
1395     }
1396     /**
1397      *
1398      *
1399      * <pre>
1400      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1401      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1402      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1403      * after it fails, if the queue's
1404      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1405      * should be retried.
1406      * If unspecified when the queue is created, Cloud Tasks will pick the
1407      * default.
1408      * `min_backoff` will be truncated to the nearest second.
1409      * This field has the same meaning as
1410      * [min_backoff_seconds in
1411      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1412      * </pre>
1413      *
1414      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1415      */
getMinBackoffBuilder()1416     public com.google.protobuf.Duration.Builder getMinBackoffBuilder() {
1417       bitField0_ |= 0x00000004;
1418       onChanged();
1419       return getMinBackoffFieldBuilder().getBuilder();
1420     }
1421     /**
1422      *
1423      *
1424      * <pre>
1425      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1426      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1427      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1428      * after it fails, if the queue's
1429      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1430      * should be retried.
1431      * If unspecified when the queue is created, Cloud Tasks will pick the
1432      * default.
1433      * `min_backoff` will be truncated to the nearest second.
1434      * This field has the same meaning as
1435      * [min_backoff_seconds in
1436      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1437      * </pre>
1438      *
1439      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1440      */
getMinBackoffOrBuilder()1441     public com.google.protobuf.DurationOrBuilder getMinBackoffOrBuilder() {
1442       if (minBackoffBuilder_ != null) {
1443         return minBackoffBuilder_.getMessageOrBuilder();
1444       } else {
1445         return minBackoff_ == null
1446             ? com.google.protobuf.Duration.getDefaultInstance()
1447             : minBackoff_;
1448       }
1449     }
1450     /**
1451      *
1452      *
1453      * <pre>
1454      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1455      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1456      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1457      * after it fails, if the queue's
1458      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1459      * should be retried.
1460      * If unspecified when the queue is created, Cloud Tasks will pick the
1461      * default.
1462      * `min_backoff` will be truncated to the nearest second.
1463      * This field has the same meaning as
1464      * [min_backoff_seconds in
1465      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1466      * </pre>
1467      *
1468      * <code>.google.protobuf.Duration min_backoff = 3;</code>
1469      */
1470     private com.google.protobuf.SingleFieldBuilderV3<
1471             com.google.protobuf.Duration,
1472             com.google.protobuf.Duration.Builder,
1473             com.google.protobuf.DurationOrBuilder>
getMinBackoffFieldBuilder()1474         getMinBackoffFieldBuilder() {
1475       if (minBackoffBuilder_ == null) {
1476         minBackoffBuilder_ =
1477             new com.google.protobuf.SingleFieldBuilderV3<
1478                 com.google.protobuf.Duration,
1479                 com.google.protobuf.Duration.Builder,
1480                 com.google.protobuf.DurationOrBuilder>(
1481                 getMinBackoff(), getParentForChildren(), isClean());
1482         minBackoff_ = null;
1483       }
1484       return minBackoffBuilder_;
1485     }
1486 
1487     private com.google.protobuf.Duration maxBackoff_;
1488     private com.google.protobuf.SingleFieldBuilderV3<
1489             com.google.protobuf.Duration,
1490             com.google.protobuf.Duration.Builder,
1491             com.google.protobuf.DurationOrBuilder>
1492         maxBackoffBuilder_;
1493     /**
1494      *
1495      *
1496      * <pre>
1497      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1498      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1499      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1500      * after it fails, if the queue's
1501      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1502      * should be retried.
1503      * If unspecified when the queue is created, Cloud Tasks will pick the
1504      * default.
1505      * `max_backoff` will be truncated to the nearest second.
1506      * This field has the same meaning as
1507      * [max_backoff_seconds in
1508      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1509      * </pre>
1510      *
1511      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1512      *
1513      * @return Whether the maxBackoff field is set.
1514      */
hasMaxBackoff()1515     public boolean hasMaxBackoff() {
1516       return ((bitField0_ & 0x00000008) != 0);
1517     }
1518     /**
1519      *
1520      *
1521      * <pre>
1522      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1523      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1524      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1525      * after it fails, if the queue's
1526      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1527      * should be retried.
1528      * If unspecified when the queue is created, Cloud Tasks will pick the
1529      * default.
1530      * `max_backoff` will be truncated to the nearest second.
1531      * This field has the same meaning as
1532      * [max_backoff_seconds in
1533      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1534      * </pre>
1535      *
1536      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1537      *
1538      * @return The maxBackoff.
1539      */
getMaxBackoff()1540     public com.google.protobuf.Duration getMaxBackoff() {
1541       if (maxBackoffBuilder_ == null) {
1542         return maxBackoff_ == null
1543             ? com.google.protobuf.Duration.getDefaultInstance()
1544             : maxBackoff_;
1545       } else {
1546         return maxBackoffBuilder_.getMessage();
1547       }
1548     }
1549     /**
1550      *
1551      *
1552      * <pre>
1553      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1554      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1555      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1556      * after it fails, if the queue's
1557      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1558      * should be retried.
1559      * If unspecified when the queue is created, Cloud Tasks will pick the
1560      * default.
1561      * `max_backoff` will be truncated to the nearest second.
1562      * This field has the same meaning as
1563      * [max_backoff_seconds in
1564      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1565      * </pre>
1566      *
1567      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1568      */
setMaxBackoff(com.google.protobuf.Duration value)1569     public Builder setMaxBackoff(com.google.protobuf.Duration value) {
1570       if (maxBackoffBuilder_ == null) {
1571         if (value == null) {
1572           throw new NullPointerException();
1573         }
1574         maxBackoff_ = value;
1575       } else {
1576         maxBackoffBuilder_.setMessage(value);
1577       }
1578       bitField0_ |= 0x00000008;
1579       onChanged();
1580       return this;
1581     }
1582     /**
1583      *
1584      *
1585      * <pre>
1586      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1587      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1588      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1589      * after it fails, if the queue's
1590      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1591      * should be retried.
1592      * If unspecified when the queue is created, Cloud Tasks will pick the
1593      * default.
1594      * `max_backoff` will be truncated to the nearest second.
1595      * This field has the same meaning as
1596      * [max_backoff_seconds in
1597      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1598      * </pre>
1599      *
1600      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1601      */
setMaxBackoff(com.google.protobuf.Duration.Builder builderForValue)1602     public Builder setMaxBackoff(com.google.protobuf.Duration.Builder builderForValue) {
1603       if (maxBackoffBuilder_ == null) {
1604         maxBackoff_ = builderForValue.build();
1605       } else {
1606         maxBackoffBuilder_.setMessage(builderForValue.build());
1607       }
1608       bitField0_ |= 0x00000008;
1609       onChanged();
1610       return this;
1611     }
1612     /**
1613      *
1614      *
1615      * <pre>
1616      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1617      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1618      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1619      * after it fails, if the queue's
1620      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1621      * should be retried.
1622      * If unspecified when the queue is created, Cloud Tasks will pick the
1623      * default.
1624      * `max_backoff` will be truncated to the nearest second.
1625      * This field has the same meaning as
1626      * [max_backoff_seconds in
1627      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1628      * </pre>
1629      *
1630      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1631      */
mergeMaxBackoff(com.google.protobuf.Duration value)1632     public Builder mergeMaxBackoff(com.google.protobuf.Duration value) {
1633       if (maxBackoffBuilder_ == null) {
1634         if (((bitField0_ & 0x00000008) != 0)
1635             && maxBackoff_ != null
1636             && maxBackoff_ != com.google.protobuf.Duration.getDefaultInstance()) {
1637           getMaxBackoffBuilder().mergeFrom(value);
1638         } else {
1639           maxBackoff_ = value;
1640         }
1641       } else {
1642         maxBackoffBuilder_.mergeFrom(value);
1643       }
1644       bitField0_ |= 0x00000008;
1645       onChanged();
1646       return this;
1647     }
1648     /**
1649      *
1650      *
1651      * <pre>
1652      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1653      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1654      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1655      * after it fails, if the queue's
1656      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1657      * should be retried.
1658      * If unspecified when the queue is created, Cloud Tasks will pick the
1659      * default.
1660      * `max_backoff` will be truncated to the nearest second.
1661      * This field has the same meaning as
1662      * [max_backoff_seconds in
1663      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1664      * </pre>
1665      *
1666      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1667      */
clearMaxBackoff()1668     public Builder clearMaxBackoff() {
1669       bitField0_ = (bitField0_ & ~0x00000008);
1670       maxBackoff_ = null;
1671       if (maxBackoffBuilder_ != null) {
1672         maxBackoffBuilder_.dispose();
1673         maxBackoffBuilder_ = null;
1674       }
1675       onChanged();
1676       return this;
1677     }
1678     /**
1679      *
1680      *
1681      * <pre>
1682      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1683      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1684      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1685      * after it fails, if the queue's
1686      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1687      * should be retried.
1688      * If unspecified when the queue is created, Cloud Tasks will pick the
1689      * default.
1690      * `max_backoff` will be truncated to the nearest second.
1691      * This field has the same meaning as
1692      * [max_backoff_seconds in
1693      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1694      * </pre>
1695      *
1696      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1697      */
getMaxBackoffBuilder()1698     public com.google.protobuf.Duration.Builder getMaxBackoffBuilder() {
1699       bitField0_ |= 0x00000008;
1700       onChanged();
1701       return getMaxBackoffFieldBuilder().getBuilder();
1702     }
1703     /**
1704      *
1705      *
1706      * <pre>
1707      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1708      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1709      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1710      * after it fails, if the queue's
1711      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1712      * should be retried.
1713      * If unspecified when the queue is created, Cloud Tasks will pick the
1714      * default.
1715      * `max_backoff` will be truncated to the nearest second.
1716      * This field has the same meaning as
1717      * [max_backoff_seconds in
1718      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1719      * </pre>
1720      *
1721      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1722      */
getMaxBackoffOrBuilder()1723     public com.google.protobuf.DurationOrBuilder getMaxBackoffOrBuilder() {
1724       if (maxBackoffBuilder_ != null) {
1725         return maxBackoffBuilder_.getMessageOrBuilder();
1726       } else {
1727         return maxBackoff_ == null
1728             ? com.google.protobuf.Duration.getDefaultInstance()
1729             : maxBackoff_;
1730       }
1731     }
1732     /**
1733      *
1734      *
1735      * <pre>
1736      * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for
1737      * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff]
1738      * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration
1739      * after it fails, if the queue's
1740      * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task
1741      * should be retried.
1742      * If unspecified when the queue is created, Cloud Tasks will pick the
1743      * default.
1744      * `max_backoff` will be truncated to the nearest second.
1745      * This field has the same meaning as
1746      * [max_backoff_seconds in
1747      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1748      * </pre>
1749      *
1750      * <code>.google.protobuf.Duration max_backoff = 4;</code>
1751      */
1752     private com.google.protobuf.SingleFieldBuilderV3<
1753             com.google.protobuf.Duration,
1754             com.google.protobuf.Duration.Builder,
1755             com.google.protobuf.DurationOrBuilder>
getMaxBackoffFieldBuilder()1756         getMaxBackoffFieldBuilder() {
1757       if (maxBackoffBuilder_ == null) {
1758         maxBackoffBuilder_ =
1759             new com.google.protobuf.SingleFieldBuilderV3<
1760                 com.google.protobuf.Duration,
1761                 com.google.protobuf.Duration.Builder,
1762                 com.google.protobuf.DurationOrBuilder>(
1763                 getMaxBackoff(), getParentForChildren(), isClean());
1764         maxBackoff_ = null;
1765       }
1766       return maxBackoffBuilder_;
1767     }
1768 
1769     private int maxDoublings_;
1770     /**
1771      *
1772      *
1773      * <pre>
1774      * The time between retries will double `max_doublings` times.
1775      * A task's retry interval starts at
1776      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles
1777      * `max_doublings` times, then increases linearly, and finally
1778      * retries retries at intervals of
1779      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to
1780      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times.
1781      * For example, if
1782      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s,
1783      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and
1784      * `max_doublings` is 3, then the a task will first be retried in
1785      * 10s. The retry interval will double three times, and then
1786      * increase linearly by 2^3 * 10s.  Finally, the task will retry at
1787      * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff]
1788      * until the task has been attempted
1789      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus,
1790      * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
1791      * If unspecified when the queue is created, Cloud Tasks will pick the
1792      * default.
1793      * This field has the same meaning as
1794      * [max_doublings in
1795      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1796      * </pre>
1797      *
1798      * <code>int32 max_doublings = 5;</code>
1799      *
1800      * @return The maxDoublings.
1801      */
1802     @java.lang.Override
getMaxDoublings()1803     public int getMaxDoublings() {
1804       return maxDoublings_;
1805     }
1806     /**
1807      *
1808      *
1809      * <pre>
1810      * The time between retries will double `max_doublings` times.
1811      * A task's retry interval starts at
1812      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles
1813      * `max_doublings` times, then increases linearly, and finally
1814      * retries retries at intervals of
1815      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to
1816      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times.
1817      * For example, if
1818      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s,
1819      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and
1820      * `max_doublings` is 3, then the a task will first be retried in
1821      * 10s. The retry interval will double three times, and then
1822      * increase linearly by 2^3 * 10s.  Finally, the task will retry at
1823      * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff]
1824      * until the task has been attempted
1825      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus,
1826      * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
1827      * If unspecified when the queue is created, Cloud Tasks will pick the
1828      * default.
1829      * This field has the same meaning as
1830      * [max_doublings in
1831      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1832      * </pre>
1833      *
1834      * <code>int32 max_doublings = 5;</code>
1835      *
1836      * @param value The maxDoublings to set.
1837      * @return This builder for chaining.
1838      */
setMaxDoublings(int value)1839     public Builder setMaxDoublings(int value) {
1840 
1841       maxDoublings_ = value;
1842       bitField0_ |= 0x00000010;
1843       onChanged();
1844       return this;
1845     }
1846     /**
1847      *
1848      *
1849      * <pre>
1850      * The time between retries will double `max_doublings` times.
1851      * A task's retry interval starts at
1852      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles
1853      * `max_doublings` times, then increases linearly, and finally
1854      * retries retries at intervals of
1855      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to
1856      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times.
1857      * For example, if
1858      * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s,
1859      * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and
1860      * `max_doublings` is 3, then the a task will first be retried in
1861      * 10s. The retry interval will double three times, and then
1862      * increase linearly by 2^3 * 10s.  Finally, the task will retry at
1863      * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff]
1864      * until the task has been attempted
1865      * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus,
1866      * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
1867      * If unspecified when the queue is created, Cloud Tasks will pick the
1868      * default.
1869      * This field has the same meaning as
1870      * [max_doublings in
1871      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
1872      * </pre>
1873      *
1874      * <code>int32 max_doublings = 5;</code>
1875      *
1876      * @return This builder for chaining.
1877      */
clearMaxDoublings()1878     public Builder clearMaxDoublings() {
1879       bitField0_ = (bitField0_ & ~0x00000010);
1880       maxDoublings_ = 0;
1881       onChanged();
1882       return this;
1883     }
1884 
1885     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1886     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1887       return super.setUnknownFields(unknownFields);
1888     }
1889 
1890     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1891     public final Builder mergeUnknownFields(
1892         final com.google.protobuf.UnknownFieldSet unknownFields) {
1893       return super.mergeUnknownFields(unknownFields);
1894     }
1895 
1896     // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2.RetryConfig)
1897   }
1898 
1899   // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2.RetryConfig)
1900   private static final com.google.cloud.tasks.v2.RetryConfig DEFAULT_INSTANCE;
1901 
1902   static {
1903     DEFAULT_INSTANCE = new com.google.cloud.tasks.v2.RetryConfig();
1904   }
1905 
getDefaultInstance()1906   public static com.google.cloud.tasks.v2.RetryConfig getDefaultInstance() {
1907     return DEFAULT_INSTANCE;
1908   }
1909 
1910   private static final com.google.protobuf.Parser<RetryConfig> PARSER =
1911       new com.google.protobuf.AbstractParser<RetryConfig>() {
1912         @java.lang.Override
1913         public RetryConfig parsePartialFrom(
1914             com.google.protobuf.CodedInputStream input,
1915             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1916             throws com.google.protobuf.InvalidProtocolBufferException {
1917           Builder builder = newBuilder();
1918           try {
1919             builder.mergeFrom(input, extensionRegistry);
1920           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1921             throw e.setUnfinishedMessage(builder.buildPartial());
1922           } catch (com.google.protobuf.UninitializedMessageException e) {
1923             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1924           } catch (java.io.IOException e) {
1925             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1926                 .setUnfinishedMessage(builder.buildPartial());
1927           }
1928           return builder.buildPartial();
1929         }
1930       };
1931 
parser()1932   public static com.google.protobuf.Parser<RetryConfig> parser() {
1933     return PARSER;
1934   }
1935 
1936   @java.lang.Override
getParserForType()1937   public com.google.protobuf.Parser<RetryConfig> getParserForType() {
1938     return PARSER;
1939   }
1940 
1941   @java.lang.Override
getDefaultInstanceForType()1942   public com.google.cloud.tasks.v2.RetryConfig getDefaultInstanceForType() {
1943     return DEFAULT_INSTANCE;
1944   }
1945 }
1946