• 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/v2beta2/queue.proto
18 
19 package com.google.cloud.tasks.v2beta2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Rate limits.
26  * This message determines the maximum rate that tasks can be dispatched by a
27  * queue, regardless of whether the dispatch is a first task attempt or a retry.
28  * Note: The debugging command,
29  * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask], will run a task
30  * even if the queue has reached its
31  * [RateLimits][google.cloud.tasks.v2beta2.RateLimits].
32  * </pre>
33  *
34  * Protobuf type {@code google.cloud.tasks.v2beta2.RateLimits}
35  */
36 public final class RateLimits extends com.google.protobuf.GeneratedMessageV3
37     implements
38     // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta2.RateLimits)
39     RateLimitsOrBuilder {
40   private static final long serialVersionUID = 0L;
41   // Use RateLimits.newBuilder() to construct.
RateLimits(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)42   private RateLimits(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
43     super(builder);
44   }
45 
RateLimits()46   private RateLimits() {}
47 
48   @java.lang.Override
49   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)50   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
51     return new RateLimits();
52   }
53 
54   @java.lang.Override
getUnknownFields()55   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
56     return this.unknownFields;
57   }
58 
getDescriptor()59   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
60     return com.google.cloud.tasks.v2beta2.QueueProto
61         .internal_static_google_cloud_tasks_v2beta2_RateLimits_descriptor;
62   }
63 
64   @java.lang.Override
65   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()66       internalGetFieldAccessorTable() {
67     return com.google.cloud.tasks.v2beta2.QueueProto
68         .internal_static_google_cloud_tasks_v2beta2_RateLimits_fieldAccessorTable
69         .ensureFieldAccessorsInitialized(
70             com.google.cloud.tasks.v2beta2.RateLimits.class,
71             com.google.cloud.tasks.v2beta2.RateLimits.Builder.class);
72   }
73 
74   public static final int MAX_TASKS_DISPATCHED_PER_SECOND_FIELD_NUMBER = 1;
75   private double maxTasksDispatchedPerSecond_ = 0D;
76   /**
77    *
78    *
79    * <pre>
80    * The maximum rate at which tasks are dispatched from this queue.
81    * If unspecified when the queue is created, Cloud Tasks will pick the
82    * default.
83    * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget],
84    * the maximum allowed value
85    *   is 500.
86    * * This field is output only   for [pull
87    * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the
88    *   `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
89    *   [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests
90    *   are allowed per pull queue.
91    * This field has the same meaning as
92    * [rate in
93    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
94    * </pre>
95    *
96    * <code>double max_tasks_dispatched_per_second = 1;</code>
97    *
98    * @return The maxTasksDispatchedPerSecond.
99    */
100   @java.lang.Override
getMaxTasksDispatchedPerSecond()101   public double getMaxTasksDispatchedPerSecond() {
102     return maxTasksDispatchedPerSecond_;
103   }
104 
105   public static final int MAX_BURST_SIZE_FIELD_NUMBER = 2;
106   private int maxBurstSize_ = 0;
107   /**
108    *
109    *
110    * <pre>
111    * The max burst size.
112    * Max burst size limits how fast tasks in queue are processed when
113    * many tasks are in the queue and the rate is high. This field
114    * allows the queue to have a high rate so processing starts shortly
115    * after a task is enqueued, but still limits resource usage when
116    * many tasks are enqueued in a short period of time.
117    * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
118    * algorithm is used to control the rate of task dispatches. Each
119    * queue has a token bucket that holds tokens, up to the maximum
120    * specified by `max_burst_size`. Each time a task is dispatched, a
121    * token is removed from the bucket. Tasks will be dispatched until
122    * the queue's bucket runs out of tokens. The bucket will be
123    * continuously refilled with new tokens based on
124    * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
125    * The default value of `max_burst_size` is picked by Cloud Tasks
126    * based on the value of
127    * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
128    * The maximum value of `max_burst_size` is 500.
129    * For App Engine queues that were created or updated using
130    * `queue.yaml/xml`, `max_burst_size` is equal to
131    * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
132    * If
133    * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called
134    * on a queue without explicitly setting a value for `max_burst_size`,
135    * `max_burst_size` value will get updated if
136    * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is
137    * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
138    * </pre>
139    *
140    * <code>int32 max_burst_size = 2;</code>
141    *
142    * @return The maxBurstSize.
143    */
144   @java.lang.Override
getMaxBurstSize()145   public int getMaxBurstSize() {
146     return maxBurstSize_;
147   }
148 
149   public static final int MAX_CONCURRENT_TASKS_FIELD_NUMBER = 3;
150   private int maxConcurrentTasks_ = 0;
151   /**
152    *
153    *
154    * <pre>
155    * The maximum number of concurrent tasks that Cloud Tasks allows
156    * to be dispatched for this queue. After this threshold has been
157    * reached, Cloud Tasks stops dispatching tasks until the number of
158    * concurrent requests decreases.
159    * If unspecified when the queue is created, Cloud Tasks will pick the
160    * default.
161    * The maximum allowed value is 5,000.
162    * This field is output only for
163    * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which
164    * indicates no limit. No other queue types can have `max_concurrent_tasks`
165    * set to -1.
166    * This field has the same meaning as
167    * [max_concurrent_requests in
168    * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
169    * </pre>
170    *
171    * <code>int32 max_concurrent_tasks = 3;</code>
172    *
173    * @return The maxConcurrentTasks.
174    */
175   @java.lang.Override
getMaxConcurrentTasks()176   public int getMaxConcurrentTasks() {
177     return maxConcurrentTasks_;
178   }
179 
180   private byte memoizedIsInitialized = -1;
181 
182   @java.lang.Override
isInitialized()183   public final boolean isInitialized() {
184     byte isInitialized = memoizedIsInitialized;
185     if (isInitialized == 1) return true;
186     if (isInitialized == 0) return false;
187 
188     memoizedIsInitialized = 1;
189     return true;
190   }
191 
192   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)193   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
194     if (java.lang.Double.doubleToRawLongBits(maxTasksDispatchedPerSecond_) != 0) {
195       output.writeDouble(1, maxTasksDispatchedPerSecond_);
196     }
197     if (maxBurstSize_ != 0) {
198       output.writeInt32(2, maxBurstSize_);
199     }
200     if (maxConcurrentTasks_ != 0) {
201       output.writeInt32(3, maxConcurrentTasks_);
202     }
203     getUnknownFields().writeTo(output);
204   }
205 
206   @java.lang.Override
getSerializedSize()207   public int getSerializedSize() {
208     int size = memoizedSize;
209     if (size != -1) return size;
210 
211     size = 0;
212     if (java.lang.Double.doubleToRawLongBits(maxTasksDispatchedPerSecond_) != 0) {
213       size +=
214           com.google.protobuf.CodedOutputStream.computeDoubleSize(1, maxTasksDispatchedPerSecond_);
215     }
216     if (maxBurstSize_ != 0) {
217       size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxBurstSize_);
218     }
219     if (maxConcurrentTasks_ != 0) {
220       size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxConcurrentTasks_);
221     }
222     size += getUnknownFields().getSerializedSize();
223     memoizedSize = size;
224     return size;
225   }
226 
227   @java.lang.Override
equals(final java.lang.Object obj)228   public boolean equals(final java.lang.Object obj) {
229     if (obj == this) {
230       return true;
231     }
232     if (!(obj instanceof com.google.cloud.tasks.v2beta2.RateLimits)) {
233       return super.equals(obj);
234     }
235     com.google.cloud.tasks.v2beta2.RateLimits other =
236         (com.google.cloud.tasks.v2beta2.RateLimits) obj;
237 
238     if (java.lang.Double.doubleToLongBits(getMaxTasksDispatchedPerSecond())
239         != java.lang.Double.doubleToLongBits(other.getMaxTasksDispatchedPerSecond())) return false;
240     if (getMaxBurstSize() != other.getMaxBurstSize()) return false;
241     if (getMaxConcurrentTasks() != other.getMaxConcurrentTasks()) return false;
242     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
243     return true;
244   }
245 
246   @java.lang.Override
hashCode()247   public int hashCode() {
248     if (memoizedHashCode != 0) {
249       return memoizedHashCode;
250     }
251     int hash = 41;
252     hash = (19 * hash) + getDescriptor().hashCode();
253     hash = (37 * hash) + MAX_TASKS_DISPATCHED_PER_SECOND_FIELD_NUMBER;
254     hash =
255         (53 * hash)
256             + com.google.protobuf.Internal.hashLong(
257                 java.lang.Double.doubleToLongBits(getMaxTasksDispatchedPerSecond()));
258     hash = (37 * hash) + MAX_BURST_SIZE_FIELD_NUMBER;
259     hash = (53 * hash) + getMaxBurstSize();
260     hash = (37 * hash) + MAX_CONCURRENT_TASKS_FIELD_NUMBER;
261     hash = (53 * hash) + getMaxConcurrentTasks();
262     hash = (29 * hash) + getUnknownFields().hashCode();
263     memoizedHashCode = hash;
264     return hash;
265   }
266 
parseFrom(java.nio.ByteBuffer data)267   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(java.nio.ByteBuffer data)
268       throws com.google.protobuf.InvalidProtocolBufferException {
269     return PARSER.parseFrom(data);
270   }
271 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)272   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
273       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
274       throws com.google.protobuf.InvalidProtocolBufferException {
275     return PARSER.parseFrom(data, extensionRegistry);
276   }
277 
parseFrom( com.google.protobuf.ByteString data)278   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
279       com.google.protobuf.ByteString data)
280       throws com.google.protobuf.InvalidProtocolBufferException {
281     return PARSER.parseFrom(data);
282   }
283 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)284   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
285       com.google.protobuf.ByteString data,
286       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
287       throws com.google.protobuf.InvalidProtocolBufferException {
288     return PARSER.parseFrom(data, extensionRegistry);
289   }
290 
parseFrom(byte[] data)291   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(byte[] data)
292       throws com.google.protobuf.InvalidProtocolBufferException {
293     return PARSER.parseFrom(data);
294   }
295 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)296   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
297       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
298       throws com.google.protobuf.InvalidProtocolBufferException {
299     return PARSER.parseFrom(data, extensionRegistry);
300   }
301 
parseFrom(java.io.InputStream input)302   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(java.io.InputStream input)
303       throws java.io.IOException {
304     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
305   }
306 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)307   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
308       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
309       throws java.io.IOException {
310     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
311         PARSER, input, extensionRegistry);
312   }
313 
parseDelimitedFrom( java.io.InputStream input)314   public static com.google.cloud.tasks.v2beta2.RateLimits parseDelimitedFrom(
315       java.io.InputStream input) throws java.io.IOException {
316     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
317   }
318 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)319   public static com.google.cloud.tasks.v2beta2.RateLimits parseDelimitedFrom(
320       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
321       throws java.io.IOException {
322     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
323         PARSER, input, extensionRegistry);
324   }
325 
parseFrom( com.google.protobuf.CodedInputStream input)326   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
327       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
328     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
329   }
330 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)331   public static com.google.cloud.tasks.v2beta2.RateLimits parseFrom(
332       com.google.protobuf.CodedInputStream input,
333       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
334       throws java.io.IOException {
335     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
336         PARSER, input, extensionRegistry);
337   }
338 
339   @java.lang.Override
newBuilderForType()340   public Builder newBuilderForType() {
341     return newBuilder();
342   }
343 
newBuilder()344   public static Builder newBuilder() {
345     return DEFAULT_INSTANCE.toBuilder();
346   }
347 
newBuilder(com.google.cloud.tasks.v2beta2.RateLimits prototype)348   public static Builder newBuilder(com.google.cloud.tasks.v2beta2.RateLimits prototype) {
349     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
350   }
351 
352   @java.lang.Override
toBuilder()353   public Builder toBuilder() {
354     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
355   }
356 
357   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)358   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
359     Builder builder = new Builder(parent);
360     return builder;
361   }
362   /**
363    *
364    *
365    * <pre>
366    * Rate limits.
367    * This message determines the maximum rate that tasks can be dispatched by a
368    * queue, regardless of whether the dispatch is a first task attempt or a retry.
369    * Note: The debugging command,
370    * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask], will run a task
371    * even if the queue has reached its
372    * [RateLimits][google.cloud.tasks.v2beta2.RateLimits].
373    * </pre>
374    *
375    * Protobuf type {@code google.cloud.tasks.v2beta2.RateLimits}
376    */
377   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
378       implements
379       // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta2.RateLimits)
380       com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder {
getDescriptor()381     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
382       return com.google.cloud.tasks.v2beta2.QueueProto
383           .internal_static_google_cloud_tasks_v2beta2_RateLimits_descriptor;
384     }
385 
386     @java.lang.Override
387     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()388         internalGetFieldAccessorTable() {
389       return com.google.cloud.tasks.v2beta2.QueueProto
390           .internal_static_google_cloud_tasks_v2beta2_RateLimits_fieldAccessorTable
391           .ensureFieldAccessorsInitialized(
392               com.google.cloud.tasks.v2beta2.RateLimits.class,
393               com.google.cloud.tasks.v2beta2.RateLimits.Builder.class);
394     }
395 
396     // Construct using com.google.cloud.tasks.v2beta2.RateLimits.newBuilder()
Builder()397     private Builder() {}
398 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)399     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
400       super(parent);
401     }
402 
403     @java.lang.Override
clear()404     public Builder clear() {
405       super.clear();
406       bitField0_ = 0;
407       maxTasksDispatchedPerSecond_ = 0D;
408       maxBurstSize_ = 0;
409       maxConcurrentTasks_ = 0;
410       return this;
411     }
412 
413     @java.lang.Override
getDescriptorForType()414     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
415       return com.google.cloud.tasks.v2beta2.QueueProto
416           .internal_static_google_cloud_tasks_v2beta2_RateLimits_descriptor;
417     }
418 
419     @java.lang.Override
getDefaultInstanceForType()420     public com.google.cloud.tasks.v2beta2.RateLimits getDefaultInstanceForType() {
421       return com.google.cloud.tasks.v2beta2.RateLimits.getDefaultInstance();
422     }
423 
424     @java.lang.Override
build()425     public com.google.cloud.tasks.v2beta2.RateLimits build() {
426       com.google.cloud.tasks.v2beta2.RateLimits result = buildPartial();
427       if (!result.isInitialized()) {
428         throw newUninitializedMessageException(result);
429       }
430       return result;
431     }
432 
433     @java.lang.Override
buildPartial()434     public com.google.cloud.tasks.v2beta2.RateLimits buildPartial() {
435       com.google.cloud.tasks.v2beta2.RateLimits result =
436           new com.google.cloud.tasks.v2beta2.RateLimits(this);
437       if (bitField0_ != 0) {
438         buildPartial0(result);
439       }
440       onBuilt();
441       return result;
442     }
443 
buildPartial0(com.google.cloud.tasks.v2beta2.RateLimits result)444     private void buildPartial0(com.google.cloud.tasks.v2beta2.RateLimits result) {
445       int from_bitField0_ = bitField0_;
446       if (((from_bitField0_ & 0x00000001) != 0)) {
447         result.maxTasksDispatchedPerSecond_ = maxTasksDispatchedPerSecond_;
448       }
449       if (((from_bitField0_ & 0x00000002) != 0)) {
450         result.maxBurstSize_ = maxBurstSize_;
451       }
452       if (((from_bitField0_ & 0x00000004) != 0)) {
453         result.maxConcurrentTasks_ = maxConcurrentTasks_;
454       }
455     }
456 
457     @java.lang.Override
clone()458     public Builder clone() {
459       return super.clone();
460     }
461 
462     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)463     public Builder setField(
464         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
465       return super.setField(field, value);
466     }
467 
468     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)469     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
470       return super.clearField(field);
471     }
472 
473     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)474     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
475       return super.clearOneof(oneof);
476     }
477 
478     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)479     public Builder setRepeatedField(
480         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
481       return super.setRepeatedField(field, index, value);
482     }
483 
484     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)485     public Builder addRepeatedField(
486         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
487       return super.addRepeatedField(field, value);
488     }
489 
490     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)491     public Builder mergeFrom(com.google.protobuf.Message other) {
492       if (other instanceof com.google.cloud.tasks.v2beta2.RateLimits) {
493         return mergeFrom((com.google.cloud.tasks.v2beta2.RateLimits) other);
494       } else {
495         super.mergeFrom(other);
496         return this;
497       }
498     }
499 
mergeFrom(com.google.cloud.tasks.v2beta2.RateLimits other)500     public Builder mergeFrom(com.google.cloud.tasks.v2beta2.RateLimits other) {
501       if (other == com.google.cloud.tasks.v2beta2.RateLimits.getDefaultInstance()) return this;
502       if (other.getMaxTasksDispatchedPerSecond() != 0D) {
503         setMaxTasksDispatchedPerSecond(other.getMaxTasksDispatchedPerSecond());
504       }
505       if (other.getMaxBurstSize() != 0) {
506         setMaxBurstSize(other.getMaxBurstSize());
507       }
508       if (other.getMaxConcurrentTasks() != 0) {
509         setMaxConcurrentTasks(other.getMaxConcurrentTasks());
510       }
511       this.mergeUnknownFields(other.getUnknownFields());
512       onChanged();
513       return this;
514     }
515 
516     @java.lang.Override
isInitialized()517     public final boolean isInitialized() {
518       return true;
519     }
520 
521     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)522     public Builder mergeFrom(
523         com.google.protobuf.CodedInputStream input,
524         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
525         throws java.io.IOException {
526       if (extensionRegistry == null) {
527         throw new java.lang.NullPointerException();
528       }
529       try {
530         boolean done = false;
531         while (!done) {
532           int tag = input.readTag();
533           switch (tag) {
534             case 0:
535               done = true;
536               break;
537             case 9:
538               {
539                 maxTasksDispatchedPerSecond_ = input.readDouble();
540                 bitField0_ |= 0x00000001;
541                 break;
542               } // case 9
543             case 16:
544               {
545                 maxBurstSize_ = input.readInt32();
546                 bitField0_ |= 0x00000002;
547                 break;
548               } // case 16
549             case 24:
550               {
551                 maxConcurrentTasks_ = input.readInt32();
552                 bitField0_ |= 0x00000004;
553                 break;
554               } // case 24
555             default:
556               {
557                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
558                   done = true; // was an endgroup tag
559                 }
560                 break;
561               } // default:
562           } // switch (tag)
563         } // while (!done)
564       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
565         throw e.unwrapIOException();
566       } finally {
567         onChanged();
568       } // finally
569       return this;
570     }
571 
572     private int bitField0_;
573 
574     private double maxTasksDispatchedPerSecond_;
575     /**
576      *
577      *
578      * <pre>
579      * The maximum rate at which tasks are dispatched from this queue.
580      * If unspecified when the queue is created, Cloud Tasks will pick the
581      * default.
582      * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget],
583      * the maximum allowed value
584      *   is 500.
585      * * This field is output only   for [pull
586      * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the
587      *   `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
588      *   [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests
589      *   are allowed per pull queue.
590      * This field has the same meaning as
591      * [rate in
592      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
593      * </pre>
594      *
595      * <code>double max_tasks_dispatched_per_second = 1;</code>
596      *
597      * @return The maxTasksDispatchedPerSecond.
598      */
599     @java.lang.Override
getMaxTasksDispatchedPerSecond()600     public double getMaxTasksDispatchedPerSecond() {
601       return maxTasksDispatchedPerSecond_;
602     }
603     /**
604      *
605      *
606      * <pre>
607      * The maximum rate at which tasks are dispatched from this queue.
608      * If unspecified when the queue is created, Cloud Tasks will pick the
609      * default.
610      * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget],
611      * the maximum allowed value
612      *   is 500.
613      * * This field is output only   for [pull
614      * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the
615      *   `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
616      *   [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests
617      *   are allowed per pull queue.
618      * This field has the same meaning as
619      * [rate in
620      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
621      * </pre>
622      *
623      * <code>double max_tasks_dispatched_per_second = 1;</code>
624      *
625      * @param value The maxTasksDispatchedPerSecond to set.
626      * @return This builder for chaining.
627      */
setMaxTasksDispatchedPerSecond(double value)628     public Builder setMaxTasksDispatchedPerSecond(double value) {
629 
630       maxTasksDispatchedPerSecond_ = value;
631       bitField0_ |= 0x00000001;
632       onChanged();
633       return this;
634     }
635     /**
636      *
637      *
638      * <pre>
639      * The maximum rate at which tasks are dispatched from this queue.
640      * If unspecified when the queue is created, Cloud Tasks will pick the
641      * default.
642      * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget],
643      * the maximum allowed value
644      *   is 500.
645      * * This field is output only   for [pull
646      * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the
647      *   `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
648      *   [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests
649      *   are allowed per pull queue.
650      * This field has the same meaning as
651      * [rate in
652      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
653      * </pre>
654      *
655      * <code>double max_tasks_dispatched_per_second = 1;</code>
656      *
657      * @return This builder for chaining.
658      */
clearMaxTasksDispatchedPerSecond()659     public Builder clearMaxTasksDispatchedPerSecond() {
660       bitField0_ = (bitField0_ & ~0x00000001);
661       maxTasksDispatchedPerSecond_ = 0D;
662       onChanged();
663       return this;
664     }
665 
666     private int maxBurstSize_;
667     /**
668      *
669      *
670      * <pre>
671      * The max burst size.
672      * Max burst size limits how fast tasks in queue are processed when
673      * many tasks are in the queue and the rate is high. This field
674      * allows the queue to have a high rate so processing starts shortly
675      * after a task is enqueued, but still limits resource usage when
676      * many tasks are enqueued in a short period of time.
677      * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
678      * algorithm is used to control the rate of task dispatches. Each
679      * queue has a token bucket that holds tokens, up to the maximum
680      * specified by `max_burst_size`. Each time a task is dispatched, a
681      * token is removed from the bucket. Tasks will be dispatched until
682      * the queue's bucket runs out of tokens. The bucket will be
683      * continuously refilled with new tokens based on
684      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
685      * The default value of `max_burst_size` is picked by Cloud Tasks
686      * based on the value of
687      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
688      * The maximum value of `max_burst_size` is 500.
689      * For App Engine queues that were created or updated using
690      * `queue.yaml/xml`, `max_burst_size` is equal to
691      * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
692      * If
693      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called
694      * on a queue without explicitly setting a value for `max_burst_size`,
695      * `max_burst_size` value will get updated if
696      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is
697      * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
698      * </pre>
699      *
700      * <code>int32 max_burst_size = 2;</code>
701      *
702      * @return The maxBurstSize.
703      */
704     @java.lang.Override
getMaxBurstSize()705     public int getMaxBurstSize() {
706       return maxBurstSize_;
707     }
708     /**
709      *
710      *
711      * <pre>
712      * The max burst size.
713      * Max burst size limits how fast tasks in queue are processed when
714      * many tasks are in the queue and the rate is high. This field
715      * allows the queue to have a high rate so processing starts shortly
716      * after a task is enqueued, but still limits resource usage when
717      * many tasks are enqueued in a short period of time.
718      * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
719      * algorithm is used to control the rate of task dispatches. Each
720      * queue has a token bucket that holds tokens, up to the maximum
721      * specified by `max_burst_size`. Each time a task is dispatched, a
722      * token is removed from the bucket. Tasks will be dispatched until
723      * the queue's bucket runs out of tokens. The bucket will be
724      * continuously refilled with new tokens based on
725      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
726      * The default value of `max_burst_size` is picked by Cloud Tasks
727      * based on the value of
728      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
729      * The maximum value of `max_burst_size` is 500.
730      * For App Engine queues that were created or updated using
731      * `queue.yaml/xml`, `max_burst_size` is equal to
732      * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
733      * If
734      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called
735      * on a queue without explicitly setting a value for `max_burst_size`,
736      * `max_burst_size` value will get updated if
737      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is
738      * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
739      * </pre>
740      *
741      * <code>int32 max_burst_size = 2;</code>
742      *
743      * @param value The maxBurstSize to set.
744      * @return This builder for chaining.
745      */
setMaxBurstSize(int value)746     public Builder setMaxBurstSize(int value) {
747 
748       maxBurstSize_ = value;
749       bitField0_ |= 0x00000002;
750       onChanged();
751       return this;
752     }
753     /**
754      *
755      *
756      * <pre>
757      * The max burst size.
758      * Max burst size limits how fast tasks in queue are processed when
759      * many tasks are in the queue and the rate is high. This field
760      * allows the queue to have a high rate so processing starts shortly
761      * after a task is enqueued, but still limits resource usage when
762      * many tasks are enqueued in a short period of time.
763      * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
764      * algorithm is used to control the rate of task dispatches. Each
765      * queue has a token bucket that holds tokens, up to the maximum
766      * specified by `max_burst_size`. Each time a task is dispatched, a
767      * token is removed from the bucket. Tasks will be dispatched until
768      * the queue's bucket runs out of tokens. The bucket will be
769      * continuously refilled with new tokens based on
770      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
771      * The default value of `max_burst_size` is picked by Cloud Tasks
772      * based on the value of
773      * [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
774      * The maximum value of `max_burst_size` is 500.
775      * For App Engine queues that were created or updated using
776      * `queue.yaml/xml`, `max_burst_size` is equal to
777      * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
778      * If
779      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called
780      * on a queue without explicitly setting a value for `max_burst_size`,
781      * `max_burst_size` value will get updated if
782      * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is
783      * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second].
784      * </pre>
785      *
786      * <code>int32 max_burst_size = 2;</code>
787      *
788      * @return This builder for chaining.
789      */
clearMaxBurstSize()790     public Builder clearMaxBurstSize() {
791       bitField0_ = (bitField0_ & ~0x00000002);
792       maxBurstSize_ = 0;
793       onChanged();
794       return this;
795     }
796 
797     private int maxConcurrentTasks_;
798     /**
799      *
800      *
801      * <pre>
802      * The maximum number of concurrent tasks that Cloud Tasks allows
803      * to be dispatched for this queue. After this threshold has been
804      * reached, Cloud Tasks stops dispatching tasks until the number of
805      * concurrent requests decreases.
806      * If unspecified when the queue is created, Cloud Tasks will pick the
807      * default.
808      * The maximum allowed value is 5,000.
809      * This field is output only for
810      * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which
811      * indicates no limit. No other queue types can have `max_concurrent_tasks`
812      * set to -1.
813      * This field has the same meaning as
814      * [max_concurrent_requests in
815      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
816      * </pre>
817      *
818      * <code>int32 max_concurrent_tasks = 3;</code>
819      *
820      * @return The maxConcurrentTasks.
821      */
822     @java.lang.Override
getMaxConcurrentTasks()823     public int getMaxConcurrentTasks() {
824       return maxConcurrentTasks_;
825     }
826     /**
827      *
828      *
829      * <pre>
830      * The maximum number of concurrent tasks that Cloud Tasks allows
831      * to be dispatched for this queue. After this threshold has been
832      * reached, Cloud Tasks stops dispatching tasks until the number of
833      * concurrent requests decreases.
834      * If unspecified when the queue is created, Cloud Tasks will pick the
835      * default.
836      * The maximum allowed value is 5,000.
837      * This field is output only for
838      * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which
839      * indicates no limit. No other queue types can have `max_concurrent_tasks`
840      * set to -1.
841      * This field has the same meaning as
842      * [max_concurrent_requests in
843      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
844      * </pre>
845      *
846      * <code>int32 max_concurrent_tasks = 3;</code>
847      *
848      * @param value The maxConcurrentTasks to set.
849      * @return This builder for chaining.
850      */
setMaxConcurrentTasks(int value)851     public Builder setMaxConcurrentTasks(int value) {
852 
853       maxConcurrentTasks_ = value;
854       bitField0_ |= 0x00000004;
855       onChanged();
856       return this;
857     }
858     /**
859      *
860      *
861      * <pre>
862      * The maximum number of concurrent tasks that Cloud Tasks allows
863      * to be dispatched for this queue. After this threshold has been
864      * reached, Cloud Tasks stops dispatching tasks until the number of
865      * concurrent requests decreases.
866      * If unspecified when the queue is created, Cloud Tasks will pick the
867      * default.
868      * The maximum allowed value is 5,000.
869      * This field is output only for
870      * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which
871      * indicates no limit. No other queue types can have `max_concurrent_tasks`
872      * set to -1.
873      * This field has the same meaning as
874      * [max_concurrent_requests in
875      * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
876      * </pre>
877      *
878      * <code>int32 max_concurrent_tasks = 3;</code>
879      *
880      * @return This builder for chaining.
881      */
clearMaxConcurrentTasks()882     public Builder clearMaxConcurrentTasks() {
883       bitField0_ = (bitField0_ & ~0x00000004);
884       maxConcurrentTasks_ = 0;
885       onChanged();
886       return this;
887     }
888 
889     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)890     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
891       return super.setUnknownFields(unknownFields);
892     }
893 
894     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)895     public final Builder mergeUnknownFields(
896         final com.google.protobuf.UnknownFieldSet unknownFields) {
897       return super.mergeUnknownFields(unknownFields);
898     }
899 
900     // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2beta2.RateLimits)
901   }
902 
903   // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta2.RateLimits)
904   private static final com.google.cloud.tasks.v2beta2.RateLimits DEFAULT_INSTANCE;
905 
906   static {
907     DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta2.RateLimits();
908   }
909 
getDefaultInstance()910   public static com.google.cloud.tasks.v2beta2.RateLimits getDefaultInstance() {
911     return DEFAULT_INSTANCE;
912   }
913 
914   private static final com.google.protobuf.Parser<RateLimits> PARSER =
915       new com.google.protobuf.AbstractParser<RateLimits>() {
916         @java.lang.Override
917         public RateLimits parsePartialFrom(
918             com.google.protobuf.CodedInputStream input,
919             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
920             throws com.google.protobuf.InvalidProtocolBufferException {
921           Builder builder = newBuilder();
922           try {
923             builder.mergeFrom(input, extensionRegistry);
924           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
925             throw e.setUnfinishedMessage(builder.buildPartial());
926           } catch (com.google.protobuf.UninitializedMessageException e) {
927             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
928           } catch (java.io.IOException e) {
929             throw new com.google.protobuf.InvalidProtocolBufferException(e)
930                 .setUnfinishedMessage(builder.buildPartial());
931           }
932           return builder.buildPartial();
933         }
934       };
935 
parser()936   public static com.google.protobuf.Parser<RateLimits> parser() {
937     return PARSER;
938   }
939 
940   @java.lang.Override
getParserForType()941   public com.google.protobuf.Parser<RateLimits> getParserForType() {
942     return PARSER;
943   }
944 
945   @java.lang.Override
getDefaultInstanceForType()946   public com.google.cloud.tasks.v2beta2.RateLimits getDefaultInstanceForType() {
947     return DEFAULT_INSTANCE;
948   }
949 }
950