• 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/vision/v1/product_search_service.proto
18 
19 package com.google.cloud.vision.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request message for the `CreateProduct` method.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.vision.v1.CreateProductRequest}
29  */
30 public final class CreateProductRequest extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.CreateProductRequest)
33     CreateProductRequestOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use CreateProductRequest.newBuilder() to construct.
CreateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private CreateProductRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
CreateProductRequest()40   private CreateProductRequest() {
41     parent_ = "";
42     productId_ = "";
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new CreateProductRequest();
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.vision.v1.ProductSearchServiceProto
58         .internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.vision.v1.ProductSearchServiceProto
65         .internal_static_google_cloud_vision_v1_CreateProductRequest_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.vision.v1.CreateProductRequest.class,
68             com.google.cloud.vision.v1.CreateProductRequest.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 project in which the Product should be created.
80    * Format is
81    * `projects/PROJECT_ID/locations/LOC_ID`.
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 project in which the Product should be created.
107    * Format is
108    * `projects/PROJECT_ID/locations/LOC_ID`.
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 PRODUCT_FIELD_NUMBER = 2;
131   private com.google.cloud.vision.v1.Product product_;
132   /**
133    *
134    *
135    * <pre>
136    * Required. The product to create.
137    * </pre>
138    *
139    * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
140    * </code>
141    *
142    * @return Whether the product field is set.
143    */
144   @java.lang.Override
hasProduct()145   public boolean hasProduct() {
146     return product_ != null;
147   }
148   /**
149    *
150    *
151    * <pre>
152    * Required. The product to create.
153    * </pre>
154    *
155    * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
156    * </code>
157    *
158    * @return The product.
159    */
160   @java.lang.Override
getProduct()161   public com.google.cloud.vision.v1.Product getProduct() {
162     return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_;
163   }
164   /**
165    *
166    *
167    * <pre>
168    * Required. The product to create.
169    * </pre>
170    *
171    * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
172    * </code>
173    */
174   @java.lang.Override
getProductOrBuilder()175   public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() {
176     return product_ == null ? com.google.cloud.vision.v1.Product.getDefaultInstance() : product_;
177   }
178 
179   public static final int PRODUCT_ID_FIELD_NUMBER = 3;
180 
181   @SuppressWarnings("serial")
182   private volatile java.lang.Object productId_ = "";
183   /**
184    *
185    *
186    * <pre>
187    * A user-supplied resource id for this Product. If set, the server will
188    * attempt to use this value as the resource id. If it is already in use, an
189    * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
190    * long. It cannot contain the character `/`.
191    * </pre>
192    *
193    * <code>string product_id = 3;</code>
194    *
195    * @return The productId.
196    */
197   @java.lang.Override
getProductId()198   public java.lang.String getProductId() {
199     java.lang.Object ref = productId_;
200     if (ref instanceof java.lang.String) {
201       return (java.lang.String) ref;
202     } else {
203       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
204       java.lang.String s = bs.toStringUtf8();
205       productId_ = s;
206       return s;
207     }
208   }
209   /**
210    *
211    *
212    * <pre>
213    * A user-supplied resource id for this Product. If set, the server will
214    * attempt to use this value as the resource id. If it is already in use, an
215    * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
216    * long. It cannot contain the character `/`.
217    * </pre>
218    *
219    * <code>string product_id = 3;</code>
220    *
221    * @return The bytes for productId.
222    */
223   @java.lang.Override
getProductIdBytes()224   public com.google.protobuf.ByteString getProductIdBytes() {
225     java.lang.Object ref = productId_;
226     if (ref instanceof java.lang.String) {
227       com.google.protobuf.ByteString b =
228           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
229       productId_ = b;
230       return b;
231     } else {
232       return (com.google.protobuf.ByteString) ref;
233     }
234   }
235 
236   private byte memoizedIsInitialized = -1;
237 
238   @java.lang.Override
isInitialized()239   public final boolean isInitialized() {
240     byte isInitialized = memoizedIsInitialized;
241     if (isInitialized == 1) return true;
242     if (isInitialized == 0) return false;
243 
244     memoizedIsInitialized = 1;
245     return true;
246   }
247 
248   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)249   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
250     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
251       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
252     }
253     if (product_ != null) {
254       output.writeMessage(2, getProduct());
255     }
256     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) {
257       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_);
258     }
259     getUnknownFields().writeTo(output);
260   }
261 
262   @java.lang.Override
getSerializedSize()263   public int getSerializedSize() {
264     int size = memoizedSize;
265     if (size != -1) return size;
266 
267     size = 0;
268     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
269       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
270     }
271     if (product_ != null) {
272       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct());
273     }
274     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productId_)) {
275       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productId_);
276     }
277     size += getUnknownFields().getSerializedSize();
278     memoizedSize = size;
279     return size;
280   }
281 
282   @java.lang.Override
equals(final java.lang.Object obj)283   public boolean equals(final java.lang.Object obj) {
284     if (obj == this) {
285       return true;
286     }
287     if (!(obj instanceof com.google.cloud.vision.v1.CreateProductRequest)) {
288       return super.equals(obj);
289     }
290     com.google.cloud.vision.v1.CreateProductRequest other =
291         (com.google.cloud.vision.v1.CreateProductRequest) obj;
292 
293     if (!getParent().equals(other.getParent())) return false;
294     if (hasProduct() != other.hasProduct()) return false;
295     if (hasProduct()) {
296       if (!getProduct().equals(other.getProduct())) return false;
297     }
298     if (!getProductId().equals(other.getProductId())) return false;
299     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
300     return true;
301   }
302 
303   @java.lang.Override
hashCode()304   public int hashCode() {
305     if (memoizedHashCode != 0) {
306       return memoizedHashCode;
307     }
308     int hash = 41;
309     hash = (19 * hash) + getDescriptor().hashCode();
310     hash = (37 * hash) + PARENT_FIELD_NUMBER;
311     hash = (53 * hash) + getParent().hashCode();
312     if (hasProduct()) {
313       hash = (37 * hash) + PRODUCT_FIELD_NUMBER;
314       hash = (53 * hash) + getProduct().hashCode();
315     }
316     hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER;
317     hash = (53 * hash) + getProductId().hashCode();
318     hash = (29 * hash) + getUnknownFields().hashCode();
319     memoizedHashCode = hash;
320     return hash;
321   }
322 
parseFrom(java.nio.ByteBuffer data)323   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(java.nio.ByteBuffer data)
324       throws com.google.protobuf.InvalidProtocolBufferException {
325     return PARSER.parseFrom(data);
326   }
327 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)328   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
329       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
330       throws com.google.protobuf.InvalidProtocolBufferException {
331     return PARSER.parseFrom(data, extensionRegistry);
332   }
333 
parseFrom( com.google.protobuf.ByteString data)334   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
335       com.google.protobuf.ByteString data)
336       throws com.google.protobuf.InvalidProtocolBufferException {
337     return PARSER.parseFrom(data);
338   }
339 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)340   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
341       com.google.protobuf.ByteString data,
342       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
343       throws com.google.protobuf.InvalidProtocolBufferException {
344     return PARSER.parseFrom(data, extensionRegistry);
345   }
346 
parseFrom(byte[] data)347   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(byte[] data)
348       throws com.google.protobuf.InvalidProtocolBufferException {
349     return PARSER.parseFrom(data);
350   }
351 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)352   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
353       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
354       throws com.google.protobuf.InvalidProtocolBufferException {
355     return PARSER.parseFrom(data, extensionRegistry);
356   }
357 
parseFrom(java.io.InputStream input)358   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(java.io.InputStream input)
359       throws java.io.IOException {
360     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
361   }
362 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)363   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
364       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
365       throws java.io.IOException {
366     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
367         PARSER, input, extensionRegistry);
368   }
369 
parseDelimitedFrom( java.io.InputStream input)370   public static com.google.cloud.vision.v1.CreateProductRequest parseDelimitedFrom(
371       java.io.InputStream input) throws java.io.IOException {
372     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
373   }
374 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)375   public static com.google.cloud.vision.v1.CreateProductRequest parseDelimitedFrom(
376       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
377       throws java.io.IOException {
378     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
379         PARSER, input, extensionRegistry);
380   }
381 
parseFrom( com.google.protobuf.CodedInputStream input)382   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
383       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
384     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
385   }
386 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)387   public static com.google.cloud.vision.v1.CreateProductRequest parseFrom(
388       com.google.protobuf.CodedInputStream input,
389       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
390       throws java.io.IOException {
391     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
392         PARSER, input, extensionRegistry);
393   }
394 
395   @java.lang.Override
newBuilderForType()396   public Builder newBuilderForType() {
397     return newBuilder();
398   }
399 
newBuilder()400   public static Builder newBuilder() {
401     return DEFAULT_INSTANCE.toBuilder();
402   }
403 
newBuilder(com.google.cloud.vision.v1.CreateProductRequest prototype)404   public static Builder newBuilder(com.google.cloud.vision.v1.CreateProductRequest prototype) {
405     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
406   }
407 
408   @java.lang.Override
toBuilder()409   public Builder toBuilder() {
410     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
411   }
412 
413   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)414   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
415     Builder builder = new Builder(parent);
416     return builder;
417   }
418   /**
419    *
420    *
421    * <pre>
422    * Request message for the `CreateProduct` method.
423    * </pre>
424    *
425    * Protobuf type {@code google.cloud.vision.v1.CreateProductRequest}
426    */
427   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
428       implements
429       // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.CreateProductRequest)
430       com.google.cloud.vision.v1.CreateProductRequestOrBuilder {
getDescriptor()431     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
432       return com.google.cloud.vision.v1.ProductSearchServiceProto
433           .internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor;
434     }
435 
436     @java.lang.Override
437     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()438         internalGetFieldAccessorTable() {
439       return com.google.cloud.vision.v1.ProductSearchServiceProto
440           .internal_static_google_cloud_vision_v1_CreateProductRequest_fieldAccessorTable
441           .ensureFieldAccessorsInitialized(
442               com.google.cloud.vision.v1.CreateProductRequest.class,
443               com.google.cloud.vision.v1.CreateProductRequest.Builder.class);
444     }
445 
446     // Construct using com.google.cloud.vision.v1.CreateProductRequest.newBuilder()
Builder()447     private Builder() {}
448 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)449     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
450       super(parent);
451     }
452 
453     @java.lang.Override
clear()454     public Builder clear() {
455       super.clear();
456       bitField0_ = 0;
457       parent_ = "";
458       product_ = null;
459       if (productBuilder_ != null) {
460         productBuilder_.dispose();
461         productBuilder_ = null;
462       }
463       productId_ = "";
464       return this;
465     }
466 
467     @java.lang.Override
getDescriptorForType()468     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
469       return com.google.cloud.vision.v1.ProductSearchServiceProto
470           .internal_static_google_cloud_vision_v1_CreateProductRequest_descriptor;
471     }
472 
473     @java.lang.Override
getDefaultInstanceForType()474     public com.google.cloud.vision.v1.CreateProductRequest getDefaultInstanceForType() {
475       return com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance();
476     }
477 
478     @java.lang.Override
build()479     public com.google.cloud.vision.v1.CreateProductRequest build() {
480       com.google.cloud.vision.v1.CreateProductRequest result = buildPartial();
481       if (!result.isInitialized()) {
482         throw newUninitializedMessageException(result);
483       }
484       return result;
485     }
486 
487     @java.lang.Override
buildPartial()488     public com.google.cloud.vision.v1.CreateProductRequest buildPartial() {
489       com.google.cloud.vision.v1.CreateProductRequest result =
490           new com.google.cloud.vision.v1.CreateProductRequest(this);
491       if (bitField0_ != 0) {
492         buildPartial0(result);
493       }
494       onBuilt();
495       return result;
496     }
497 
buildPartial0(com.google.cloud.vision.v1.CreateProductRequest result)498     private void buildPartial0(com.google.cloud.vision.v1.CreateProductRequest result) {
499       int from_bitField0_ = bitField0_;
500       if (((from_bitField0_ & 0x00000001) != 0)) {
501         result.parent_ = parent_;
502       }
503       if (((from_bitField0_ & 0x00000002) != 0)) {
504         result.product_ = productBuilder_ == null ? product_ : productBuilder_.build();
505       }
506       if (((from_bitField0_ & 0x00000004) != 0)) {
507         result.productId_ = productId_;
508       }
509     }
510 
511     @java.lang.Override
clone()512     public Builder clone() {
513       return super.clone();
514     }
515 
516     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)517     public Builder setField(
518         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
519       return super.setField(field, value);
520     }
521 
522     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)523     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
524       return super.clearField(field);
525     }
526 
527     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)528     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
529       return super.clearOneof(oneof);
530     }
531 
532     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)533     public Builder setRepeatedField(
534         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
535       return super.setRepeatedField(field, index, value);
536     }
537 
538     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)539     public Builder addRepeatedField(
540         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
541       return super.addRepeatedField(field, value);
542     }
543 
544     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)545     public Builder mergeFrom(com.google.protobuf.Message other) {
546       if (other instanceof com.google.cloud.vision.v1.CreateProductRequest) {
547         return mergeFrom((com.google.cloud.vision.v1.CreateProductRequest) other);
548       } else {
549         super.mergeFrom(other);
550         return this;
551       }
552     }
553 
mergeFrom(com.google.cloud.vision.v1.CreateProductRequest other)554     public Builder mergeFrom(com.google.cloud.vision.v1.CreateProductRequest other) {
555       if (other == com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance())
556         return this;
557       if (!other.getParent().isEmpty()) {
558         parent_ = other.parent_;
559         bitField0_ |= 0x00000001;
560         onChanged();
561       }
562       if (other.hasProduct()) {
563         mergeProduct(other.getProduct());
564       }
565       if (!other.getProductId().isEmpty()) {
566         productId_ = other.productId_;
567         bitField0_ |= 0x00000004;
568         onChanged();
569       }
570       this.mergeUnknownFields(other.getUnknownFields());
571       onChanged();
572       return this;
573     }
574 
575     @java.lang.Override
isInitialized()576     public final boolean isInitialized() {
577       return true;
578     }
579 
580     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)581     public Builder mergeFrom(
582         com.google.protobuf.CodedInputStream input,
583         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
584         throws java.io.IOException {
585       if (extensionRegistry == null) {
586         throw new java.lang.NullPointerException();
587       }
588       try {
589         boolean done = false;
590         while (!done) {
591           int tag = input.readTag();
592           switch (tag) {
593             case 0:
594               done = true;
595               break;
596             case 10:
597               {
598                 parent_ = input.readStringRequireUtf8();
599                 bitField0_ |= 0x00000001;
600                 break;
601               } // case 10
602             case 18:
603               {
604                 input.readMessage(getProductFieldBuilder().getBuilder(), extensionRegistry);
605                 bitField0_ |= 0x00000002;
606                 break;
607               } // case 18
608             case 26:
609               {
610                 productId_ = input.readStringRequireUtf8();
611                 bitField0_ |= 0x00000004;
612                 break;
613               } // case 26
614             default:
615               {
616                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
617                   done = true; // was an endgroup tag
618                 }
619                 break;
620               } // default:
621           } // switch (tag)
622         } // while (!done)
623       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
624         throw e.unwrapIOException();
625       } finally {
626         onChanged();
627       } // finally
628       return this;
629     }
630 
631     private int bitField0_;
632 
633     private java.lang.Object parent_ = "";
634     /**
635      *
636      *
637      * <pre>
638      * Required. The project in which the Product should be created.
639      * Format is
640      * `projects/PROJECT_ID/locations/LOC_ID`.
641      * </pre>
642      *
643      * <code>
644      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
645      * </code>
646      *
647      * @return The parent.
648      */
getParent()649     public java.lang.String getParent() {
650       java.lang.Object ref = parent_;
651       if (!(ref instanceof java.lang.String)) {
652         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
653         java.lang.String s = bs.toStringUtf8();
654         parent_ = s;
655         return s;
656       } else {
657         return (java.lang.String) ref;
658       }
659     }
660     /**
661      *
662      *
663      * <pre>
664      * Required. The project in which the Product should be created.
665      * Format is
666      * `projects/PROJECT_ID/locations/LOC_ID`.
667      * </pre>
668      *
669      * <code>
670      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
671      * </code>
672      *
673      * @return The bytes for parent.
674      */
getParentBytes()675     public com.google.protobuf.ByteString getParentBytes() {
676       java.lang.Object ref = parent_;
677       if (ref instanceof String) {
678         com.google.protobuf.ByteString b =
679             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
680         parent_ = b;
681         return b;
682       } else {
683         return (com.google.protobuf.ByteString) ref;
684       }
685     }
686     /**
687      *
688      *
689      * <pre>
690      * Required. The project in which the Product should be created.
691      * Format is
692      * `projects/PROJECT_ID/locations/LOC_ID`.
693      * </pre>
694      *
695      * <code>
696      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
697      * </code>
698      *
699      * @param value The parent to set.
700      * @return This builder for chaining.
701      */
setParent(java.lang.String value)702     public Builder setParent(java.lang.String value) {
703       if (value == null) {
704         throw new NullPointerException();
705       }
706       parent_ = value;
707       bitField0_ |= 0x00000001;
708       onChanged();
709       return this;
710     }
711     /**
712      *
713      *
714      * <pre>
715      * Required. The project in which the Product should be created.
716      * Format is
717      * `projects/PROJECT_ID/locations/LOC_ID`.
718      * </pre>
719      *
720      * <code>
721      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
722      * </code>
723      *
724      * @return This builder for chaining.
725      */
clearParent()726     public Builder clearParent() {
727       parent_ = getDefaultInstance().getParent();
728       bitField0_ = (bitField0_ & ~0x00000001);
729       onChanged();
730       return this;
731     }
732     /**
733      *
734      *
735      * <pre>
736      * Required. The project in which the Product should be created.
737      * Format is
738      * `projects/PROJECT_ID/locations/LOC_ID`.
739      * </pre>
740      *
741      * <code>
742      * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
743      * </code>
744      *
745      * @param value The bytes for parent to set.
746      * @return This builder for chaining.
747      */
setParentBytes(com.google.protobuf.ByteString value)748     public Builder setParentBytes(com.google.protobuf.ByteString value) {
749       if (value == null) {
750         throw new NullPointerException();
751       }
752       checkByteStringIsUtf8(value);
753       parent_ = value;
754       bitField0_ |= 0x00000001;
755       onChanged();
756       return this;
757     }
758 
759     private com.google.cloud.vision.v1.Product product_;
760     private com.google.protobuf.SingleFieldBuilderV3<
761             com.google.cloud.vision.v1.Product,
762             com.google.cloud.vision.v1.Product.Builder,
763             com.google.cloud.vision.v1.ProductOrBuilder>
764         productBuilder_;
765     /**
766      *
767      *
768      * <pre>
769      * Required. The product to create.
770      * </pre>
771      *
772      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
773      * </code>
774      *
775      * @return Whether the product field is set.
776      */
hasProduct()777     public boolean hasProduct() {
778       return ((bitField0_ & 0x00000002) != 0);
779     }
780     /**
781      *
782      *
783      * <pre>
784      * Required. The product to create.
785      * </pre>
786      *
787      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
788      * </code>
789      *
790      * @return The product.
791      */
getProduct()792     public com.google.cloud.vision.v1.Product getProduct() {
793       if (productBuilder_ == null) {
794         return product_ == null
795             ? com.google.cloud.vision.v1.Product.getDefaultInstance()
796             : product_;
797       } else {
798         return productBuilder_.getMessage();
799       }
800     }
801     /**
802      *
803      *
804      * <pre>
805      * Required. The product to create.
806      * </pre>
807      *
808      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
809      * </code>
810      */
setProduct(com.google.cloud.vision.v1.Product value)811     public Builder setProduct(com.google.cloud.vision.v1.Product value) {
812       if (productBuilder_ == null) {
813         if (value == null) {
814           throw new NullPointerException();
815         }
816         product_ = value;
817       } else {
818         productBuilder_.setMessage(value);
819       }
820       bitField0_ |= 0x00000002;
821       onChanged();
822       return this;
823     }
824     /**
825      *
826      *
827      * <pre>
828      * Required. The product to create.
829      * </pre>
830      *
831      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
832      * </code>
833      */
setProduct(com.google.cloud.vision.v1.Product.Builder builderForValue)834     public Builder setProduct(com.google.cloud.vision.v1.Product.Builder builderForValue) {
835       if (productBuilder_ == null) {
836         product_ = builderForValue.build();
837       } else {
838         productBuilder_.setMessage(builderForValue.build());
839       }
840       bitField0_ |= 0x00000002;
841       onChanged();
842       return this;
843     }
844     /**
845      *
846      *
847      * <pre>
848      * Required. The product to create.
849      * </pre>
850      *
851      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
852      * </code>
853      */
mergeProduct(com.google.cloud.vision.v1.Product value)854     public Builder mergeProduct(com.google.cloud.vision.v1.Product value) {
855       if (productBuilder_ == null) {
856         if (((bitField0_ & 0x00000002) != 0)
857             && product_ != null
858             && product_ != com.google.cloud.vision.v1.Product.getDefaultInstance()) {
859           getProductBuilder().mergeFrom(value);
860         } else {
861           product_ = value;
862         }
863       } else {
864         productBuilder_.mergeFrom(value);
865       }
866       bitField0_ |= 0x00000002;
867       onChanged();
868       return this;
869     }
870     /**
871      *
872      *
873      * <pre>
874      * Required. The product to create.
875      * </pre>
876      *
877      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
878      * </code>
879      */
clearProduct()880     public Builder clearProduct() {
881       bitField0_ = (bitField0_ & ~0x00000002);
882       product_ = null;
883       if (productBuilder_ != null) {
884         productBuilder_.dispose();
885         productBuilder_ = null;
886       }
887       onChanged();
888       return this;
889     }
890     /**
891      *
892      *
893      * <pre>
894      * Required. The product to create.
895      * </pre>
896      *
897      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
898      * </code>
899      */
getProductBuilder()900     public com.google.cloud.vision.v1.Product.Builder getProductBuilder() {
901       bitField0_ |= 0x00000002;
902       onChanged();
903       return getProductFieldBuilder().getBuilder();
904     }
905     /**
906      *
907      *
908      * <pre>
909      * Required. The product to create.
910      * </pre>
911      *
912      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
913      * </code>
914      */
getProductOrBuilder()915     public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() {
916       if (productBuilder_ != null) {
917         return productBuilder_.getMessageOrBuilder();
918       } else {
919         return product_ == null
920             ? com.google.cloud.vision.v1.Product.getDefaultInstance()
921             : product_;
922       }
923     }
924     /**
925      *
926      *
927      * <pre>
928      * Required. The product to create.
929      * </pre>
930      *
931      * <code>.google.cloud.vision.v1.Product product = 2 [(.google.api.field_behavior) = REQUIRED];
932      * </code>
933      */
934     private com.google.protobuf.SingleFieldBuilderV3<
935             com.google.cloud.vision.v1.Product,
936             com.google.cloud.vision.v1.Product.Builder,
937             com.google.cloud.vision.v1.ProductOrBuilder>
getProductFieldBuilder()938         getProductFieldBuilder() {
939       if (productBuilder_ == null) {
940         productBuilder_ =
941             new com.google.protobuf.SingleFieldBuilderV3<
942                 com.google.cloud.vision.v1.Product,
943                 com.google.cloud.vision.v1.Product.Builder,
944                 com.google.cloud.vision.v1.ProductOrBuilder>(
945                 getProduct(), getParentForChildren(), isClean());
946         product_ = null;
947       }
948       return productBuilder_;
949     }
950 
951     private java.lang.Object productId_ = "";
952     /**
953      *
954      *
955      * <pre>
956      * A user-supplied resource id for this Product. If set, the server will
957      * attempt to use this value as the resource id. If it is already in use, an
958      * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
959      * long. It cannot contain the character `/`.
960      * </pre>
961      *
962      * <code>string product_id = 3;</code>
963      *
964      * @return The productId.
965      */
getProductId()966     public java.lang.String getProductId() {
967       java.lang.Object ref = productId_;
968       if (!(ref instanceof java.lang.String)) {
969         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
970         java.lang.String s = bs.toStringUtf8();
971         productId_ = s;
972         return s;
973       } else {
974         return (java.lang.String) ref;
975       }
976     }
977     /**
978      *
979      *
980      * <pre>
981      * A user-supplied resource id for this Product. If set, the server will
982      * attempt to use this value as the resource id. If it is already in use, an
983      * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
984      * long. It cannot contain the character `/`.
985      * </pre>
986      *
987      * <code>string product_id = 3;</code>
988      *
989      * @return The bytes for productId.
990      */
getProductIdBytes()991     public com.google.protobuf.ByteString getProductIdBytes() {
992       java.lang.Object ref = productId_;
993       if (ref instanceof String) {
994         com.google.protobuf.ByteString b =
995             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
996         productId_ = b;
997         return b;
998       } else {
999         return (com.google.protobuf.ByteString) ref;
1000       }
1001     }
1002     /**
1003      *
1004      *
1005      * <pre>
1006      * A user-supplied resource id for this Product. If set, the server will
1007      * attempt to use this value as the resource id. If it is already in use, an
1008      * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
1009      * long. It cannot contain the character `/`.
1010      * </pre>
1011      *
1012      * <code>string product_id = 3;</code>
1013      *
1014      * @param value The productId to set.
1015      * @return This builder for chaining.
1016      */
setProductId(java.lang.String value)1017     public Builder setProductId(java.lang.String value) {
1018       if (value == null) {
1019         throw new NullPointerException();
1020       }
1021       productId_ = value;
1022       bitField0_ |= 0x00000004;
1023       onChanged();
1024       return this;
1025     }
1026     /**
1027      *
1028      *
1029      * <pre>
1030      * A user-supplied resource id for this Product. If set, the server will
1031      * attempt to use this value as the resource id. If it is already in use, an
1032      * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
1033      * long. It cannot contain the character `/`.
1034      * </pre>
1035      *
1036      * <code>string product_id = 3;</code>
1037      *
1038      * @return This builder for chaining.
1039      */
clearProductId()1040     public Builder clearProductId() {
1041       productId_ = getDefaultInstance().getProductId();
1042       bitField0_ = (bitField0_ & ~0x00000004);
1043       onChanged();
1044       return this;
1045     }
1046     /**
1047      *
1048      *
1049      * <pre>
1050      * A user-supplied resource id for this Product. If set, the server will
1051      * attempt to use this value as the resource id. If it is already in use, an
1052      * error is returned with code ALREADY_EXISTS. Must be at most 128 characters
1053      * long. It cannot contain the character `/`.
1054      * </pre>
1055      *
1056      * <code>string product_id = 3;</code>
1057      *
1058      * @param value The bytes for productId to set.
1059      * @return This builder for chaining.
1060      */
setProductIdBytes(com.google.protobuf.ByteString value)1061     public Builder setProductIdBytes(com.google.protobuf.ByteString value) {
1062       if (value == null) {
1063         throw new NullPointerException();
1064       }
1065       checkByteStringIsUtf8(value);
1066       productId_ = value;
1067       bitField0_ |= 0x00000004;
1068       onChanged();
1069       return this;
1070     }
1071 
1072     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1073     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1074       return super.setUnknownFields(unknownFields);
1075     }
1076 
1077     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1078     public final Builder mergeUnknownFields(
1079         final com.google.protobuf.UnknownFieldSet unknownFields) {
1080       return super.mergeUnknownFields(unknownFields);
1081     }
1082 
1083     // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.CreateProductRequest)
1084   }
1085 
1086   // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CreateProductRequest)
1087   private static final com.google.cloud.vision.v1.CreateProductRequest DEFAULT_INSTANCE;
1088 
1089   static {
1090     DEFAULT_INSTANCE = new com.google.cloud.vision.v1.CreateProductRequest();
1091   }
1092 
getDefaultInstance()1093   public static com.google.cloud.vision.v1.CreateProductRequest getDefaultInstance() {
1094     return DEFAULT_INSTANCE;
1095   }
1096 
1097   private static final com.google.protobuf.Parser<CreateProductRequest> PARSER =
1098       new com.google.protobuf.AbstractParser<CreateProductRequest>() {
1099         @java.lang.Override
1100         public CreateProductRequest parsePartialFrom(
1101             com.google.protobuf.CodedInputStream input,
1102             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1103             throws com.google.protobuf.InvalidProtocolBufferException {
1104           Builder builder = newBuilder();
1105           try {
1106             builder.mergeFrom(input, extensionRegistry);
1107           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1108             throw e.setUnfinishedMessage(builder.buildPartial());
1109           } catch (com.google.protobuf.UninitializedMessageException e) {
1110             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1111           } catch (java.io.IOException e) {
1112             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1113                 .setUnfinishedMessage(builder.buildPartial());
1114           }
1115           return builder.buildPartial();
1116         }
1117       };
1118 
parser()1119   public static com.google.protobuf.Parser<CreateProductRequest> parser() {
1120     return PARSER;
1121   }
1122 
1123   @java.lang.Override
getParserForType()1124   public com.google.protobuf.Parser<CreateProductRequest> getParserForType() {
1125     return PARSER;
1126   }
1127 
1128   @java.lang.Override
getDefaultInstanceForType()1129   public com.google.cloud.vision.v1.CreateProductRequest getDefaultInstanceForType() {
1130     return DEFAULT_INSTANCE;
1131   }
1132 }
1133