• 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/webrisk/v1/webrisk.proto
18 
19 package com.google.webrisk.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request to return full hashes matched by the provided hash prefixes.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.webrisk.v1.SearchHashesRequest}
29  */
30 public final class SearchHashesRequest extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.webrisk.v1.SearchHashesRequest)
33     SearchHashesRequestOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use SearchHashesRequest.newBuilder() to construct.
SearchHashesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private SearchHashesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
SearchHashesRequest()40   private SearchHashesRequest() {
41     hashPrefix_ = com.google.protobuf.ByteString.EMPTY;
42     threatTypes_ = java.util.Collections.emptyList();
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new SearchHashesRequest();
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.webrisk.v1.WebRiskProto
58         .internal_static_google_cloud_webrisk_v1_SearchHashesRequest_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.webrisk.v1.WebRiskProto
65         .internal_static_google_cloud_webrisk_v1_SearchHashesRequest_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.webrisk.v1.SearchHashesRequest.class,
68             com.google.webrisk.v1.SearchHashesRequest.Builder.class);
69   }
70 
71   public static final int HASH_PREFIX_FIELD_NUMBER = 1;
72   private com.google.protobuf.ByteString hashPrefix_ = com.google.protobuf.ByteString.EMPTY;
73   /**
74    *
75    *
76    * <pre>
77    * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256
78    * hash. For JSON requests, this field is base64-encoded.
79    * Note that if this parameter is provided by a URI, it must be encoded using
80    * the web safe base64 variant (RFC 4648).
81    * </pre>
82    *
83    * <code>bytes hash_prefix = 1;</code>
84    *
85    * @return The hashPrefix.
86    */
87   @java.lang.Override
getHashPrefix()88   public com.google.protobuf.ByteString getHashPrefix() {
89     return hashPrefix_;
90   }
91 
92   public static final int THREAT_TYPES_FIELD_NUMBER = 2;
93 
94   @SuppressWarnings("serial")
95   private java.util.List<java.lang.Integer> threatTypes_;
96 
97   private static final com.google.protobuf.Internal.ListAdapter.Converter<
98           java.lang.Integer, com.google.webrisk.v1.ThreatType>
99       threatTypes_converter_ =
100           new com.google.protobuf.Internal.ListAdapter.Converter<
101               java.lang.Integer, com.google.webrisk.v1.ThreatType>() {
102             public com.google.webrisk.v1.ThreatType convert(java.lang.Integer from) {
103               com.google.webrisk.v1.ThreatType result =
104                   com.google.webrisk.v1.ThreatType.forNumber(from);
105               return result == null ? com.google.webrisk.v1.ThreatType.UNRECOGNIZED : result;
106             }
107           };
108   /**
109    *
110    *
111    * <pre>
112    * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
113    * </pre>
114    *
115    * <code>
116    * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
117    * </code>
118    *
119    * @return A list containing the threatTypes.
120    */
121   @java.lang.Override
getThreatTypesList()122   public java.util.List<com.google.webrisk.v1.ThreatType> getThreatTypesList() {
123     return new com.google.protobuf.Internal.ListAdapter<
124         java.lang.Integer, com.google.webrisk.v1.ThreatType>(threatTypes_, threatTypes_converter_);
125   }
126   /**
127    *
128    *
129    * <pre>
130    * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
131    * </pre>
132    *
133    * <code>
134    * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
135    * </code>
136    *
137    * @return The count of threatTypes.
138    */
139   @java.lang.Override
getThreatTypesCount()140   public int getThreatTypesCount() {
141     return threatTypes_.size();
142   }
143   /**
144    *
145    *
146    * <pre>
147    * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
148    * </pre>
149    *
150    * <code>
151    * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
152    * </code>
153    *
154    * @param index The index of the element to return.
155    * @return The threatTypes at the given index.
156    */
157   @java.lang.Override
getThreatTypes(int index)158   public com.google.webrisk.v1.ThreatType getThreatTypes(int index) {
159     return threatTypes_converter_.convert(threatTypes_.get(index));
160   }
161   /**
162    *
163    *
164    * <pre>
165    * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
166    * </pre>
167    *
168    * <code>
169    * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
170    * </code>
171    *
172    * @return A list containing the enum numeric values on the wire for threatTypes.
173    */
174   @java.lang.Override
getThreatTypesValueList()175   public java.util.List<java.lang.Integer> getThreatTypesValueList() {
176     return threatTypes_;
177   }
178   /**
179    *
180    *
181    * <pre>
182    * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
183    * </pre>
184    *
185    * <code>
186    * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
187    * </code>
188    *
189    * @param index The index of the value to return.
190    * @return The enum numeric value on the wire of threatTypes at the given index.
191    */
192   @java.lang.Override
getThreatTypesValue(int index)193   public int getThreatTypesValue(int index) {
194     return threatTypes_.get(index);
195   }
196 
197   private int threatTypesMemoizedSerializedSize;
198 
199   private byte memoizedIsInitialized = -1;
200 
201   @java.lang.Override
isInitialized()202   public final boolean isInitialized() {
203     byte isInitialized = memoizedIsInitialized;
204     if (isInitialized == 1) return true;
205     if (isInitialized == 0) return false;
206 
207     memoizedIsInitialized = 1;
208     return true;
209   }
210 
211   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)212   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
213     getSerializedSize();
214     if (!hashPrefix_.isEmpty()) {
215       output.writeBytes(1, hashPrefix_);
216     }
217     if (getThreatTypesList().size() > 0) {
218       output.writeUInt32NoTag(18);
219       output.writeUInt32NoTag(threatTypesMemoizedSerializedSize);
220     }
221     for (int i = 0; i < threatTypes_.size(); i++) {
222       output.writeEnumNoTag(threatTypes_.get(i));
223     }
224     getUnknownFields().writeTo(output);
225   }
226 
227   @java.lang.Override
getSerializedSize()228   public int getSerializedSize() {
229     int size = memoizedSize;
230     if (size != -1) return size;
231 
232     size = 0;
233     if (!hashPrefix_.isEmpty()) {
234       size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, hashPrefix_);
235     }
236     {
237       int dataSize = 0;
238       for (int i = 0; i < threatTypes_.size(); i++) {
239         dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(threatTypes_.get(i));
240       }
241       size += dataSize;
242       if (!getThreatTypesList().isEmpty()) {
243         size += 1;
244         size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
245       }
246       threatTypesMemoizedSerializedSize = dataSize;
247     }
248     size += getUnknownFields().getSerializedSize();
249     memoizedSize = size;
250     return size;
251   }
252 
253   @java.lang.Override
equals(final java.lang.Object obj)254   public boolean equals(final java.lang.Object obj) {
255     if (obj == this) {
256       return true;
257     }
258     if (!(obj instanceof com.google.webrisk.v1.SearchHashesRequest)) {
259       return super.equals(obj);
260     }
261     com.google.webrisk.v1.SearchHashesRequest other =
262         (com.google.webrisk.v1.SearchHashesRequest) obj;
263 
264     if (!getHashPrefix().equals(other.getHashPrefix())) return false;
265     if (!threatTypes_.equals(other.threatTypes_)) return false;
266     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
267     return true;
268   }
269 
270   @java.lang.Override
hashCode()271   public int hashCode() {
272     if (memoizedHashCode != 0) {
273       return memoizedHashCode;
274     }
275     int hash = 41;
276     hash = (19 * hash) + getDescriptor().hashCode();
277     hash = (37 * hash) + HASH_PREFIX_FIELD_NUMBER;
278     hash = (53 * hash) + getHashPrefix().hashCode();
279     if (getThreatTypesCount() > 0) {
280       hash = (37 * hash) + THREAT_TYPES_FIELD_NUMBER;
281       hash = (53 * hash) + threatTypes_.hashCode();
282     }
283     hash = (29 * hash) + getUnknownFields().hashCode();
284     memoizedHashCode = hash;
285     return hash;
286   }
287 
parseFrom(java.nio.ByteBuffer data)288   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(java.nio.ByteBuffer data)
289       throws com.google.protobuf.InvalidProtocolBufferException {
290     return PARSER.parseFrom(data);
291   }
292 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)293   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
294       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
295       throws com.google.protobuf.InvalidProtocolBufferException {
296     return PARSER.parseFrom(data, extensionRegistry);
297   }
298 
parseFrom( com.google.protobuf.ByteString data)299   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
300       com.google.protobuf.ByteString data)
301       throws com.google.protobuf.InvalidProtocolBufferException {
302     return PARSER.parseFrom(data);
303   }
304 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)305   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
306       com.google.protobuf.ByteString data,
307       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
308       throws com.google.protobuf.InvalidProtocolBufferException {
309     return PARSER.parseFrom(data, extensionRegistry);
310   }
311 
parseFrom(byte[] data)312   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(byte[] data)
313       throws com.google.protobuf.InvalidProtocolBufferException {
314     return PARSER.parseFrom(data);
315   }
316 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)317   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
318       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
319       throws com.google.protobuf.InvalidProtocolBufferException {
320     return PARSER.parseFrom(data, extensionRegistry);
321   }
322 
parseFrom(java.io.InputStream input)323   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(java.io.InputStream input)
324       throws java.io.IOException {
325     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
326   }
327 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)328   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
329       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
330       throws java.io.IOException {
331     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
332         PARSER, input, extensionRegistry);
333   }
334 
parseDelimitedFrom( java.io.InputStream input)335   public static com.google.webrisk.v1.SearchHashesRequest parseDelimitedFrom(
336       java.io.InputStream input) throws java.io.IOException {
337     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
338   }
339 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)340   public static com.google.webrisk.v1.SearchHashesRequest parseDelimitedFrom(
341       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
342       throws java.io.IOException {
343     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
344         PARSER, input, extensionRegistry);
345   }
346 
parseFrom( com.google.protobuf.CodedInputStream input)347   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
348       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
349     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
350   }
351 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)352   public static com.google.webrisk.v1.SearchHashesRequest parseFrom(
353       com.google.protobuf.CodedInputStream input,
354       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
355       throws java.io.IOException {
356     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
357         PARSER, input, extensionRegistry);
358   }
359 
360   @java.lang.Override
newBuilderForType()361   public Builder newBuilderForType() {
362     return newBuilder();
363   }
364 
newBuilder()365   public static Builder newBuilder() {
366     return DEFAULT_INSTANCE.toBuilder();
367   }
368 
newBuilder(com.google.webrisk.v1.SearchHashesRequest prototype)369   public static Builder newBuilder(com.google.webrisk.v1.SearchHashesRequest prototype) {
370     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
371   }
372 
373   @java.lang.Override
toBuilder()374   public Builder toBuilder() {
375     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
376   }
377 
378   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)379   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
380     Builder builder = new Builder(parent);
381     return builder;
382   }
383   /**
384    *
385    *
386    * <pre>
387    * Request to return full hashes matched by the provided hash prefixes.
388    * </pre>
389    *
390    * Protobuf type {@code google.cloud.webrisk.v1.SearchHashesRequest}
391    */
392   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
393       implements
394       // @@protoc_insertion_point(builder_implements:google.cloud.webrisk.v1.SearchHashesRequest)
395       com.google.webrisk.v1.SearchHashesRequestOrBuilder {
getDescriptor()396     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
397       return com.google.webrisk.v1.WebRiskProto
398           .internal_static_google_cloud_webrisk_v1_SearchHashesRequest_descriptor;
399     }
400 
401     @java.lang.Override
402     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()403         internalGetFieldAccessorTable() {
404       return com.google.webrisk.v1.WebRiskProto
405           .internal_static_google_cloud_webrisk_v1_SearchHashesRequest_fieldAccessorTable
406           .ensureFieldAccessorsInitialized(
407               com.google.webrisk.v1.SearchHashesRequest.class,
408               com.google.webrisk.v1.SearchHashesRequest.Builder.class);
409     }
410 
411     // Construct using com.google.webrisk.v1.SearchHashesRequest.newBuilder()
Builder()412     private Builder() {}
413 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)414     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
415       super(parent);
416     }
417 
418     @java.lang.Override
clear()419     public Builder clear() {
420       super.clear();
421       bitField0_ = 0;
422       hashPrefix_ = com.google.protobuf.ByteString.EMPTY;
423       threatTypes_ = java.util.Collections.emptyList();
424       bitField0_ = (bitField0_ & ~0x00000002);
425       return this;
426     }
427 
428     @java.lang.Override
getDescriptorForType()429     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
430       return com.google.webrisk.v1.WebRiskProto
431           .internal_static_google_cloud_webrisk_v1_SearchHashesRequest_descriptor;
432     }
433 
434     @java.lang.Override
getDefaultInstanceForType()435     public com.google.webrisk.v1.SearchHashesRequest getDefaultInstanceForType() {
436       return com.google.webrisk.v1.SearchHashesRequest.getDefaultInstance();
437     }
438 
439     @java.lang.Override
build()440     public com.google.webrisk.v1.SearchHashesRequest build() {
441       com.google.webrisk.v1.SearchHashesRequest result = buildPartial();
442       if (!result.isInitialized()) {
443         throw newUninitializedMessageException(result);
444       }
445       return result;
446     }
447 
448     @java.lang.Override
buildPartial()449     public com.google.webrisk.v1.SearchHashesRequest buildPartial() {
450       com.google.webrisk.v1.SearchHashesRequest result =
451           new com.google.webrisk.v1.SearchHashesRequest(this);
452       buildPartialRepeatedFields(result);
453       if (bitField0_ != 0) {
454         buildPartial0(result);
455       }
456       onBuilt();
457       return result;
458     }
459 
buildPartialRepeatedFields(com.google.webrisk.v1.SearchHashesRequest result)460     private void buildPartialRepeatedFields(com.google.webrisk.v1.SearchHashesRequest result) {
461       if (((bitField0_ & 0x00000002) != 0)) {
462         threatTypes_ = java.util.Collections.unmodifiableList(threatTypes_);
463         bitField0_ = (bitField0_ & ~0x00000002);
464       }
465       result.threatTypes_ = threatTypes_;
466     }
467 
buildPartial0(com.google.webrisk.v1.SearchHashesRequest result)468     private void buildPartial0(com.google.webrisk.v1.SearchHashesRequest result) {
469       int from_bitField0_ = bitField0_;
470       if (((from_bitField0_ & 0x00000001) != 0)) {
471         result.hashPrefix_ = hashPrefix_;
472       }
473     }
474 
475     @java.lang.Override
clone()476     public Builder clone() {
477       return super.clone();
478     }
479 
480     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)481     public Builder setField(
482         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
483       return super.setField(field, value);
484     }
485 
486     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)487     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
488       return super.clearField(field);
489     }
490 
491     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)492     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
493       return super.clearOneof(oneof);
494     }
495 
496     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)497     public Builder setRepeatedField(
498         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
499       return super.setRepeatedField(field, index, value);
500     }
501 
502     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)503     public Builder addRepeatedField(
504         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
505       return super.addRepeatedField(field, value);
506     }
507 
508     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)509     public Builder mergeFrom(com.google.protobuf.Message other) {
510       if (other instanceof com.google.webrisk.v1.SearchHashesRequest) {
511         return mergeFrom((com.google.webrisk.v1.SearchHashesRequest) other);
512       } else {
513         super.mergeFrom(other);
514         return this;
515       }
516     }
517 
mergeFrom(com.google.webrisk.v1.SearchHashesRequest other)518     public Builder mergeFrom(com.google.webrisk.v1.SearchHashesRequest other) {
519       if (other == com.google.webrisk.v1.SearchHashesRequest.getDefaultInstance()) return this;
520       if (other.getHashPrefix() != com.google.protobuf.ByteString.EMPTY) {
521         setHashPrefix(other.getHashPrefix());
522       }
523       if (!other.threatTypes_.isEmpty()) {
524         if (threatTypes_.isEmpty()) {
525           threatTypes_ = other.threatTypes_;
526           bitField0_ = (bitField0_ & ~0x00000002);
527         } else {
528           ensureThreatTypesIsMutable();
529           threatTypes_.addAll(other.threatTypes_);
530         }
531         onChanged();
532       }
533       this.mergeUnknownFields(other.getUnknownFields());
534       onChanged();
535       return this;
536     }
537 
538     @java.lang.Override
isInitialized()539     public final boolean isInitialized() {
540       return true;
541     }
542 
543     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)544     public Builder mergeFrom(
545         com.google.protobuf.CodedInputStream input,
546         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
547         throws java.io.IOException {
548       if (extensionRegistry == null) {
549         throw new java.lang.NullPointerException();
550       }
551       try {
552         boolean done = false;
553         while (!done) {
554           int tag = input.readTag();
555           switch (tag) {
556             case 0:
557               done = true;
558               break;
559             case 10:
560               {
561                 hashPrefix_ = input.readBytes();
562                 bitField0_ |= 0x00000001;
563                 break;
564               } // case 10
565             case 16:
566               {
567                 int tmpRaw = input.readEnum();
568                 ensureThreatTypesIsMutable();
569                 threatTypes_.add(tmpRaw);
570                 break;
571               } // case 16
572             case 18:
573               {
574                 int length = input.readRawVarint32();
575                 int oldLimit = input.pushLimit(length);
576                 while (input.getBytesUntilLimit() > 0) {
577                   int tmpRaw = input.readEnum();
578                   ensureThreatTypesIsMutable();
579                   threatTypes_.add(tmpRaw);
580                 }
581                 input.popLimit(oldLimit);
582                 break;
583               } // case 18
584             default:
585               {
586                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
587                   done = true; // was an endgroup tag
588                 }
589                 break;
590               } // default:
591           } // switch (tag)
592         } // while (!done)
593       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
594         throw e.unwrapIOException();
595       } finally {
596         onChanged();
597       } // finally
598       return this;
599     }
600 
601     private int bitField0_;
602 
603     private com.google.protobuf.ByteString hashPrefix_ = com.google.protobuf.ByteString.EMPTY;
604     /**
605      *
606      *
607      * <pre>
608      * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256
609      * hash. For JSON requests, this field is base64-encoded.
610      * Note that if this parameter is provided by a URI, it must be encoded using
611      * the web safe base64 variant (RFC 4648).
612      * </pre>
613      *
614      * <code>bytes hash_prefix = 1;</code>
615      *
616      * @return The hashPrefix.
617      */
618     @java.lang.Override
getHashPrefix()619     public com.google.protobuf.ByteString getHashPrefix() {
620       return hashPrefix_;
621     }
622     /**
623      *
624      *
625      * <pre>
626      * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256
627      * hash. For JSON requests, this field is base64-encoded.
628      * Note that if this parameter is provided by a URI, it must be encoded using
629      * the web safe base64 variant (RFC 4648).
630      * </pre>
631      *
632      * <code>bytes hash_prefix = 1;</code>
633      *
634      * @param value The hashPrefix to set.
635      * @return This builder for chaining.
636      */
setHashPrefix(com.google.protobuf.ByteString value)637     public Builder setHashPrefix(com.google.protobuf.ByteString value) {
638       if (value == null) {
639         throw new NullPointerException();
640       }
641       hashPrefix_ = value;
642       bitField0_ |= 0x00000001;
643       onChanged();
644       return this;
645     }
646     /**
647      *
648      *
649      * <pre>
650      * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256
651      * hash. For JSON requests, this field is base64-encoded.
652      * Note that if this parameter is provided by a URI, it must be encoded using
653      * the web safe base64 variant (RFC 4648).
654      * </pre>
655      *
656      * <code>bytes hash_prefix = 1;</code>
657      *
658      * @return This builder for chaining.
659      */
clearHashPrefix()660     public Builder clearHashPrefix() {
661       bitField0_ = (bitField0_ & ~0x00000001);
662       hashPrefix_ = getDefaultInstance().getHashPrefix();
663       onChanged();
664       return this;
665     }
666 
667     private java.util.List<java.lang.Integer> threatTypes_ = java.util.Collections.emptyList();
668 
ensureThreatTypesIsMutable()669     private void ensureThreatTypesIsMutable() {
670       if (!((bitField0_ & 0x00000002) != 0)) {
671         threatTypes_ = new java.util.ArrayList<java.lang.Integer>(threatTypes_);
672         bitField0_ |= 0x00000002;
673       }
674     }
675     /**
676      *
677      *
678      * <pre>
679      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
680      * </pre>
681      *
682      * <code>
683      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
684      * </code>
685      *
686      * @return A list containing the threatTypes.
687      */
getThreatTypesList()688     public java.util.List<com.google.webrisk.v1.ThreatType> getThreatTypesList() {
689       return new com.google.protobuf.Internal.ListAdapter<
690           java.lang.Integer, com.google.webrisk.v1.ThreatType>(
691           threatTypes_, threatTypes_converter_);
692     }
693     /**
694      *
695      *
696      * <pre>
697      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
698      * </pre>
699      *
700      * <code>
701      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
702      * </code>
703      *
704      * @return The count of threatTypes.
705      */
getThreatTypesCount()706     public int getThreatTypesCount() {
707       return threatTypes_.size();
708     }
709     /**
710      *
711      *
712      * <pre>
713      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
714      * </pre>
715      *
716      * <code>
717      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
718      * </code>
719      *
720      * @param index The index of the element to return.
721      * @return The threatTypes at the given index.
722      */
getThreatTypes(int index)723     public com.google.webrisk.v1.ThreatType getThreatTypes(int index) {
724       return threatTypes_converter_.convert(threatTypes_.get(index));
725     }
726     /**
727      *
728      *
729      * <pre>
730      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
731      * </pre>
732      *
733      * <code>
734      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
735      * </code>
736      *
737      * @param index The index to set the value at.
738      * @param value The threatTypes to set.
739      * @return This builder for chaining.
740      */
setThreatTypes(int index, com.google.webrisk.v1.ThreatType value)741     public Builder setThreatTypes(int index, com.google.webrisk.v1.ThreatType value) {
742       if (value == null) {
743         throw new NullPointerException();
744       }
745       ensureThreatTypesIsMutable();
746       threatTypes_.set(index, value.getNumber());
747       onChanged();
748       return this;
749     }
750     /**
751      *
752      *
753      * <pre>
754      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
755      * </pre>
756      *
757      * <code>
758      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
759      * </code>
760      *
761      * @param value The threatTypes to add.
762      * @return This builder for chaining.
763      */
addThreatTypes(com.google.webrisk.v1.ThreatType value)764     public Builder addThreatTypes(com.google.webrisk.v1.ThreatType value) {
765       if (value == null) {
766         throw new NullPointerException();
767       }
768       ensureThreatTypesIsMutable();
769       threatTypes_.add(value.getNumber());
770       onChanged();
771       return this;
772     }
773     /**
774      *
775      *
776      * <pre>
777      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
778      * </pre>
779      *
780      * <code>
781      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
782      * </code>
783      *
784      * @param values The threatTypes to add.
785      * @return This builder for chaining.
786      */
addAllThreatTypes( java.lang.Iterable<? extends com.google.webrisk.v1.ThreatType> values)787     public Builder addAllThreatTypes(
788         java.lang.Iterable<? extends com.google.webrisk.v1.ThreatType> values) {
789       ensureThreatTypesIsMutable();
790       for (com.google.webrisk.v1.ThreatType value : values) {
791         threatTypes_.add(value.getNumber());
792       }
793       onChanged();
794       return this;
795     }
796     /**
797      *
798      *
799      * <pre>
800      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
801      * </pre>
802      *
803      * <code>
804      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
805      * </code>
806      *
807      * @return This builder for chaining.
808      */
clearThreatTypes()809     public Builder clearThreatTypes() {
810       threatTypes_ = java.util.Collections.emptyList();
811       bitField0_ = (bitField0_ & ~0x00000002);
812       onChanged();
813       return this;
814     }
815     /**
816      *
817      *
818      * <pre>
819      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
820      * </pre>
821      *
822      * <code>
823      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
824      * </code>
825      *
826      * @return A list containing the enum numeric values on the wire for threatTypes.
827      */
getThreatTypesValueList()828     public java.util.List<java.lang.Integer> getThreatTypesValueList() {
829       return java.util.Collections.unmodifiableList(threatTypes_);
830     }
831     /**
832      *
833      *
834      * <pre>
835      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
836      * </pre>
837      *
838      * <code>
839      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
840      * </code>
841      *
842      * @param index The index of the value to return.
843      * @return The enum numeric value on the wire of threatTypes at the given index.
844      */
getThreatTypesValue(int index)845     public int getThreatTypesValue(int index) {
846       return threatTypes_.get(index);
847     }
848     /**
849      *
850      *
851      * <pre>
852      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
853      * </pre>
854      *
855      * <code>
856      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
857      * </code>
858      *
859      * @param index The index to set the value at.
860      * @param value The enum numeric value on the wire for threatTypes to set.
861      * @return This builder for chaining.
862      */
setThreatTypesValue(int index, int value)863     public Builder setThreatTypesValue(int index, int value) {
864       ensureThreatTypesIsMutable();
865       threatTypes_.set(index, value);
866       onChanged();
867       return this;
868     }
869     /**
870      *
871      *
872      * <pre>
873      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
874      * </pre>
875      *
876      * <code>
877      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
878      * </code>
879      *
880      * @param value The enum numeric value on the wire for threatTypes to add.
881      * @return This builder for chaining.
882      */
addThreatTypesValue(int value)883     public Builder addThreatTypesValue(int value) {
884       ensureThreatTypesIsMutable();
885       threatTypes_.add(value);
886       onChanged();
887       return this;
888     }
889     /**
890      *
891      *
892      * <pre>
893      * Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
894      * </pre>
895      *
896      * <code>
897      * repeated .google.cloud.webrisk.v1.ThreatType threat_types = 2 [(.google.api.field_behavior) = REQUIRED];
898      * </code>
899      *
900      * @param values The enum numeric values on the wire for threatTypes to add.
901      * @return This builder for chaining.
902      */
addAllThreatTypesValue(java.lang.Iterable<java.lang.Integer> values)903     public Builder addAllThreatTypesValue(java.lang.Iterable<java.lang.Integer> values) {
904       ensureThreatTypesIsMutable();
905       for (int value : values) {
906         threatTypes_.add(value);
907       }
908       onChanged();
909       return this;
910     }
911 
912     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)913     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
914       return super.setUnknownFields(unknownFields);
915     }
916 
917     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)918     public final Builder mergeUnknownFields(
919         final com.google.protobuf.UnknownFieldSet unknownFields) {
920       return super.mergeUnknownFields(unknownFields);
921     }
922 
923     // @@protoc_insertion_point(builder_scope:google.cloud.webrisk.v1.SearchHashesRequest)
924   }
925 
926   // @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1.SearchHashesRequest)
927   private static final com.google.webrisk.v1.SearchHashesRequest DEFAULT_INSTANCE;
928 
929   static {
930     DEFAULT_INSTANCE = new com.google.webrisk.v1.SearchHashesRequest();
931   }
932 
getDefaultInstance()933   public static com.google.webrisk.v1.SearchHashesRequest getDefaultInstance() {
934     return DEFAULT_INSTANCE;
935   }
936 
937   private static final com.google.protobuf.Parser<SearchHashesRequest> PARSER =
938       new com.google.protobuf.AbstractParser<SearchHashesRequest>() {
939         @java.lang.Override
940         public SearchHashesRequest parsePartialFrom(
941             com.google.protobuf.CodedInputStream input,
942             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
943             throws com.google.protobuf.InvalidProtocolBufferException {
944           Builder builder = newBuilder();
945           try {
946             builder.mergeFrom(input, extensionRegistry);
947           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
948             throw e.setUnfinishedMessage(builder.buildPartial());
949           } catch (com.google.protobuf.UninitializedMessageException e) {
950             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
951           } catch (java.io.IOException e) {
952             throw new com.google.protobuf.InvalidProtocolBufferException(e)
953                 .setUnfinishedMessage(builder.buildPartial());
954           }
955           return builder.buildPartial();
956         }
957       };
958 
parser()959   public static com.google.protobuf.Parser<SearchHashesRequest> parser() {
960     return PARSER;
961   }
962 
963   @java.lang.Override
getParserForType()964   public com.google.protobuf.Parser<SearchHashesRequest> getParserForType() {
965     return PARSER;
966   }
967 
968   @java.lang.Override
getDefaultInstanceForType()969   public com.google.webrisk.v1.SearchHashesRequest getDefaultInstanceForType() {
970     return DEFAULT_INSTANCE;
971   }
972 }
973