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