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