• 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/cloudtasks.proto
18 
19 package com.google.cloud.tasks.v2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request message for [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask].
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.tasks.v2.CreateTaskRequest}
29  */
30 public final class CreateTaskRequest extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2.CreateTaskRequest)
33     CreateTaskRequestOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use CreateTaskRequest.newBuilder() to construct.
CreateTaskRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private CreateTaskRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
CreateTaskRequest()40   private CreateTaskRequest() {
41     parent_ = "";
42     responseView_ = 0;
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new CreateTaskRequest();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.cloud.tasks.v2.CloudTasksProto
58         .internal_static_google_cloud_tasks_v2_CreateTaskRequest_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.tasks.v2.CloudTasksProto
65         .internal_static_google_cloud_tasks_v2_CreateTaskRequest_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.tasks.v2.CreateTaskRequest.class,
68             com.google.cloud.tasks.v2.CreateTaskRequest.Builder.class);
69   }
70 
71   public static final int PARENT_FIELD_NUMBER = 1;
72 
73   @SuppressWarnings("serial")
74   private volatile java.lang.Object parent_ = "";
75   /**
76    *
77    *
78    * <pre>
79    * Required. The queue name. For example:
80    * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
81    * The queue must already exist.
82    * </pre>
83    *
84    * <code>
85    * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
86    * </code>
87    *
88    * @return The parent.
89    */
90   @java.lang.Override
getParent()91   public java.lang.String getParent() {
92     java.lang.Object ref = parent_;
93     if (ref instanceof java.lang.String) {
94       return (java.lang.String) ref;
95     } else {
96       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
97       java.lang.String s = bs.toStringUtf8();
98       parent_ = s;
99       return s;
100     }
101   }
102   /**
103    *
104    *
105    * <pre>
106    * Required. The queue name. For example:
107    * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
108    * The queue must already exist.
109    * </pre>
110    *
111    * <code>
112    * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
113    * </code>
114    *
115    * @return The bytes for parent.
116    */
117   @java.lang.Override
getParentBytes()118   public com.google.protobuf.ByteString getParentBytes() {
119     java.lang.Object ref = parent_;
120     if (ref instanceof java.lang.String) {
121       com.google.protobuf.ByteString b =
122           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
123       parent_ = b;
124       return b;
125     } else {
126       return (com.google.protobuf.ByteString) ref;
127     }
128   }
129 
130   public static final int TASK_FIELD_NUMBER = 2;
131   private com.google.cloud.tasks.v2.Task task_;
132   /**
133    *
134    *
135    * <pre>
136    * Required. The task to add.
137    * Task names have the following format:
138    * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
139    * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
140    * name is not specified then the system will generate a random
141    * unique task id, which will be set in the task returned in the
142    * [response][google.cloud.tasks.v2.Task.name].
143    * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
144    * past then Cloud Tasks will set it to the current time.
145    * Task De-duplication:
146    * Explicitly specifying a task ID enables task de-duplication.  If
147    * a task's ID is identical to that of an existing task or a task
148    * that was deleted or executed recently then the call will fail
149    * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
150    * If the task's queue was created using Cloud Tasks, then another task with
151    * the same name can't be created for ~1hour after the original task was
152    * deleted or executed. If the task's queue was created using queue.yaml or
153    * queue.xml, then another task with the same name can't be created
154    * for ~9days after the original task was deleted or executed.
155    * Because there is an extra lookup cost to identify duplicate task
156    * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
157    * increased latency. Using hashed strings for the task id or for
158    * the prefix of the task id is recommended. Choosing task ids that
159    * are sequential or have sequential prefixes, for example using a
160    * timestamp, causes an increase in latency and error rates in all
161    * task commands. The infrastructure relies on an approximately
162    * uniform distribution of task ids to store and serve tasks
163    * efficiently.
164    * </pre>
165    *
166    * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
167    *
168    * @return Whether the task field is set.
169    */
170   @java.lang.Override
hasTask()171   public boolean hasTask() {
172     return task_ != null;
173   }
174   /**
175    *
176    *
177    * <pre>
178    * Required. The task to add.
179    * Task names have the following format:
180    * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
181    * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
182    * name is not specified then the system will generate a random
183    * unique task id, which will be set in the task returned in the
184    * [response][google.cloud.tasks.v2.Task.name].
185    * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
186    * past then Cloud Tasks will set it to the current time.
187    * Task De-duplication:
188    * Explicitly specifying a task ID enables task de-duplication.  If
189    * a task's ID is identical to that of an existing task or a task
190    * that was deleted or executed recently then the call will fail
191    * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
192    * If the task's queue was created using Cloud Tasks, then another task with
193    * the same name can't be created for ~1hour after the original task was
194    * deleted or executed. If the task's queue was created using queue.yaml or
195    * queue.xml, then another task with the same name can't be created
196    * for ~9days after the original task was deleted or executed.
197    * Because there is an extra lookup cost to identify duplicate task
198    * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
199    * increased latency. Using hashed strings for the task id or for
200    * the prefix of the task id is recommended. Choosing task ids that
201    * are sequential or have sequential prefixes, for example using a
202    * timestamp, causes an increase in latency and error rates in all
203    * task commands. The infrastructure relies on an approximately
204    * uniform distribution of task ids to store and serve tasks
205    * efficiently.
206    * </pre>
207    *
208    * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
209    *
210    * @return The task.
211    */
212   @java.lang.Override
getTask()213   public com.google.cloud.tasks.v2.Task getTask() {
214     return task_ == null ? com.google.cloud.tasks.v2.Task.getDefaultInstance() : task_;
215   }
216   /**
217    *
218    *
219    * <pre>
220    * Required. The task to add.
221    * Task names have the following format:
222    * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
223    * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
224    * name is not specified then the system will generate a random
225    * unique task id, which will be set in the task returned in the
226    * [response][google.cloud.tasks.v2.Task.name].
227    * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
228    * past then Cloud Tasks will set it to the current time.
229    * Task De-duplication:
230    * Explicitly specifying a task ID enables task de-duplication.  If
231    * a task's ID is identical to that of an existing task or a task
232    * that was deleted or executed recently then the call will fail
233    * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
234    * If the task's queue was created using Cloud Tasks, then another task with
235    * the same name can't be created for ~1hour after the original task was
236    * deleted or executed. If the task's queue was created using queue.yaml or
237    * queue.xml, then another task with the same name can't be created
238    * for ~9days after the original task was deleted or executed.
239    * Because there is an extra lookup cost to identify duplicate task
240    * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
241    * increased latency. Using hashed strings for the task id or for
242    * the prefix of the task id is recommended. Choosing task ids that
243    * are sequential or have sequential prefixes, for example using a
244    * timestamp, causes an increase in latency and error rates in all
245    * task commands. The infrastructure relies on an approximately
246    * uniform distribution of task ids to store and serve tasks
247    * efficiently.
248    * </pre>
249    *
250    * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
251    */
252   @java.lang.Override
getTaskOrBuilder()253   public com.google.cloud.tasks.v2.TaskOrBuilder getTaskOrBuilder() {
254     return task_ == null ? com.google.cloud.tasks.v2.Task.getDefaultInstance() : task_;
255   }
256 
257   public static final int RESPONSE_VIEW_FIELD_NUMBER = 3;
258   private int responseView_ = 0;
259   /**
260    *
261    *
262    * <pre>
263    * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
264    * returned.
265    * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
266    * information is retrieved by default because some data, such as
267    * payloads, might be desirable to return only when needed because
268    * of its large size or because of the sensitivity of data that it
269    * contains.
270    * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
271    * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
272    * permission on the [Task][google.cloud.tasks.v2.Task] resource.
273    * </pre>
274    *
275    * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
276    *
277    * @return The enum numeric value on the wire for responseView.
278    */
279   @java.lang.Override
getResponseViewValue()280   public int getResponseViewValue() {
281     return responseView_;
282   }
283   /**
284    *
285    *
286    * <pre>
287    * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
288    * returned.
289    * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
290    * information is retrieved by default because some data, such as
291    * payloads, might be desirable to return only when needed because
292    * of its large size or because of the sensitivity of data that it
293    * contains.
294    * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
295    * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
296    * permission on the [Task][google.cloud.tasks.v2.Task] resource.
297    * </pre>
298    *
299    * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
300    *
301    * @return The responseView.
302    */
303   @java.lang.Override
getResponseView()304   public com.google.cloud.tasks.v2.Task.View getResponseView() {
305     com.google.cloud.tasks.v2.Task.View result =
306         com.google.cloud.tasks.v2.Task.View.forNumber(responseView_);
307     return result == null ? com.google.cloud.tasks.v2.Task.View.UNRECOGNIZED : result;
308   }
309 
310   private byte memoizedIsInitialized = -1;
311 
312   @java.lang.Override
isInitialized()313   public final boolean isInitialized() {
314     byte isInitialized = memoizedIsInitialized;
315     if (isInitialized == 1) return true;
316     if (isInitialized == 0) return false;
317 
318     memoizedIsInitialized = 1;
319     return true;
320   }
321 
322   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)323   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
324     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
325       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
326     }
327     if (task_ != null) {
328       output.writeMessage(2, getTask());
329     }
330     if (responseView_ != com.google.cloud.tasks.v2.Task.View.VIEW_UNSPECIFIED.getNumber()) {
331       output.writeEnum(3, responseView_);
332     }
333     getUnknownFields().writeTo(output);
334   }
335 
336   @java.lang.Override
getSerializedSize()337   public int getSerializedSize() {
338     int size = memoizedSize;
339     if (size != -1) return size;
340 
341     size = 0;
342     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
343       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
344     }
345     if (task_ != null) {
346       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTask());
347     }
348     if (responseView_ != com.google.cloud.tasks.v2.Task.View.VIEW_UNSPECIFIED.getNumber()) {
349       size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, responseView_);
350     }
351     size += getUnknownFields().getSerializedSize();
352     memoizedSize = size;
353     return size;
354   }
355 
356   @java.lang.Override
equals(final java.lang.Object obj)357   public boolean equals(final java.lang.Object obj) {
358     if (obj == this) {
359       return true;
360     }
361     if (!(obj instanceof com.google.cloud.tasks.v2.CreateTaskRequest)) {
362       return super.equals(obj);
363     }
364     com.google.cloud.tasks.v2.CreateTaskRequest other =
365         (com.google.cloud.tasks.v2.CreateTaskRequest) obj;
366 
367     if (!getParent().equals(other.getParent())) return false;
368     if (hasTask() != other.hasTask()) return false;
369     if (hasTask()) {
370       if (!getTask().equals(other.getTask())) return false;
371     }
372     if (responseView_ != other.responseView_) return false;
373     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
374     return true;
375   }
376 
377   @java.lang.Override
hashCode()378   public int hashCode() {
379     if (memoizedHashCode != 0) {
380       return memoizedHashCode;
381     }
382     int hash = 41;
383     hash = (19 * hash) + getDescriptor().hashCode();
384     hash = (37 * hash) + PARENT_FIELD_NUMBER;
385     hash = (53 * hash) + getParent().hashCode();
386     if (hasTask()) {
387       hash = (37 * hash) + TASK_FIELD_NUMBER;
388       hash = (53 * hash) + getTask().hashCode();
389     }
390     hash = (37 * hash) + RESPONSE_VIEW_FIELD_NUMBER;
391     hash = (53 * hash) + responseView_;
392     hash = (29 * hash) + getUnknownFields().hashCode();
393     memoizedHashCode = hash;
394     return hash;
395   }
396 
parseFrom(java.nio.ByteBuffer data)397   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(java.nio.ByteBuffer data)
398       throws com.google.protobuf.InvalidProtocolBufferException {
399     return PARSER.parseFrom(data);
400   }
401 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)402   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
403       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
404       throws com.google.protobuf.InvalidProtocolBufferException {
405     return PARSER.parseFrom(data, extensionRegistry);
406   }
407 
parseFrom( com.google.protobuf.ByteString data)408   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
409       com.google.protobuf.ByteString data)
410       throws com.google.protobuf.InvalidProtocolBufferException {
411     return PARSER.parseFrom(data);
412   }
413 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)414   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
415       com.google.protobuf.ByteString data,
416       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
417       throws com.google.protobuf.InvalidProtocolBufferException {
418     return PARSER.parseFrom(data, extensionRegistry);
419   }
420 
parseFrom(byte[] data)421   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(byte[] data)
422       throws com.google.protobuf.InvalidProtocolBufferException {
423     return PARSER.parseFrom(data);
424   }
425 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)426   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
427       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
428       throws com.google.protobuf.InvalidProtocolBufferException {
429     return PARSER.parseFrom(data, extensionRegistry);
430   }
431 
parseFrom(java.io.InputStream input)432   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(java.io.InputStream input)
433       throws java.io.IOException {
434     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
435   }
436 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)437   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
438       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
439       throws java.io.IOException {
440     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
441         PARSER, input, extensionRegistry);
442   }
443 
parseDelimitedFrom( java.io.InputStream input)444   public static com.google.cloud.tasks.v2.CreateTaskRequest parseDelimitedFrom(
445       java.io.InputStream input) throws java.io.IOException {
446     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
447   }
448 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)449   public static com.google.cloud.tasks.v2.CreateTaskRequest parseDelimitedFrom(
450       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
451       throws java.io.IOException {
452     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
453         PARSER, input, extensionRegistry);
454   }
455 
parseFrom( com.google.protobuf.CodedInputStream input)456   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
457       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
458     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
459   }
460 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)461   public static com.google.cloud.tasks.v2.CreateTaskRequest parseFrom(
462       com.google.protobuf.CodedInputStream input,
463       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
464       throws java.io.IOException {
465     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
466         PARSER, input, extensionRegistry);
467   }
468 
469   @java.lang.Override
newBuilderForType()470   public Builder newBuilderForType() {
471     return newBuilder();
472   }
473 
newBuilder()474   public static Builder newBuilder() {
475     return DEFAULT_INSTANCE.toBuilder();
476   }
477 
newBuilder(com.google.cloud.tasks.v2.CreateTaskRequest prototype)478   public static Builder newBuilder(com.google.cloud.tasks.v2.CreateTaskRequest prototype) {
479     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
480   }
481 
482   @java.lang.Override
toBuilder()483   public Builder toBuilder() {
484     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
485   }
486 
487   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)488   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
489     Builder builder = new Builder(parent);
490     return builder;
491   }
492   /**
493    *
494    *
495    * <pre>
496    * Request message for [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask].
497    * </pre>
498    *
499    * Protobuf type {@code google.cloud.tasks.v2.CreateTaskRequest}
500    */
501   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
502       implements
503       // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2.CreateTaskRequest)
504       com.google.cloud.tasks.v2.CreateTaskRequestOrBuilder {
getDescriptor()505     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
506       return com.google.cloud.tasks.v2.CloudTasksProto
507           .internal_static_google_cloud_tasks_v2_CreateTaskRequest_descriptor;
508     }
509 
510     @java.lang.Override
511     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()512         internalGetFieldAccessorTable() {
513       return com.google.cloud.tasks.v2.CloudTasksProto
514           .internal_static_google_cloud_tasks_v2_CreateTaskRequest_fieldAccessorTable
515           .ensureFieldAccessorsInitialized(
516               com.google.cloud.tasks.v2.CreateTaskRequest.class,
517               com.google.cloud.tasks.v2.CreateTaskRequest.Builder.class);
518     }
519 
520     // Construct using com.google.cloud.tasks.v2.CreateTaskRequest.newBuilder()
Builder()521     private Builder() {}
522 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)523     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
524       super(parent);
525     }
526 
527     @java.lang.Override
clear()528     public Builder clear() {
529       super.clear();
530       bitField0_ = 0;
531       parent_ = "";
532       task_ = null;
533       if (taskBuilder_ != null) {
534         taskBuilder_.dispose();
535         taskBuilder_ = null;
536       }
537       responseView_ = 0;
538       return this;
539     }
540 
541     @java.lang.Override
getDescriptorForType()542     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
543       return com.google.cloud.tasks.v2.CloudTasksProto
544           .internal_static_google_cloud_tasks_v2_CreateTaskRequest_descriptor;
545     }
546 
547     @java.lang.Override
getDefaultInstanceForType()548     public com.google.cloud.tasks.v2.CreateTaskRequest getDefaultInstanceForType() {
549       return com.google.cloud.tasks.v2.CreateTaskRequest.getDefaultInstance();
550     }
551 
552     @java.lang.Override
build()553     public com.google.cloud.tasks.v2.CreateTaskRequest build() {
554       com.google.cloud.tasks.v2.CreateTaskRequest result = buildPartial();
555       if (!result.isInitialized()) {
556         throw newUninitializedMessageException(result);
557       }
558       return result;
559     }
560 
561     @java.lang.Override
buildPartial()562     public com.google.cloud.tasks.v2.CreateTaskRequest buildPartial() {
563       com.google.cloud.tasks.v2.CreateTaskRequest result =
564           new com.google.cloud.tasks.v2.CreateTaskRequest(this);
565       if (bitField0_ != 0) {
566         buildPartial0(result);
567       }
568       onBuilt();
569       return result;
570     }
571 
buildPartial0(com.google.cloud.tasks.v2.CreateTaskRequest result)572     private void buildPartial0(com.google.cloud.tasks.v2.CreateTaskRequest result) {
573       int from_bitField0_ = bitField0_;
574       if (((from_bitField0_ & 0x00000001) != 0)) {
575         result.parent_ = parent_;
576       }
577       if (((from_bitField0_ & 0x00000002) != 0)) {
578         result.task_ = taskBuilder_ == null ? task_ : taskBuilder_.build();
579       }
580       if (((from_bitField0_ & 0x00000004) != 0)) {
581         result.responseView_ = responseView_;
582       }
583     }
584 
585     @java.lang.Override
clone()586     public Builder clone() {
587       return super.clone();
588     }
589 
590     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)591     public Builder setField(
592         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
593       return super.setField(field, value);
594     }
595 
596     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)597     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
598       return super.clearField(field);
599     }
600 
601     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)602     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
603       return super.clearOneof(oneof);
604     }
605 
606     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)607     public Builder setRepeatedField(
608         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
609       return super.setRepeatedField(field, index, value);
610     }
611 
612     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)613     public Builder addRepeatedField(
614         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
615       return super.addRepeatedField(field, value);
616     }
617 
618     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)619     public Builder mergeFrom(com.google.protobuf.Message other) {
620       if (other instanceof com.google.cloud.tasks.v2.CreateTaskRequest) {
621         return mergeFrom((com.google.cloud.tasks.v2.CreateTaskRequest) other);
622       } else {
623         super.mergeFrom(other);
624         return this;
625       }
626     }
627 
mergeFrom(com.google.cloud.tasks.v2.CreateTaskRequest other)628     public Builder mergeFrom(com.google.cloud.tasks.v2.CreateTaskRequest other) {
629       if (other == com.google.cloud.tasks.v2.CreateTaskRequest.getDefaultInstance()) return this;
630       if (!other.getParent().isEmpty()) {
631         parent_ = other.parent_;
632         bitField0_ |= 0x00000001;
633         onChanged();
634       }
635       if (other.hasTask()) {
636         mergeTask(other.getTask());
637       }
638       if (other.responseView_ != 0) {
639         setResponseViewValue(other.getResponseViewValue());
640       }
641       this.mergeUnknownFields(other.getUnknownFields());
642       onChanged();
643       return this;
644     }
645 
646     @java.lang.Override
isInitialized()647     public final boolean isInitialized() {
648       return true;
649     }
650 
651     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)652     public Builder mergeFrom(
653         com.google.protobuf.CodedInputStream input,
654         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
655         throws java.io.IOException {
656       if (extensionRegistry == null) {
657         throw new java.lang.NullPointerException();
658       }
659       try {
660         boolean done = false;
661         while (!done) {
662           int tag = input.readTag();
663           switch (tag) {
664             case 0:
665               done = true;
666               break;
667             case 10:
668               {
669                 parent_ = input.readStringRequireUtf8();
670                 bitField0_ |= 0x00000001;
671                 break;
672               } // case 10
673             case 18:
674               {
675                 input.readMessage(getTaskFieldBuilder().getBuilder(), extensionRegistry);
676                 bitField0_ |= 0x00000002;
677                 break;
678               } // case 18
679             case 24:
680               {
681                 responseView_ = input.readEnum();
682                 bitField0_ |= 0x00000004;
683                 break;
684               } // case 24
685             default:
686               {
687                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
688                   done = true; // was an endgroup tag
689                 }
690                 break;
691               } // default:
692           } // switch (tag)
693         } // while (!done)
694       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
695         throw e.unwrapIOException();
696       } finally {
697         onChanged();
698       } // finally
699       return this;
700     }
701 
702     private int bitField0_;
703 
704     private java.lang.Object parent_ = "";
705     /**
706      *
707      *
708      * <pre>
709      * Required. The queue name. For example:
710      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
711      * The queue must already exist.
712      * </pre>
713      *
714      * <code>
715      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
716      * </code>
717      *
718      * @return The parent.
719      */
getParent()720     public java.lang.String getParent() {
721       java.lang.Object ref = parent_;
722       if (!(ref instanceof java.lang.String)) {
723         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
724         java.lang.String s = bs.toStringUtf8();
725         parent_ = s;
726         return s;
727       } else {
728         return (java.lang.String) ref;
729       }
730     }
731     /**
732      *
733      *
734      * <pre>
735      * Required. The queue name. For example:
736      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
737      * The queue must already exist.
738      * </pre>
739      *
740      * <code>
741      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
742      * </code>
743      *
744      * @return The bytes for parent.
745      */
getParentBytes()746     public com.google.protobuf.ByteString getParentBytes() {
747       java.lang.Object ref = parent_;
748       if (ref instanceof String) {
749         com.google.protobuf.ByteString b =
750             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
751         parent_ = b;
752         return b;
753       } else {
754         return (com.google.protobuf.ByteString) ref;
755       }
756     }
757     /**
758      *
759      *
760      * <pre>
761      * Required. The queue name. For example:
762      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
763      * The queue must already exist.
764      * </pre>
765      *
766      * <code>
767      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
768      * </code>
769      *
770      * @param value The parent to set.
771      * @return This builder for chaining.
772      */
setParent(java.lang.String value)773     public Builder setParent(java.lang.String value) {
774       if (value == null) {
775         throw new NullPointerException();
776       }
777       parent_ = value;
778       bitField0_ |= 0x00000001;
779       onChanged();
780       return this;
781     }
782     /**
783      *
784      *
785      * <pre>
786      * Required. The queue name. For example:
787      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
788      * The queue must already exist.
789      * </pre>
790      *
791      * <code>
792      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
793      * </code>
794      *
795      * @return This builder for chaining.
796      */
clearParent()797     public Builder clearParent() {
798       parent_ = getDefaultInstance().getParent();
799       bitField0_ = (bitField0_ & ~0x00000001);
800       onChanged();
801       return this;
802     }
803     /**
804      *
805      *
806      * <pre>
807      * Required. The queue name. For example:
808      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
809      * The queue must already exist.
810      * </pre>
811      *
812      * <code>
813      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
814      * </code>
815      *
816      * @param value The bytes for parent to set.
817      * @return This builder for chaining.
818      */
setParentBytes(com.google.protobuf.ByteString value)819     public Builder setParentBytes(com.google.protobuf.ByteString value) {
820       if (value == null) {
821         throw new NullPointerException();
822       }
823       checkByteStringIsUtf8(value);
824       parent_ = value;
825       bitField0_ |= 0x00000001;
826       onChanged();
827       return this;
828     }
829 
830     private com.google.cloud.tasks.v2.Task task_;
831     private com.google.protobuf.SingleFieldBuilderV3<
832             com.google.cloud.tasks.v2.Task,
833             com.google.cloud.tasks.v2.Task.Builder,
834             com.google.cloud.tasks.v2.TaskOrBuilder>
835         taskBuilder_;
836     /**
837      *
838      *
839      * <pre>
840      * Required. The task to add.
841      * Task names have the following format:
842      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
843      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
844      * name is not specified then the system will generate a random
845      * unique task id, which will be set in the task returned in the
846      * [response][google.cloud.tasks.v2.Task.name].
847      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
848      * past then Cloud Tasks will set it to the current time.
849      * Task De-duplication:
850      * Explicitly specifying a task ID enables task de-duplication.  If
851      * a task's ID is identical to that of an existing task or a task
852      * that was deleted or executed recently then the call will fail
853      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
854      * If the task's queue was created using Cloud Tasks, then another task with
855      * the same name can't be created for ~1hour after the original task was
856      * deleted or executed. If the task's queue was created using queue.yaml or
857      * queue.xml, then another task with the same name can't be created
858      * for ~9days after the original task was deleted or executed.
859      * Because there is an extra lookup cost to identify duplicate task
860      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
861      * increased latency. Using hashed strings for the task id or for
862      * the prefix of the task id is recommended. Choosing task ids that
863      * are sequential or have sequential prefixes, for example using a
864      * timestamp, causes an increase in latency and error rates in all
865      * task commands. The infrastructure relies on an approximately
866      * uniform distribution of task ids to store and serve tasks
867      * efficiently.
868      * </pre>
869      *
870      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
871      *
872      * @return Whether the task field is set.
873      */
hasTask()874     public boolean hasTask() {
875       return ((bitField0_ & 0x00000002) != 0);
876     }
877     /**
878      *
879      *
880      * <pre>
881      * Required. The task to add.
882      * Task names have the following format:
883      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
884      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
885      * name is not specified then the system will generate a random
886      * unique task id, which will be set in the task returned in the
887      * [response][google.cloud.tasks.v2.Task.name].
888      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
889      * past then Cloud Tasks will set it to the current time.
890      * Task De-duplication:
891      * Explicitly specifying a task ID enables task de-duplication.  If
892      * a task's ID is identical to that of an existing task or a task
893      * that was deleted or executed recently then the call will fail
894      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
895      * If the task's queue was created using Cloud Tasks, then another task with
896      * the same name can't be created for ~1hour after the original task was
897      * deleted or executed. If the task's queue was created using queue.yaml or
898      * queue.xml, then another task with the same name can't be created
899      * for ~9days after the original task was deleted or executed.
900      * Because there is an extra lookup cost to identify duplicate task
901      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
902      * increased latency. Using hashed strings for the task id or for
903      * the prefix of the task id is recommended. Choosing task ids that
904      * are sequential or have sequential prefixes, for example using a
905      * timestamp, causes an increase in latency and error rates in all
906      * task commands. The infrastructure relies on an approximately
907      * uniform distribution of task ids to store and serve tasks
908      * efficiently.
909      * </pre>
910      *
911      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
912      *
913      * @return The task.
914      */
getTask()915     public com.google.cloud.tasks.v2.Task getTask() {
916       if (taskBuilder_ == null) {
917         return task_ == null ? com.google.cloud.tasks.v2.Task.getDefaultInstance() : task_;
918       } else {
919         return taskBuilder_.getMessage();
920       }
921     }
922     /**
923      *
924      *
925      * <pre>
926      * Required. The task to add.
927      * Task names have the following format:
928      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
929      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
930      * name is not specified then the system will generate a random
931      * unique task id, which will be set in the task returned in the
932      * [response][google.cloud.tasks.v2.Task.name].
933      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
934      * past then Cloud Tasks will set it to the current time.
935      * Task De-duplication:
936      * Explicitly specifying a task ID enables task de-duplication.  If
937      * a task's ID is identical to that of an existing task or a task
938      * that was deleted or executed recently then the call will fail
939      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
940      * If the task's queue was created using Cloud Tasks, then another task with
941      * the same name can't be created for ~1hour after the original task was
942      * deleted or executed. If the task's queue was created using queue.yaml or
943      * queue.xml, then another task with the same name can't be created
944      * for ~9days after the original task was deleted or executed.
945      * Because there is an extra lookup cost to identify duplicate task
946      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
947      * increased latency. Using hashed strings for the task id or for
948      * the prefix of the task id is recommended. Choosing task ids that
949      * are sequential or have sequential prefixes, for example using a
950      * timestamp, causes an increase in latency and error rates in all
951      * task commands. The infrastructure relies on an approximately
952      * uniform distribution of task ids to store and serve tasks
953      * efficiently.
954      * </pre>
955      *
956      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
957      */
setTask(com.google.cloud.tasks.v2.Task value)958     public Builder setTask(com.google.cloud.tasks.v2.Task value) {
959       if (taskBuilder_ == null) {
960         if (value == null) {
961           throw new NullPointerException();
962         }
963         task_ = value;
964       } else {
965         taskBuilder_.setMessage(value);
966       }
967       bitField0_ |= 0x00000002;
968       onChanged();
969       return this;
970     }
971     /**
972      *
973      *
974      * <pre>
975      * Required. The task to add.
976      * Task names have the following format:
977      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
978      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
979      * name is not specified then the system will generate a random
980      * unique task id, which will be set in the task returned in the
981      * [response][google.cloud.tasks.v2.Task.name].
982      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
983      * past then Cloud Tasks will set it to the current time.
984      * Task De-duplication:
985      * Explicitly specifying a task ID enables task de-duplication.  If
986      * a task's ID is identical to that of an existing task or a task
987      * that was deleted or executed recently then the call will fail
988      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
989      * If the task's queue was created using Cloud Tasks, then another task with
990      * the same name can't be created for ~1hour after the original task was
991      * deleted or executed. If the task's queue was created using queue.yaml or
992      * queue.xml, then another task with the same name can't be created
993      * for ~9days after the original task was deleted or executed.
994      * Because there is an extra lookup cost to identify duplicate task
995      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
996      * increased latency. Using hashed strings for the task id or for
997      * the prefix of the task id is recommended. Choosing task ids that
998      * are sequential or have sequential prefixes, for example using a
999      * timestamp, causes an increase in latency and error rates in all
1000      * task commands. The infrastructure relies on an approximately
1001      * uniform distribution of task ids to store and serve tasks
1002      * efficiently.
1003      * </pre>
1004      *
1005      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1006      */
setTask(com.google.cloud.tasks.v2.Task.Builder builderForValue)1007     public Builder setTask(com.google.cloud.tasks.v2.Task.Builder builderForValue) {
1008       if (taskBuilder_ == null) {
1009         task_ = builderForValue.build();
1010       } else {
1011         taskBuilder_.setMessage(builderForValue.build());
1012       }
1013       bitField0_ |= 0x00000002;
1014       onChanged();
1015       return this;
1016     }
1017     /**
1018      *
1019      *
1020      * <pre>
1021      * Required. The task to add.
1022      * Task names have the following format:
1023      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1024      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
1025      * name is not specified then the system will generate a random
1026      * unique task id, which will be set in the task returned in the
1027      * [response][google.cloud.tasks.v2.Task.name].
1028      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
1029      * past then Cloud Tasks will set it to the current time.
1030      * Task De-duplication:
1031      * Explicitly specifying a task ID enables task de-duplication.  If
1032      * a task's ID is identical to that of an existing task or a task
1033      * that was deleted or executed recently then the call will fail
1034      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1035      * If the task's queue was created using Cloud Tasks, then another task with
1036      * the same name can't be created for ~1hour after the original task was
1037      * deleted or executed. If the task's queue was created using queue.yaml or
1038      * queue.xml, then another task with the same name can't be created
1039      * for ~9days after the original task was deleted or executed.
1040      * Because there is an extra lookup cost to identify duplicate task
1041      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
1042      * increased latency. Using hashed strings for the task id or for
1043      * the prefix of the task id is recommended. Choosing task ids that
1044      * are sequential or have sequential prefixes, for example using a
1045      * timestamp, causes an increase in latency and error rates in all
1046      * task commands. The infrastructure relies on an approximately
1047      * uniform distribution of task ids to store and serve tasks
1048      * efficiently.
1049      * </pre>
1050      *
1051      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1052      */
mergeTask(com.google.cloud.tasks.v2.Task value)1053     public Builder mergeTask(com.google.cloud.tasks.v2.Task value) {
1054       if (taskBuilder_ == null) {
1055         if (((bitField0_ & 0x00000002) != 0)
1056             && task_ != null
1057             && task_ != com.google.cloud.tasks.v2.Task.getDefaultInstance()) {
1058           getTaskBuilder().mergeFrom(value);
1059         } else {
1060           task_ = value;
1061         }
1062       } else {
1063         taskBuilder_.mergeFrom(value);
1064       }
1065       bitField0_ |= 0x00000002;
1066       onChanged();
1067       return this;
1068     }
1069     /**
1070      *
1071      *
1072      * <pre>
1073      * Required. The task to add.
1074      * Task names have the following format:
1075      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1076      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
1077      * name is not specified then the system will generate a random
1078      * unique task id, which will be set in the task returned in the
1079      * [response][google.cloud.tasks.v2.Task.name].
1080      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
1081      * past then Cloud Tasks will set it to the current time.
1082      * Task De-duplication:
1083      * Explicitly specifying a task ID enables task de-duplication.  If
1084      * a task's ID is identical to that of an existing task or a task
1085      * that was deleted or executed recently then the call will fail
1086      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1087      * If the task's queue was created using Cloud Tasks, then another task with
1088      * the same name can't be created for ~1hour after the original task was
1089      * deleted or executed. If the task's queue was created using queue.yaml or
1090      * queue.xml, then another task with the same name can't be created
1091      * for ~9days after the original task was deleted or executed.
1092      * Because there is an extra lookup cost to identify duplicate task
1093      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
1094      * increased latency. Using hashed strings for the task id or for
1095      * the prefix of the task id is recommended. Choosing task ids that
1096      * are sequential or have sequential prefixes, for example using a
1097      * timestamp, causes an increase in latency and error rates in all
1098      * task commands. The infrastructure relies on an approximately
1099      * uniform distribution of task ids to store and serve tasks
1100      * efficiently.
1101      * </pre>
1102      *
1103      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1104      */
clearTask()1105     public Builder clearTask() {
1106       bitField0_ = (bitField0_ & ~0x00000002);
1107       task_ = null;
1108       if (taskBuilder_ != null) {
1109         taskBuilder_.dispose();
1110         taskBuilder_ = null;
1111       }
1112       onChanged();
1113       return this;
1114     }
1115     /**
1116      *
1117      *
1118      * <pre>
1119      * Required. The task to add.
1120      * Task names have the following format:
1121      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1122      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
1123      * name is not specified then the system will generate a random
1124      * unique task id, which will be set in the task returned in the
1125      * [response][google.cloud.tasks.v2.Task.name].
1126      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
1127      * past then Cloud Tasks will set it to the current time.
1128      * Task De-duplication:
1129      * Explicitly specifying a task ID enables task de-duplication.  If
1130      * a task's ID is identical to that of an existing task or a task
1131      * that was deleted or executed recently then the call will fail
1132      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1133      * If the task's queue was created using Cloud Tasks, then another task with
1134      * the same name can't be created for ~1hour after the original task was
1135      * deleted or executed. If the task's queue was created using queue.yaml or
1136      * queue.xml, then another task with the same name can't be created
1137      * for ~9days after the original task was deleted or executed.
1138      * Because there is an extra lookup cost to identify duplicate task
1139      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
1140      * increased latency. Using hashed strings for the task id or for
1141      * the prefix of the task id is recommended. Choosing task ids that
1142      * are sequential or have sequential prefixes, for example using a
1143      * timestamp, causes an increase in latency and error rates in all
1144      * task commands. The infrastructure relies on an approximately
1145      * uniform distribution of task ids to store and serve tasks
1146      * efficiently.
1147      * </pre>
1148      *
1149      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1150      */
getTaskBuilder()1151     public com.google.cloud.tasks.v2.Task.Builder getTaskBuilder() {
1152       bitField0_ |= 0x00000002;
1153       onChanged();
1154       return getTaskFieldBuilder().getBuilder();
1155     }
1156     /**
1157      *
1158      *
1159      * <pre>
1160      * Required. The task to add.
1161      * Task names have the following format:
1162      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1163      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
1164      * name is not specified then the system will generate a random
1165      * unique task id, which will be set in the task returned in the
1166      * [response][google.cloud.tasks.v2.Task.name].
1167      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
1168      * past then Cloud Tasks will set it to the current time.
1169      * Task De-duplication:
1170      * Explicitly specifying a task ID enables task de-duplication.  If
1171      * a task's ID is identical to that of an existing task or a task
1172      * that was deleted or executed recently then the call will fail
1173      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1174      * If the task's queue was created using Cloud Tasks, then another task with
1175      * the same name can't be created for ~1hour after the original task was
1176      * deleted or executed. If the task's queue was created using queue.yaml or
1177      * queue.xml, then another task with the same name can't be created
1178      * for ~9days after the original task was deleted or executed.
1179      * Because there is an extra lookup cost to identify duplicate task
1180      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
1181      * increased latency. Using hashed strings for the task id or for
1182      * the prefix of the task id is recommended. Choosing task ids that
1183      * are sequential or have sequential prefixes, for example using a
1184      * timestamp, causes an increase in latency and error rates in all
1185      * task commands. The infrastructure relies on an approximately
1186      * uniform distribution of task ids to store and serve tasks
1187      * efficiently.
1188      * </pre>
1189      *
1190      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1191      */
getTaskOrBuilder()1192     public com.google.cloud.tasks.v2.TaskOrBuilder getTaskOrBuilder() {
1193       if (taskBuilder_ != null) {
1194         return taskBuilder_.getMessageOrBuilder();
1195       } else {
1196         return task_ == null ? com.google.cloud.tasks.v2.Task.getDefaultInstance() : task_;
1197       }
1198     }
1199     /**
1200      *
1201      *
1202      * <pre>
1203      * Required. The task to add.
1204      * Task names have the following format:
1205      * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
1206      * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
1207      * name is not specified then the system will generate a random
1208      * unique task id, which will be set in the task returned in the
1209      * [response][google.cloud.tasks.v2.Task.name].
1210      * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
1211      * past then Cloud Tasks will set it to the current time.
1212      * Task De-duplication:
1213      * Explicitly specifying a task ID enables task de-duplication.  If
1214      * a task's ID is identical to that of an existing task or a task
1215      * that was deleted or executed recently then the call will fail
1216      * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
1217      * If the task's queue was created using Cloud Tasks, then another task with
1218      * the same name can't be created for ~1hour after the original task was
1219      * deleted or executed. If the task's queue was created using queue.yaml or
1220      * queue.xml, then another task with the same name can't be created
1221      * for ~9days after the original task was deleted or executed.
1222      * Because there is an extra lookup cost to identify duplicate task
1223      * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
1224      * increased latency. Using hashed strings for the task id or for
1225      * the prefix of the task id is recommended. Choosing task ids that
1226      * are sequential or have sequential prefixes, for example using a
1227      * timestamp, causes an increase in latency and error rates in all
1228      * task commands. The infrastructure relies on an approximately
1229      * uniform distribution of task ids to store and serve tasks
1230      * efficiently.
1231      * </pre>
1232      *
1233      * <code>.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1234      */
1235     private com.google.protobuf.SingleFieldBuilderV3<
1236             com.google.cloud.tasks.v2.Task,
1237             com.google.cloud.tasks.v2.Task.Builder,
1238             com.google.cloud.tasks.v2.TaskOrBuilder>
getTaskFieldBuilder()1239         getTaskFieldBuilder() {
1240       if (taskBuilder_ == null) {
1241         taskBuilder_ =
1242             new com.google.protobuf.SingleFieldBuilderV3<
1243                 com.google.cloud.tasks.v2.Task,
1244                 com.google.cloud.tasks.v2.Task.Builder,
1245                 com.google.cloud.tasks.v2.TaskOrBuilder>(
1246                 getTask(), getParentForChildren(), isClean());
1247         task_ = null;
1248       }
1249       return taskBuilder_;
1250     }
1251 
1252     private int responseView_ = 0;
1253     /**
1254      *
1255      *
1256      * <pre>
1257      * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
1258      * returned.
1259      * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
1260      * information is retrieved by default because some data, such as
1261      * payloads, might be desirable to return only when needed because
1262      * of its large size or because of the sensitivity of data that it
1263      * contains.
1264      * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
1265      * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1266      * permission on the [Task][google.cloud.tasks.v2.Task] resource.
1267      * </pre>
1268      *
1269      * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
1270      *
1271      * @return The enum numeric value on the wire for responseView.
1272      */
1273     @java.lang.Override
getResponseViewValue()1274     public int getResponseViewValue() {
1275       return responseView_;
1276     }
1277     /**
1278      *
1279      *
1280      * <pre>
1281      * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
1282      * returned.
1283      * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
1284      * information is retrieved by default because some data, such as
1285      * payloads, might be desirable to return only when needed because
1286      * of its large size or because of the sensitivity of data that it
1287      * contains.
1288      * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
1289      * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1290      * permission on the [Task][google.cloud.tasks.v2.Task] resource.
1291      * </pre>
1292      *
1293      * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
1294      *
1295      * @param value The enum numeric value on the wire for responseView to set.
1296      * @return This builder for chaining.
1297      */
setResponseViewValue(int value)1298     public Builder setResponseViewValue(int value) {
1299       responseView_ = value;
1300       bitField0_ |= 0x00000004;
1301       onChanged();
1302       return this;
1303     }
1304     /**
1305      *
1306      *
1307      * <pre>
1308      * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
1309      * returned.
1310      * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
1311      * information is retrieved by default because some data, such as
1312      * payloads, might be desirable to return only when needed because
1313      * of its large size or because of the sensitivity of data that it
1314      * contains.
1315      * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
1316      * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1317      * permission on the [Task][google.cloud.tasks.v2.Task] resource.
1318      * </pre>
1319      *
1320      * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
1321      *
1322      * @return The responseView.
1323      */
1324     @java.lang.Override
getResponseView()1325     public com.google.cloud.tasks.v2.Task.View getResponseView() {
1326       com.google.cloud.tasks.v2.Task.View result =
1327           com.google.cloud.tasks.v2.Task.View.forNumber(responseView_);
1328       return result == null ? com.google.cloud.tasks.v2.Task.View.UNRECOGNIZED : result;
1329     }
1330     /**
1331      *
1332      *
1333      * <pre>
1334      * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
1335      * returned.
1336      * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
1337      * information is retrieved by default because some data, such as
1338      * payloads, might be desirable to return only when needed because
1339      * of its large size or because of the sensitivity of data that it
1340      * contains.
1341      * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
1342      * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1343      * permission on the [Task][google.cloud.tasks.v2.Task] resource.
1344      * </pre>
1345      *
1346      * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
1347      *
1348      * @param value The responseView to set.
1349      * @return This builder for chaining.
1350      */
setResponseView(com.google.cloud.tasks.v2.Task.View value)1351     public Builder setResponseView(com.google.cloud.tasks.v2.Task.View value) {
1352       if (value == null) {
1353         throw new NullPointerException();
1354       }
1355       bitField0_ |= 0x00000004;
1356       responseView_ = value.getNumber();
1357       onChanged();
1358       return this;
1359     }
1360     /**
1361      *
1362      *
1363      * <pre>
1364      * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
1365      * returned.
1366      * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
1367      * information is retrieved by default because some data, such as
1368      * payloads, might be desirable to return only when needed because
1369      * of its large size or because of the sensitivity of data that it
1370      * contains.
1371      * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
1372      * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1373      * permission on the [Task][google.cloud.tasks.v2.Task] resource.
1374      * </pre>
1375      *
1376      * <code>.google.cloud.tasks.v2.Task.View response_view = 3;</code>
1377      *
1378      * @return This builder for chaining.
1379      */
clearResponseView()1380     public Builder clearResponseView() {
1381       bitField0_ = (bitField0_ & ~0x00000004);
1382       responseView_ = 0;
1383       onChanged();
1384       return this;
1385     }
1386 
1387     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1388     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1389       return super.setUnknownFields(unknownFields);
1390     }
1391 
1392     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1393     public final Builder mergeUnknownFields(
1394         final com.google.protobuf.UnknownFieldSet unknownFields) {
1395       return super.mergeUnknownFields(unknownFields);
1396     }
1397 
1398     // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2.CreateTaskRequest)
1399   }
1400 
1401   // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2.CreateTaskRequest)
1402   private static final com.google.cloud.tasks.v2.CreateTaskRequest DEFAULT_INSTANCE;
1403 
1404   static {
1405     DEFAULT_INSTANCE = new com.google.cloud.tasks.v2.CreateTaskRequest();
1406   }
1407 
getDefaultInstance()1408   public static com.google.cloud.tasks.v2.CreateTaskRequest getDefaultInstance() {
1409     return DEFAULT_INSTANCE;
1410   }
1411 
1412   private static final com.google.protobuf.Parser<CreateTaskRequest> PARSER =
1413       new com.google.protobuf.AbstractParser<CreateTaskRequest>() {
1414         @java.lang.Override
1415         public CreateTaskRequest parsePartialFrom(
1416             com.google.protobuf.CodedInputStream input,
1417             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1418             throws com.google.protobuf.InvalidProtocolBufferException {
1419           Builder builder = newBuilder();
1420           try {
1421             builder.mergeFrom(input, extensionRegistry);
1422           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1423             throw e.setUnfinishedMessage(builder.buildPartial());
1424           } catch (com.google.protobuf.UninitializedMessageException e) {
1425             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1426           } catch (java.io.IOException e) {
1427             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1428                 .setUnfinishedMessage(builder.buildPartial());
1429           }
1430           return builder.buildPartial();
1431         }
1432       };
1433 
parser()1434   public static com.google.protobuf.Parser<CreateTaskRequest> parser() {
1435     return PARSER;
1436   }
1437 
1438   @java.lang.Override
getParserForType()1439   public com.google.protobuf.Parser<CreateTaskRequest> getParserForType() {
1440     return PARSER;
1441   }
1442 
1443   @java.lang.Override
getDefaultInstanceForType()1444   public com.google.cloud.tasks.v2.CreateTaskRequest getDefaultInstanceForType() {
1445     return DEFAULT_INSTANCE;
1446   }
1447 }
1448