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 * UserEvent captures all metadata information Retail API needs to know about 26 * how end users interact with customers' website. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.retail.v2.UserEvent} 30 */ 31 public final class UserEvent extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.UserEvent) 34 UserEventOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use UserEvent.newBuilder() to construct. UserEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private UserEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 UserEvent()41 private UserEvent() { 42 eventType_ = ""; 43 visitorId_ = ""; 44 sessionId_ = ""; 45 experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; 46 attributionToken_ = ""; 47 productDetails_ = java.util.Collections.emptyList(); 48 cartId_ = ""; 49 searchQuery_ = ""; 50 filter_ = ""; 51 orderBy_ = ""; 52 pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; 53 uri_ = ""; 54 referrerUri_ = ""; 55 pageViewId_ = ""; 56 entity_ = ""; 57 } 58 59 @java.lang.Override 60 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)61 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 62 return new UserEvent(); 63 } 64 65 @java.lang.Override getUnknownFields()66 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 67 return this.unknownFields; 68 } 69 getDescriptor()70 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 71 return com.google.cloud.retail.v2.UserEventProto 72 .internal_static_google_cloud_retail_v2_UserEvent_descriptor; 73 } 74 75 @SuppressWarnings({"rawtypes"}) 76 @java.lang.Override internalGetMapField(int number)77 protected com.google.protobuf.MapField internalGetMapField(int number) { 78 switch (number) { 79 case 7: 80 return internalGetAttributes(); 81 default: 82 throw new RuntimeException("Invalid map field number: " + number); 83 } 84 } 85 86 @java.lang.Override 87 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()88 internalGetFieldAccessorTable() { 89 return com.google.cloud.retail.v2.UserEventProto 90 .internal_static_google_cloud_retail_v2_UserEvent_fieldAccessorTable 91 .ensureFieldAccessorsInitialized( 92 com.google.cloud.retail.v2.UserEvent.class, 93 com.google.cloud.retail.v2.UserEvent.Builder.class); 94 } 95 96 public static final int EVENT_TYPE_FIELD_NUMBER = 1; 97 98 @SuppressWarnings("serial") 99 private volatile java.lang.Object eventType_ = ""; 100 /** 101 * 102 * 103 * <pre> 104 * Required. User event type. Allowed values are: 105 * * `add-to-cart`: Products being added to cart. 106 * * `category-page-view`: Special pages such as sale or promotion pages 107 * viewed. 108 * * `detail-page-view`: Products detail page viewed. 109 * * `home-page-view`: Homepage viewed. 110 * * `promotion-offered`: Promotion is offered to a user. 111 * * `promotion-not-offered`: Promotion is not offered to a user. 112 * * `purchase-complete`: User finishing a purchase. 113 * * `search`: Product search. 114 * * `shopping-cart-page-view`: User viewing a shopping cart. 115 * </pre> 116 * 117 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 118 * 119 * @return The eventType. 120 */ 121 @java.lang.Override getEventType()122 public java.lang.String getEventType() { 123 java.lang.Object ref = eventType_; 124 if (ref instanceof java.lang.String) { 125 return (java.lang.String) ref; 126 } else { 127 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 128 java.lang.String s = bs.toStringUtf8(); 129 eventType_ = s; 130 return s; 131 } 132 } 133 /** 134 * 135 * 136 * <pre> 137 * Required. User event type. Allowed values are: 138 * * `add-to-cart`: Products being added to cart. 139 * * `category-page-view`: Special pages such as sale or promotion pages 140 * viewed. 141 * * `detail-page-view`: Products detail page viewed. 142 * * `home-page-view`: Homepage viewed. 143 * * `promotion-offered`: Promotion is offered to a user. 144 * * `promotion-not-offered`: Promotion is not offered to a user. 145 * * `purchase-complete`: User finishing a purchase. 146 * * `search`: Product search. 147 * * `shopping-cart-page-view`: User viewing a shopping cart. 148 * </pre> 149 * 150 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 151 * 152 * @return The bytes for eventType. 153 */ 154 @java.lang.Override getEventTypeBytes()155 public com.google.protobuf.ByteString getEventTypeBytes() { 156 java.lang.Object ref = eventType_; 157 if (ref instanceof java.lang.String) { 158 com.google.protobuf.ByteString b = 159 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 160 eventType_ = b; 161 return b; 162 } else { 163 return (com.google.protobuf.ByteString) ref; 164 } 165 } 166 167 public static final int VISITOR_ID_FIELD_NUMBER = 2; 168 169 @SuppressWarnings("serial") 170 private volatile java.lang.Object visitorId_ = ""; 171 /** 172 * 173 * 174 * <pre> 175 * Required. A unique identifier for tracking visitors. 176 * For example, this could be implemented with an HTTP cookie, which should be 177 * able to uniquely identify a visitor on a single device. This unique 178 * identifier should not change if the visitor log in/out of the website. 179 * Don't set the field to the same fixed ID for different users. This mixes 180 * the event history of those users together, which results in degraded model 181 * quality. 182 * The field must be a UTF-8 encoded string with a length limit of 128 183 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 184 * The field should not contain PII or user-data. We recommend to use Google 185 * Analytics [Client 186 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 187 * for this field. 188 * </pre> 189 * 190 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 191 * 192 * @return The visitorId. 193 */ 194 @java.lang.Override getVisitorId()195 public java.lang.String getVisitorId() { 196 java.lang.Object ref = visitorId_; 197 if (ref instanceof java.lang.String) { 198 return (java.lang.String) ref; 199 } else { 200 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 201 java.lang.String s = bs.toStringUtf8(); 202 visitorId_ = s; 203 return s; 204 } 205 } 206 /** 207 * 208 * 209 * <pre> 210 * Required. A unique identifier for tracking visitors. 211 * For example, this could be implemented with an HTTP cookie, which should be 212 * able to uniquely identify a visitor on a single device. This unique 213 * identifier should not change if the visitor log in/out of the website. 214 * Don't set the field to the same fixed ID for different users. This mixes 215 * the event history of those users together, which results in degraded model 216 * quality. 217 * The field must be a UTF-8 encoded string with a length limit of 128 218 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 219 * The field should not contain PII or user-data. We recommend to use Google 220 * Analytics [Client 221 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 222 * for this field. 223 * </pre> 224 * 225 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 226 * 227 * @return The bytes for visitorId. 228 */ 229 @java.lang.Override getVisitorIdBytes()230 public com.google.protobuf.ByteString getVisitorIdBytes() { 231 java.lang.Object ref = visitorId_; 232 if (ref instanceof java.lang.String) { 233 com.google.protobuf.ByteString b = 234 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 235 visitorId_ = b; 236 return b; 237 } else { 238 return (com.google.protobuf.ByteString) ref; 239 } 240 } 241 242 public static final int SESSION_ID_FIELD_NUMBER = 21; 243 244 @SuppressWarnings("serial") 245 private volatile java.lang.Object sessionId_ = ""; 246 /** 247 * 248 * 249 * <pre> 250 * A unique identifier for tracking a visitor session with a length limit of 251 * 128 bytes. A session is an aggregation of an end user behavior in a time 252 * span. 253 * A general guideline to populate the sesion_id: 254 * 1. If user has no activity for 30 min, a new session_id should be assigned. 255 * 2. The session_id should be unique across users, suggest use uuid or add 256 * visitor_id as prefix. 257 * </pre> 258 * 259 * <code>string session_id = 21;</code> 260 * 261 * @return The sessionId. 262 */ 263 @java.lang.Override getSessionId()264 public java.lang.String getSessionId() { 265 java.lang.Object ref = sessionId_; 266 if (ref instanceof java.lang.String) { 267 return (java.lang.String) ref; 268 } else { 269 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 270 java.lang.String s = bs.toStringUtf8(); 271 sessionId_ = s; 272 return s; 273 } 274 } 275 /** 276 * 277 * 278 * <pre> 279 * A unique identifier for tracking a visitor session with a length limit of 280 * 128 bytes. A session is an aggregation of an end user behavior in a time 281 * span. 282 * A general guideline to populate the sesion_id: 283 * 1. If user has no activity for 30 min, a new session_id should be assigned. 284 * 2. The session_id should be unique across users, suggest use uuid or add 285 * visitor_id as prefix. 286 * </pre> 287 * 288 * <code>string session_id = 21;</code> 289 * 290 * @return The bytes for sessionId. 291 */ 292 @java.lang.Override getSessionIdBytes()293 public com.google.protobuf.ByteString getSessionIdBytes() { 294 java.lang.Object ref = sessionId_; 295 if (ref instanceof java.lang.String) { 296 com.google.protobuf.ByteString b = 297 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 298 sessionId_ = b; 299 return b; 300 } else { 301 return (com.google.protobuf.ByteString) ref; 302 } 303 } 304 305 public static final int EVENT_TIME_FIELD_NUMBER = 3; 306 private com.google.protobuf.Timestamp eventTime_; 307 /** 308 * 309 * 310 * <pre> 311 * Only required for 312 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 313 * method. Timestamp of when the user event happened. 314 * </pre> 315 * 316 * <code>.google.protobuf.Timestamp event_time = 3;</code> 317 * 318 * @return Whether the eventTime field is set. 319 */ 320 @java.lang.Override hasEventTime()321 public boolean hasEventTime() { 322 return eventTime_ != null; 323 } 324 /** 325 * 326 * 327 * <pre> 328 * Only required for 329 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 330 * method. Timestamp of when the user event happened. 331 * </pre> 332 * 333 * <code>.google.protobuf.Timestamp event_time = 3;</code> 334 * 335 * @return The eventTime. 336 */ 337 @java.lang.Override getEventTime()338 public com.google.protobuf.Timestamp getEventTime() { 339 return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; 340 } 341 /** 342 * 343 * 344 * <pre> 345 * Only required for 346 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 347 * method. Timestamp of when the user event happened. 348 * </pre> 349 * 350 * <code>.google.protobuf.Timestamp event_time = 3;</code> 351 */ 352 @java.lang.Override getEventTimeOrBuilder()353 public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { 354 return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; 355 } 356 357 public static final int EXPERIMENT_IDS_FIELD_NUMBER = 4; 358 359 @SuppressWarnings("serial") 360 private com.google.protobuf.LazyStringList experimentIds_; 361 /** 362 * 363 * 364 * <pre> 365 * A list of identifiers for the independent experiment groups this user event 366 * belongs to. This is used to distinguish between user events associated with 367 * different experiment setups (e.g. using Retail API, using different 368 * recommendation models). 369 * </pre> 370 * 371 * <code>repeated string experiment_ids = 4;</code> 372 * 373 * @return A list containing the experimentIds. 374 */ getExperimentIdsList()375 public com.google.protobuf.ProtocolStringList getExperimentIdsList() { 376 return experimentIds_; 377 } 378 /** 379 * 380 * 381 * <pre> 382 * A list of identifiers for the independent experiment groups this user event 383 * belongs to. This is used to distinguish between user events associated with 384 * different experiment setups (e.g. using Retail API, using different 385 * recommendation models). 386 * </pre> 387 * 388 * <code>repeated string experiment_ids = 4;</code> 389 * 390 * @return The count of experimentIds. 391 */ getExperimentIdsCount()392 public int getExperimentIdsCount() { 393 return experimentIds_.size(); 394 } 395 /** 396 * 397 * 398 * <pre> 399 * A list of identifiers for the independent experiment groups this user event 400 * belongs to. This is used to distinguish between user events associated with 401 * different experiment setups (e.g. using Retail API, using different 402 * recommendation models). 403 * </pre> 404 * 405 * <code>repeated string experiment_ids = 4;</code> 406 * 407 * @param index The index of the element to return. 408 * @return The experimentIds at the given index. 409 */ getExperimentIds(int index)410 public java.lang.String getExperimentIds(int index) { 411 return experimentIds_.get(index); 412 } 413 /** 414 * 415 * 416 * <pre> 417 * A list of identifiers for the independent experiment groups this user event 418 * belongs to. This is used to distinguish between user events associated with 419 * different experiment setups (e.g. using Retail API, using different 420 * recommendation models). 421 * </pre> 422 * 423 * <code>repeated string experiment_ids = 4;</code> 424 * 425 * @param index The index of the value to return. 426 * @return The bytes of the experimentIds at the given index. 427 */ getExperimentIdsBytes(int index)428 public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { 429 return experimentIds_.getByteString(index); 430 } 431 432 public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; 433 434 @SuppressWarnings("serial") 435 private volatile java.lang.Object attributionToken_ = ""; 436 /** 437 * 438 * 439 * <pre> 440 * Highly recommended for user events that are the result of 441 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 442 * This field enables accurate attribution of recommendation model 443 * performance. 444 * The value must be a valid 445 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 446 * for user events that are the result of 447 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 448 * The value must be a valid 449 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 450 * for user events that are the result of 451 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 452 * This token enables us to accurately attribute page view or purchase back to 453 * the event and the particular predict response containing this 454 * clicked/purchased product. If user clicks on product K in the 455 * recommendation results, pass 456 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 457 * as a URL parameter to product K's page. When recording events on product 458 * K's page, log the 459 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 460 * to this field. 461 * </pre> 462 * 463 * <code>string attribution_token = 5;</code> 464 * 465 * @return The attributionToken. 466 */ 467 @java.lang.Override getAttributionToken()468 public java.lang.String getAttributionToken() { 469 java.lang.Object ref = attributionToken_; 470 if (ref instanceof java.lang.String) { 471 return (java.lang.String) ref; 472 } else { 473 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 474 java.lang.String s = bs.toStringUtf8(); 475 attributionToken_ = s; 476 return s; 477 } 478 } 479 /** 480 * 481 * 482 * <pre> 483 * Highly recommended for user events that are the result of 484 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 485 * This field enables accurate attribution of recommendation model 486 * performance. 487 * The value must be a valid 488 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 489 * for user events that are the result of 490 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 491 * The value must be a valid 492 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 493 * for user events that are the result of 494 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 495 * This token enables us to accurately attribute page view or purchase back to 496 * the event and the particular predict response containing this 497 * clicked/purchased product. If user clicks on product K in the 498 * recommendation results, pass 499 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 500 * as a URL parameter to product K's page. When recording events on product 501 * K's page, log the 502 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 503 * to this field. 504 * </pre> 505 * 506 * <code>string attribution_token = 5;</code> 507 * 508 * @return The bytes for attributionToken. 509 */ 510 @java.lang.Override getAttributionTokenBytes()511 public com.google.protobuf.ByteString getAttributionTokenBytes() { 512 java.lang.Object ref = attributionToken_; 513 if (ref instanceof java.lang.String) { 514 com.google.protobuf.ByteString b = 515 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 516 attributionToken_ = b; 517 return b; 518 } else { 519 return (com.google.protobuf.ByteString) ref; 520 } 521 } 522 523 public static final int PRODUCT_DETAILS_FIELD_NUMBER = 6; 524 525 @SuppressWarnings("serial") 526 private java.util.List<com.google.cloud.retail.v2.ProductDetail> productDetails_; 527 /** 528 * 529 * 530 * <pre> 531 * The main product details related to the event. 532 * This field is optional except for the following event types: 533 * * `add-to-cart` 534 * * `detail-page-view` 535 * * `purchase-complete` 536 * In a `search` event, this field represents the products returned to the end 537 * user on the current page (the end user may have not finished browsing the 538 * whole page yet). When a new page is returned to the end user, after 539 * pagination/filtering/ordering even for the same query, a new `search` event 540 * with different 541 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 542 * desired. The end user may have not finished browsing the whole page yet. 543 * </pre> 544 * 545 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 546 */ 547 @java.lang.Override getProductDetailsList()548 public java.util.List<com.google.cloud.retail.v2.ProductDetail> getProductDetailsList() { 549 return productDetails_; 550 } 551 /** 552 * 553 * 554 * <pre> 555 * The main product details related to the event. 556 * This field is optional except for the following event types: 557 * * `add-to-cart` 558 * * `detail-page-view` 559 * * `purchase-complete` 560 * In a `search` event, this field represents the products returned to the end 561 * user on the current page (the end user may have not finished browsing the 562 * whole page yet). When a new page is returned to the end user, after 563 * pagination/filtering/ordering even for the same query, a new `search` event 564 * with different 565 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 566 * desired. The end user may have not finished browsing the whole page yet. 567 * </pre> 568 * 569 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 570 */ 571 @java.lang.Override 572 public java.util.List<? extends com.google.cloud.retail.v2.ProductDetailOrBuilder> getProductDetailsOrBuilderList()573 getProductDetailsOrBuilderList() { 574 return productDetails_; 575 } 576 /** 577 * 578 * 579 * <pre> 580 * The main product details related to the event. 581 * This field is optional except for the following event types: 582 * * `add-to-cart` 583 * * `detail-page-view` 584 * * `purchase-complete` 585 * In a `search` event, this field represents the products returned to the end 586 * user on the current page (the end user may have not finished browsing the 587 * whole page yet). When a new page is returned to the end user, after 588 * pagination/filtering/ordering even for the same query, a new `search` event 589 * with different 590 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 591 * desired. The end user may have not finished browsing the whole page yet. 592 * </pre> 593 * 594 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 595 */ 596 @java.lang.Override getProductDetailsCount()597 public int getProductDetailsCount() { 598 return productDetails_.size(); 599 } 600 /** 601 * 602 * 603 * <pre> 604 * The main product details related to the event. 605 * This field is optional except for the following event types: 606 * * `add-to-cart` 607 * * `detail-page-view` 608 * * `purchase-complete` 609 * In a `search` event, this field represents the products returned to the end 610 * user on the current page (the end user may have not finished browsing the 611 * whole page yet). When a new page is returned to the end user, after 612 * pagination/filtering/ordering even for the same query, a new `search` event 613 * with different 614 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 615 * desired. The end user may have not finished browsing the whole page yet. 616 * </pre> 617 * 618 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 619 */ 620 @java.lang.Override getProductDetails(int index)621 public com.google.cloud.retail.v2.ProductDetail getProductDetails(int index) { 622 return productDetails_.get(index); 623 } 624 /** 625 * 626 * 627 * <pre> 628 * The main product details related to the event. 629 * This field is optional except for the following event types: 630 * * `add-to-cart` 631 * * `detail-page-view` 632 * * `purchase-complete` 633 * In a `search` event, this field represents the products returned to the end 634 * user on the current page (the end user may have not finished browsing the 635 * whole page yet). When a new page is returned to the end user, after 636 * pagination/filtering/ordering even for the same query, a new `search` event 637 * with different 638 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 639 * desired. The end user may have not finished browsing the whole page yet. 640 * </pre> 641 * 642 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 643 */ 644 @java.lang.Override getProductDetailsOrBuilder(int index)645 public com.google.cloud.retail.v2.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { 646 return productDetails_.get(index); 647 } 648 649 public static final int COMPLETION_DETAIL_FIELD_NUMBER = 22; 650 private com.google.cloud.retail.v2.CompletionDetail completionDetail_; 651 /** 652 * 653 * 654 * <pre> 655 * The main auto-completion details related to the event. 656 * This field should be set for `search` event when autocomplete function is 657 * enabled and the user clicks a suggestion for search. 658 * </pre> 659 * 660 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 661 * 662 * @return Whether the completionDetail field is set. 663 */ 664 @java.lang.Override hasCompletionDetail()665 public boolean hasCompletionDetail() { 666 return completionDetail_ != null; 667 } 668 /** 669 * 670 * 671 * <pre> 672 * The main auto-completion details related to the event. 673 * This field should be set for `search` event when autocomplete function is 674 * enabled and the user clicks a suggestion for search. 675 * </pre> 676 * 677 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 678 * 679 * @return The completionDetail. 680 */ 681 @java.lang.Override getCompletionDetail()682 public com.google.cloud.retail.v2.CompletionDetail getCompletionDetail() { 683 return completionDetail_ == null 684 ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() 685 : completionDetail_; 686 } 687 /** 688 * 689 * 690 * <pre> 691 * The main auto-completion details related to the event. 692 * This field should be set for `search` event when autocomplete function is 693 * enabled and the user clicks a suggestion for search. 694 * </pre> 695 * 696 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 697 */ 698 @java.lang.Override getCompletionDetailOrBuilder()699 public com.google.cloud.retail.v2.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { 700 return completionDetail_ == null 701 ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() 702 : completionDetail_; 703 } 704 705 public static final int ATTRIBUTES_FIELD_NUMBER = 7; 706 707 private static final class AttributesDefaultEntryHolder { 708 static final com.google.protobuf.MapEntry< 709 java.lang.String, com.google.cloud.retail.v2.CustomAttribute> 710 defaultEntry = 711 com.google.protobuf.MapEntry 712 .<java.lang.String, com.google.cloud.retail.v2.CustomAttribute>newDefaultInstance( 713 com.google.cloud.retail.v2.UserEventProto 714 .internal_static_google_cloud_retail_v2_UserEvent_AttributesEntry_descriptor, 715 com.google.protobuf.WireFormat.FieldType.STRING, 716 "", 717 com.google.protobuf.WireFormat.FieldType.MESSAGE, 718 com.google.cloud.retail.v2.CustomAttribute.getDefaultInstance()); 719 } 720 721 @SuppressWarnings("serial") 722 private com.google.protobuf.MapField<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> 723 attributes_; 724 725 private com.google.protobuf.MapField<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> internalGetAttributes()726 internalGetAttributes() { 727 if (attributes_ == null) { 728 return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); 729 } 730 return attributes_; 731 } 732 getAttributesCount()733 public int getAttributesCount() { 734 return internalGetAttributes().getMap().size(); 735 } 736 /** 737 * 738 * 739 * <pre> 740 * Extra user event features to include in the recommendation model. 741 * If you provide custom attributes for ingested user events, also include 742 * them in the user events that you associate with prediction requests. Custom 743 * attribute formatting must be consistent between imported events and events 744 * provided with prediction requests. This lets the Retail API use 745 * those custom attributes when training models and serving predictions, which 746 * helps improve recommendation quality. 747 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 748 * error is returned: 749 * * The key must be a UTF-8 encoded string with a length limit of 5,000 750 * characters. 751 * * For text attributes, at most 400 values are allowed. Empty values are not 752 * allowed. Each value must be a UTF-8 encoded string with a length limit of 753 * 256 characters. 754 * * For number attributes, at most 400 values are allowed. 755 * For product recommendations, an example of extra user information is 756 * traffic_channel, which is how a user arrives at the site. Users can arrive 757 * at the site by coming to the site directly, coming through Google 758 * search, or in other ways. 759 * </pre> 760 * 761 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 762 */ 763 @java.lang.Override containsAttributes(java.lang.String key)764 public boolean containsAttributes(java.lang.String key) { 765 if (key == null) { 766 throw new NullPointerException("map key"); 767 } 768 return internalGetAttributes().getMap().containsKey(key); 769 } 770 /** Use {@link #getAttributesMap()} instead. */ 771 @java.lang.Override 772 @java.lang.Deprecated 773 public java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> getAttributes()774 getAttributes() { 775 return getAttributesMap(); 776 } 777 /** 778 * 779 * 780 * <pre> 781 * Extra user event features to include in the recommendation model. 782 * If you provide custom attributes for ingested user events, also include 783 * them in the user events that you associate with prediction requests. Custom 784 * attribute formatting must be consistent between imported events and events 785 * provided with prediction requests. This lets the Retail API use 786 * those custom attributes when training models and serving predictions, which 787 * helps improve recommendation quality. 788 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 789 * error is returned: 790 * * The key must be a UTF-8 encoded string with a length limit of 5,000 791 * characters. 792 * * For text attributes, at most 400 values are allowed. Empty values are not 793 * allowed. Each value must be a UTF-8 encoded string with a length limit of 794 * 256 characters. 795 * * For number attributes, at most 400 values are allowed. 796 * For product recommendations, an example of extra user information is 797 * traffic_channel, which is how a user arrives at the site. Users can arrive 798 * at the site by coming to the site directly, coming through Google 799 * search, or in other ways. 800 * </pre> 801 * 802 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 803 */ 804 @java.lang.Override 805 public java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> getAttributesMap()806 getAttributesMap() { 807 return internalGetAttributes().getMap(); 808 } 809 /** 810 * 811 * 812 * <pre> 813 * Extra user event features to include in the recommendation model. 814 * If you provide custom attributes for ingested user events, also include 815 * them in the user events that you associate with prediction requests. Custom 816 * attribute formatting must be consistent between imported events and events 817 * provided with prediction requests. This lets the Retail API use 818 * those custom attributes when training models and serving predictions, which 819 * helps improve recommendation quality. 820 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 821 * error is returned: 822 * * The key must be a UTF-8 encoded string with a length limit of 5,000 823 * characters. 824 * * For text attributes, at most 400 values are allowed. Empty values are not 825 * allowed. Each value must be a UTF-8 encoded string with a length limit of 826 * 256 characters. 827 * * For number attributes, at most 400 values are allowed. 828 * For product recommendations, an example of extra user information is 829 * traffic_channel, which is how a user arrives at the site. Users can arrive 830 * at the site by coming to the site directly, coming through Google 831 * search, or in other ways. 832 * </pre> 833 * 834 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 835 */ 836 @java.lang.Override getAttributesOrDefault( java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue)837 public /* nullable */ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( 838 java.lang.String key, 839 /* nullable */ 840 com.google.cloud.retail.v2.CustomAttribute defaultValue) { 841 if (key == null) { 842 throw new NullPointerException("map key"); 843 } 844 java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> map = 845 internalGetAttributes().getMap(); 846 return map.containsKey(key) ? map.get(key) : defaultValue; 847 } 848 /** 849 * 850 * 851 * <pre> 852 * Extra user event features to include in the recommendation model. 853 * If you provide custom attributes for ingested user events, also include 854 * them in the user events that you associate with prediction requests. Custom 855 * attribute formatting must be consistent between imported events and events 856 * provided with prediction requests. This lets the Retail API use 857 * those custom attributes when training models and serving predictions, which 858 * helps improve recommendation quality. 859 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 860 * error is returned: 861 * * The key must be a UTF-8 encoded string with a length limit of 5,000 862 * characters. 863 * * For text attributes, at most 400 values are allowed. Empty values are not 864 * allowed. Each value must be a UTF-8 encoded string with a length limit of 865 * 256 characters. 866 * * For number attributes, at most 400 values are allowed. 867 * For product recommendations, an example of extra user information is 868 * traffic_channel, which is how a user arrives at the site. Users can arrive 869 * at the site by coming to the site directly, coming through Google 870 * search, or in other ways. 871 * </pre> 872 * 873 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 874 */ 875 @java.lang.Override getAttributesOrThrow(java.lang.String key)876 public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { 877 if (key == null) { 878 throw new NullPointerException("map key"); 879 } 880 java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> map = 881 internalGetAttributes().getMap(); 882 if (!map.containsKey(key)) { 883 throw new java.lang.IllegalArgumentException(); 884 } 885 return map.get(key); 886 } 887 888 public static final int CART_ID_FIELD_NUMBER = 8; 889 890 @SuppressWarnings("serial") 891 private volatile java.lang.Object cartId_ = ""; 892 /** 893 * 894 * 895 * <pre> 896 * The ID or name of the associated shopping cart. This ID is used 897 * to associate multiple items added or present in the cart before purchase. 898 * This can only be set for `add-to-cart`, `purchase-complete`, or 899 * `shopping-cart-page-view` events. 900 * </pre> 901 * 902 * <code>string cart_id = 8;</code> 903 * 904 * @return The cartId. 905 */ 906 @java.lang.Override getCartId()907 public java.lang.String getCartId() { 908 java.lang.Object ref = cartId_; 909 if (ref instanceof java.lang.String) { 910 return (java.lang.String) ref; 911 } else { 912 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 913 java.lang.String s = bs.toStringUtf8(); 914 cartId_ = s; 915 return s; 916 } 917 } 918 /** 919 * 920 * 921 * <pre> 922 * The ID or name of the associated shopping cart. This ID is used 923 * to associate multiple items added or present in the cart before purchase. 924 * This can only be set for `add-to-cart`, `purchase-complete`, or 925 * `shopping-cart-page-view` events. 926 * </pre> 927 * 928 * <code>string cart_id = 8;</code> 929 * 930 * @return The bytes for cartId. 931 */ 932 @java.lang.Override getCartIdBytes()933 public com.google.protobuf.ByteString getCartIdBytes() { 934 java.lang.Object ref = cartId_; 935 if (ref instanceof java.lang.String) { 936 com.google.protobuf.ByteString b = 937 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 938 cartId_ = b; 939 return b; 940 } else { 941 return (com.google.protobuf.ByteString) ref; 942 } 943 } 944 945 public static final int PURCHASE_TRANSACTION_FIELD_NUMBER = 9; 946 private com.google.cloud.retail.v2.PurchaseTransaction purchaseTransaction_; 947 /** 948 * 949 * 950 * <pre> 951 * A transaction represents the entire purchase transaction. 952 * Required for `purchase-complete` events. Other event types should not set 953 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 954 * </pre> 955 * 956 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 957 * 958 * @return Whether the purchaseTransaction field is set. 959 */ 960 @java.lang.Override hasPurchaseTransaction()961 public boolean hasPurchaseTransaction() { 962 return purchaseTransaction_ != null; 963 } 964 /** 965 * 966 * 967 * <pre> 968 * A transaction represents the entire purchase transaction. 969 * Required for `purchase-complete` events. Other event types should not set 970 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 971 * </pre> 972 * 973 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 974 * 975 * @return The purchaseTransaction. 976 */ 977 @java.lang.Override getPurchaseTransaction()978 public com.google.cloud.retail.v2.PurchaseTransaction getPurchaseTransaction() { 979 return purchaseTransaction_ == null 980 ? com.google.cloud.retail.v2.PurchaseTransaction.getDefaultInstance() 981 : purchaseTransaction_; 982 } 983 /** 984 * 985 * 986 * <pre> 987 * A transaction represents the entire purchase transaction. 988 * Required for `purchase-complete` events. Other event types should not set 989 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 990 * </pre> 991 * 992 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 993 */ 994 @java.lang.Override getPurchaseTransactionOrBuilder()995 public com.google.cloud.retail.v2.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder() { 996 return purchaseTransaction_ == null 997 ? com.google.cloud.retail.v2.PurchaseTransaction.getDefaultInstance() 998 : purchaseTransaction_; 999 } 1000 1001 public static final int SEARCH_QUERY_FIELD_NUMBER = 10; 1002 1003 @SuppressWarnings("serial") 1004 private volatile java.lang.Object searchQuery_ = ""; 1005 /** 1006 * 1007 * 1008 * <pre> 1009 * The user's search query. 1010 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 1011 * definition. 1012 * The value must be a UTF-8 encoded string with a length limit of 5,000 1013 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1014 * At least one of 1015 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1016 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1017 * required for `search` events. Other event types should not set this field. 1018 * Otherwise, an INVALID_ARGUMENT error is returned. 1019 * </pre> 1020 * 1021 * <code>string search_query = 10;</code> 1022 * 1023 * @return The searchQuery. 1024 */ 1025 @java.lang.Override getSearchQuery()1026 public java.lang.String getSearchQuery() { 1027 java.lang.Object ref = searchQuery_; 1028 if (ref instanceof java.lang.String) { 1029 return (java.lang.String) ref; 1030 } else { 1031 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1032 java.lang.String s = bs.toStringUtf8(); 1033 searchQuery_ = s; 1034 return s; 1035 } 1036 } 1037 /** 1038 * 1039 * 1040 * <pre> 1041 * The user's search query. 1042 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 1043 * definition. 1044 * The value must be a UTF-8 encoded string with a length limit of 5,000 1045 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1046 * At least one of 1047 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1048 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1049 * required for `search` events. Other event types should not set this field. 1050 * Otherwise, an INVALID_ARGUMENT error is returned. 1051 * </pre> 1052 * 1053 * <code>string search_query = 10;</code> 1054 * 1055 * @return The bytes for searchQuery. 1056 */ 1057 @java.lang.Override getSearchQueryBytes()1058 public com.google.protobuf.ByteString getSearchQueryBytes() { 1059 java.lang.Object ref = searchQuery_; 1060 if (ref instanceof java.lang.String) { 1061 com.google.protobuf.ByteString b = 1062 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1063 searchQuery_ = b; 1064 return b; 1065 } else { 1066 return (com.google.protobuf.ByteString) ref; 1067 } 1068 } 1069 1070 public static final int FILTER_FIELD_NUMBER = 16; 1071 1072 @SuppressWarnings("serial") 1073 private volatile java.lang.Object filter_ = ""; 1074 /** 1075 * 1076 * 1077 * <pre> 1078 * The filter syntax consists of an expression language for constructing a 1079 * predicate from one or more fields of the products being filtered. 1080 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 1081 * definition and syntax. 1082 * The value must be a UTF-8 encoded string with a length limit of 1,000 1083 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1084 * </pre> 1085 * 1086 * <code>string filter = 16;</code> 1087 * 1088 * @return The filter. 1089 */ 1090 @java.lang.Override getFilter()1091 public java.lang.String getFilter() { 1092 java.lang.Object ref = filter_; 1093 if (ref instanceof java.lang.String) { 1094 return (java.lang.String) ref; 1095 } else { 1096 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1097 java.lang.String s = bs.toStringUtf8(); 1098 filter_ = s; 1099 return s; 1100 } 1101 } 1102 /** 1103 * 1104 * 1105 * <pre> 1106 * The filter syntax consists of an expression language for constructing a 1107 * predicate from one or more fields of the products being filtered. 1108 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 1109 * definition and syntax. 1110 * The value must be a UTF-8 encoded string with a length limit of 1,000 1111 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1112 * </pre> 1113 * 1114 * <code>string filter = 16;</code> 1115 * 1116 * @return The bytes for filter. 1117 */ 1118 @java.lang.Override getFilterBytes()1119 public com.google.protobuf.ByteString getFilterBytes() { 1120 java.lang.Object ref = filter_; 1121 if (ref instanceof java.lang.String) { 1122 com.google.protobuf.ByteString b = 1123 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1124 filter_ = b; 1125 return b; 1126 } else { 1127 return (com.google.protobuf.ByteString) ref; 1128 } 1129 } 1130 1131 public static final int ORDER_BY_FIELD_NUMBER = 17; 1132 1133 @SuppressWarnings("serial") 1134 private volatile java.lang.Object orderBy_ = ""; 1135 /** 1136 * 1137 * 1138 * <pre> 1139 * The order in which products are returned. 1140 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 1141 * for definition and syntax. 1142 * The value must be a UTF-8 encoded string with a length limit of 1,000 1143 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1144 * This can only be set for `search` events. Other event types should not set 1145 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 1146 * </pre> 1147 * 1148 * <code>string order_by = 17;</code> 1149 * 1150 * @return The orderBy. 1151 */ 1152 @java.lang.Override getOrderBy()1153 public java.lang.String getOrderBy() { 1154 java.lang.Object ref = orderBy_; 1155 if (ref instanceof java.lang.String) { 1156 return (java.lang.String) ref; 1157 } else { 1158 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1159 java.lang.String s = bs.toStringUtf8(); 1160 orderBy_ = s; 1161 return s; 1162 } 1163 } 1164 /** 1165 * 1166 * 1167 * <pre> 1168 * The order in which products are returned. 1169 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 1170 * for definition and syntax. 1171 * The value must be a UTF-8 encoded string with a length limit of 1,000 1172 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 1173 * This can only be set for `search` events. Other event types should not set 1174 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 1175 * </pre> 1176 * 1177 * <code>string order_by = 17;</code> 1178 * 1179 * @return The bytes for orderBy. 1180 */ 1181 @java.lang.Override getOrderByBytes()1182 public com.google.protobuf.ByteString getOrderByBytes() { 1183 java.lang.Object ref = orderBy_; 1184 if (ref instanceof java.lang.String) { 1185 com.google.protobuf.ByteString b = 1186 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1187 orderBy_ = b; 1188 return b; 1189 } else { 1190 return (com.google.protobuf.ByteString) ref; 1191 } 1192 } 1193 1194 public static final int OFFSET_FIELD_NUMBER = 18; 1195 private int offset_ = 0; 1196 /** 1197 * 1198 * 1199 * <pre> 1200 * An integer that specifies the current offset for pagination (the 0-indexed 1201 * starting location, amongst the products deemed by the API as relevant). 1202 * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for 1203 * definition. 1204 * If this field is negative, an INVALID_ARGUMENT is returned. 1205 * This can only be set for `search` events. Other event types should not set 1206 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 1207 * </pre> 1208 * 1209 * <code>int32 offset = 18;</code> 1210 * 1211 * @return The offset. 1212 */ 1213 @java.lang.Override getOffset()1214 public int getOffset() { 1215 return offset_; 1216 } 1217 1218 public static final int PAGE_CATEGORIES_FIELD_NUMBER = 11; 1219 1220 @SuppressWarnings("serial") 1221 private com.google.protobuf.LazyStringList pageCategories_; 1222 /** 1223 * 1224 * 1225 * <pre> 1226 * The categories associated with a category page. 1227 * To represent full path of category, use '>' sign to separate different 1228 * hierarchies. If '>' is part of the category name, replace it with 1229 * other character(s). 1230 * Category pages include special pages such as sales or promotions. For 1231 * instance, a special sale page may have the category hierarchy: 1232 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 1233 * Required for `category-page-view` events. At least one of 1234 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1235 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1236 * required for `search` events. Other event types should not set this field. 1237 * Otherwise, an INVALID_ARGUMENT error is returned. 1238 * </pre> 1239 * 1240 * <code>repeated string page_categories = 11;</code> 1241 * 1242 * @return A list containing the pageCategories. 1243 */ getPageCategoriesList()1244 public com.google.protobuf.ProtocolStringList getPageCategoriesList() { 1245 return pageCategories_; 1246 } 1247 /** 1248 * 1249 * 1250 * <pre> 1251 * The categories associated with a category page. 1252 * To represent full path of category, use '>' sign to separate different 1253 * hierarchies. If '>' is part of the category name, replace it with 1254 * other character(s). 1255 * Category pages include special pages such as sales or promotions. For 1256 * instance, a special sale page may have the category hierarchy: 1257 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 1258 * Required for `category-page-view` events. At least one of 1259 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1260 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1261 * required for `search` events. Other event types should not set this field. 1262 * Otherwise, an INVALID_ARGUMENT error is returned. 1263 * </pre> 1264 * 1265 * <code>repeated string page_categories = 11;</code> 1266 * 1267 * @return The count of pageCategories. 1268 */ getPageCategoriesCount()1269 public int getPageCategoriesCount() { 1270 return pageCategories_.size(); 1271 } 1272 /** 1273 * 1274 * 1275 * <pre> 1276 * The categories associated with a category page. 1277 * To represent full path of category, use '>' sign to separate different 1278 * hierarchies. If '>' is part of the category name, replace it with 1279 * other character(s). 1280 * Category pages include special pages such as sales or promotions. For 1281 * instance, a special sale page may have the category hierarchy: 1282 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 1283 * Required for `category-page-view` events. At least one of 1284 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1285 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1286 * required for `search` events. Other event types should not set this field. 1287 * Otherwise, an INVALID_ARGUMENT error is returned. 1288 * </pre> 1289 * 1290 * <code>repeated string page_categories = 11;</code> 1291 * 1292 * @param index The index of the element to return. 1293 * @return The pageCategories at the given index. 1294 */ getPageCategories(int index)1295 public java.lang.String getPageCategories(int index) { 1296 return pageCategories_.get(index); 1297 } 1298 /** 1299 * 1300 * 1301 * <pre> 1302 * The categories associated with a category page. 1303 * To represent full path of category, use '>' sign to separate different 1304 * hierarchies. If '>' is part of the category name, replace it with 1305 * other character(s). 1306 * Category pages include special pages such as sales or promotions. For 1307 * instance, a special sale page may have the category hierarchy: 1308 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 1309 * Required for `category-page-view` events. At least one of 1310 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 1311 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 1312 * required for `search` events. Other event types should not set this field. 1313 * Otherwise, an INVALID_ARGUMENT error is returned. 1314 * </pre> 1315 * 1316 * <code>repeated string page_categories = 11;</code> 1317 * 1318 * @param index The index of the value to return. 1319 * @return The bytes of the pageCategories at the given index. 1320 */ getPageCategoriesBytes(int index)1321 public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { 1322 return pageCategories_.getByteString(index); 1323 } 1324 1325 public static final int USER_INFO_FIELD_NUMBER = 12; 1326 private com.google.cloud.retail.v2.UserInfo userInfo_; 1327 /** 1328 * 1329 * 1330 * <pre> 1331 * User information. 1332 * </pre> 1333 * 1334 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 1335 * 1336 * @return Whether the userInfo field is set. 1337 */ 1338 @java.lang.Override hasUserInfo()1339 public boolean hasUserInfo() { 1340 return userInfo_ != null; 1341 } 1342 /** 1343 * 1344 * 1345 * <pre> 1346 * User information. 1347 * </pre> 1348 * 1349 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 1350 * 1351 * @return The userInfo. 1352 */ 1353 @java.lang.Override getUserInfo()1354 public com.google.cloud.retail.v2.UserInfo getUserInfo() { 1355 return userInfo_ == null ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() : userInfo_; 1356 } 1357 /** 1358 * 1359 * 1360 * <pre> 1361 * User information. 1362 * </pre> 1363 * 1364 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 1365 */ 1366 @java.lang.Override getUserInfoOrBuilder()1367 public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() { 1368 return userInfo_ == null ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() : userInfo_; 1369 } 1370 1371 public static final int URI_FIELD_NUMBER = 13; 1372 1373 @SuppressWarnings("serial") 1374 private volatile java.lang.Object uri_ = ""; 1375 /** 1376 * 1377 * 1378 * <pre> 1379 * Complete URL (window.location.href) of the user's current page. 1380 * When using the client side event reporting with JavaScript pixel and Google 1381 * Tag Manager, this value is filled in automatically. Maximum length 5,000 1382 * characters. 1383 * </pre> 1384 * 1385 * <code>string uri = 13;</code> 1386 * 1387 * @return The uri. 1388 */ 1389 @java.lang.Override getUri()1390 public java.lang.String getUri() { 1391 java.lang.Object ref = uri_; 1392 if (ref instanceof java.lang.String) { 1393 return (java.lang.String) ref; 1394 } else { 1395 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1396 java.lang.String s = bs.toStringUtf8(); 1397 uri_ = s; 1398 return s; 1399 } 1400 } 1401 /** 1402 * 1403 * 1404 * <pre> 1405 * Complete URL (window.location.href) of the user's current page. 1406 * When using the client side event reporting with JavaScript pixel and Google 1407 * Tag Manager, this value is filled in automatically. Maximum length 5,000 1408 * characters. 1409 * </pre> 1410 * 1411 * <code>string uri = 13;</code> 1412 * 1413 * @return The bytes for uri. 1414 */ 1415 @java.lang.Override getUriBytes()1416 public com.google.protobuf.ByteString getUriBytes() { 1417 java.lang.Object ref = uri_; 1418 if (ref instanceof java.lang.String) { 1419 com.google.protobuf.ByteString b = 1420 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1421 uri_ = b; 1422 return b; 1423 } else { 1424 return (com.google.protobuf.ByteString) ref; 1425 } 1426 } 1427 1428 public static final int REFERRER_URI_FIELD_NUMBER = 14; 1429 1430 @SuppressWarnings("serial") 1431 private volatile java.lang.Object referrerUri_ = ""; 1432 /** 1433 * 1434 * 1435 * <pre> 1436 * The referrer URL of the current page. 1437 * When using the client side event reporting with JavaScript pixel and Google 1438 * Tag Manager, this value is filled in automatically. 1439 * </pre> 1440 * 1441 * <code>string referrer_uri = 14;</code> 1442 * 1443 * @return The referrerUri. 1444 */ 1445 @java.lang.Override getReferrerUri()1446 public java.lang.String getReferrerUri() { 1447 java.lang.Object ref = referrerUri_; 1448 if (ref instanceof java.lang.String) { 1449 return (java.lang.String) ref; 1450 } else { 1451 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1452 java.lang.String s = bs.toStringUtf8(); 1453 referrerUri_ = s; 1454 return s; 1455 } 1456 } 1457 /** 1458 * 1459 * 1460 * <pre> 1461 * The referrer URL of the current page. 1462 * When using the client side event reporting with JavaScript pixel and Google 1463 * Tag Manager, this value is filled in automatically. 1464 * </pre> 1465 * 1466 * <code>string referrer_uri = 14;</code> 1467 * 1468 * @return The bytes for referrerUri. 1469 */ 1470 @java.lang.Override getReferrerUriBytes()1471 public com.google.protobuf.ByteString getReferrerUriBytes() { 1472 java.lang.Object ref = referrerUri_; 1473 if (ref instanceof java.lang.String) { 1474 com.google.protobuf.ByteString b = 1475 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1476 referrerUri_ = b; 1477 return b; 1478 } else { 1479 return (com.google.protobuf.ByteString) ref; 1480 } 1481 } 1482 1483 public static final int PAGE_VIEW_ID_FIELD_NUMBER = 15; 1484 1485 @SuppressWarnings("serial") 1486 private volatile java.lang.Object pageViewId_ = ""; 1487 /** 1488 * 1489 * 1490 * <pre> 1491 * A unique ID of a web page view. 1492 * This should be kept the same for all user events triggered from the same 1493 * pageview. For example, an item detail page view could trigger multiple 1494 * events as the user is browsing the page. The `pageViewId` property should 1495 * be kept the same for all these events so that they can be grouped together 1496 * properly. 1497 * When using the client side event reporting with JavaScript pixel and Google 1498 * Tag Manager, this value is filled in automatically. 1499 * </pre> 1500 * 1501 * <code>string page_view_id = 15;</code> 1502 * 1503 * @return The pageViewId. 1504 */ 1505 @java.lang.Override getPageViewId()1506 public java.lang.String getPageViewId() { 1507 java.lang.Object ref = pageViewId_; 1508 if (ref instanceof java.lang.String) { 1509 return (java.lang.String) ref; 1510 } else { 1511 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1512 java.lang.String s = bs.toStringUtf8(); 1513 pageViewId_ = s; 1514 return s; 1515 } 1516 } 1517 /** 1518 * 1519 * 1520 * <pre> 1521 * A unique ID of a web page view. 1522 * This should be kept the same for all user events triggered from the same 1523 * pageview. For example, an item detail page view could trigger multiple 1524 * events as the user is browsing the page. The `pageViewId` property should 1525 * be kept the same for all these events so that they can be grouped together 1526 * properly. 1527 * When using the client side event reporting with JavaScript pixel and Google 1528 * Tag Manager, this value is filled in automatically. 1529 * </pre> 1530 * 1531 * <code>string page_view_id = 15;</code> 1532 * 1533 * @return The bytes for pageViewId. 1534 */ 1535 @java.lang.Override getPageViewIdBytes()1536 public com.google.protobuf.ByteString getPageViewIdBytes() { 1537 java.lang.Object ref = pageViewId_; 1538 if (ref instanceof java.lang.String) { 1539 com.google.protobuf.ByteString b = 1540 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1541 pageViewId_ = b; 1542 return b; 1543 } else { 1544 return (com.google.protobuf.ByteString) ref; 1545 } 1546 } 1547 1548 public static final int ENTITY_FIELD_NUMBER = 23; 1549 1550 @SuppressWarnings("serial") 1551 private volatile java.lang.Object entity_ = ""; 1552 /** 1553 * 1554 * 1555 * <pre> 1556 * The entity for customers that may run multiple different entities, domains, 1557 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 1558 * `google.com`, `youtube.com`, etc. 1559 * It is recommended to set this field to get better per-entity search, 1560 * completion and prediction results. 1561 * </pre> 1562 * 1563 * <code>string entity = 23;</code> 1564 * 1565 * @return The entity. 1566 */ 1567 @java.lang.Override getEntity()1568 public java.lang.String getEntity() { 1569 java.lang.Object ref = entity_; 1570 if (ref instanceof java.lang.String) { 1571 return (java.lang.String) ref; 1572 } else { 1573 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1574 java.lang.String s = bs.toStringUtf8(); 1575 entity_ = s; 1576 return s; 1577 } 1578 } 1579 /** 1580 * 1581 * 1582 * <pre> 1583 * The entity for customers that may run multiple different entities, domains, 1584 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 1585 * `google.com`, `youtube.com`, etc. 1586 * It is recommended to set this field to get better per-entity search, 1587 * completion and prediction results. 1588 * </pre> 1589 * 1590 * <code>string entity = 23;</code> 1591 * 1592 * @return The bytes for entity. 1593 */ 1594 @java.lang.Override getEntityBytes()1595 public com.google.protobuf.ByteString getEntityBytes() { 1596 java.lang.Object ref = entity_; 1597 if (ref instanceof java.lang.String) { 1598 com.google.protobuf.ByteString b = 1599 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1600 entity_ = b; 1601 return b; 1602 } else { 1603 return (com.google.protobuf.ByteString) ref; 1604 } 1605 } 1606 1607 private byte memoizedIsInitialized = -1; 1608 1609 @java.lang.Override isInitialized()1610 public final boolean isInitialized() { 1611 byte isInitialized = memoizedIsInitialized; 1612 if (isInitialized == 1) return true; 1613 if (isInitialized == 0) return false; 1614 1615 memoizedIsInitialized = 1; 1616 return true; 1617 } 1618 1619 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1620 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1621 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { 1622 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventType_); 1623 } 1624 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { 1625 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, visitorId_); 1626 } 1627 if (eventTime_ != null) { 1628 output.writeMessage(3, getEventTime()); 1629 } 1630 for (int i = 0; i < experimentIds_.size(); i++) { 1631 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, experimentIds_.getRaw(i)); 1632 } 1633 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { 1634 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); 1635 } 1636 for (int i = 0; i < productDetails_.size(); i++) { 1637 output.writeMessage(6, productDetails_.get(i)); 1638 } 1639 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1640 output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 7); 1641 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { 1642 com.google.protobuf.GeneratedMessageV3.writeString(output, 8, cartId_); 1643 } 1644 if (purchaseTransaction_ != null) { 1645 output.writeMessage(9, getPurchaseTransaction()); 1646 } 1647 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { 1648 com.google.protobuf.GeneratedMessageV3.writeString(output, 10, searchQuery_); 1649 } 1650 for (int i = 0; i < pageCategories_.size(); i++) { 1651 com.google.protobuf.GeneratedMessageV3.writeString(output, 11, pageCategories_.getRaw(i)); 1652 } 1653 if (userInfo_ != null) { 1654 output.writeMessage(12, getUserInfo()); 1655 } 1656 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { 1657 com.google.protobuf.GeneratedMessageV3.writeString(output, 13, uri_); 1658 } 1659 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { 1660 com.google.protobuf.GeneratedMessageV3.writeString(output, 14, referrerUri_); 1661 } 1662 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { 1663 com.google.protobuf.GeneratedMessageV3.writeString(output, 15, pageViewId_); 1664 } 1665 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { 1666 com.google.protobuf.GeneratedMessageV3.writeString(output, 16, filter_); 1667 } 1668 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { 1669 com.google.protobuf.GeneratedMessageV3.writeString(output, 17, orderBy_); 1670 } 1671 if (offset_ != 0) { 1672 output.writeInt32(18, offset_); 1673 } 1674 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { 1675 com.google.protobuf.GeneratedMessageV3.writeString(output, 21, sessionId_); 1676 } 1677 if (completionDetail_ != null) { 1678 output.writeMessage(22, getCompletionDetail()); 1679 } 1680 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { 1681 com.google.protobuf.GeneratedMessageV3.writeString(output, 23, entity_); 1682 } 1683 getUnknownFields().writeTo(output); 1684 } 1685 1686 @java.lang.Override getSerializedSize()1687 public int getSerializedSize() { 1688 int size = memoizedSize; 1689 if (size != -1) return size; 1690 1691 size = 0; 1692 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { 1693 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); 1694 } 1695 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { 1696 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, visitorId_); 1697 } 1698 if (eventTime_ != null) { 1699 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEventTime()); 1700 } 1701 { 1702 int dataSize = 0; 1703 for (int i = 0; i < experimentIds_.size(); i++) { 1704 dataSize += computeStringSizeNoTag(experimentIds_.getRaw(i)); 1705 } 1706 size += dataSize; 1707 size += 1 * getExperimentIdsList().size(); 1708 } 1709 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { 1710 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); 1711 } 1712 for (int i = 0; i < productDetails_.size(); i++) { 1713 size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, productDetails_.get(i)); 1714 } 1715 for (java.util.Map.Entry<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> entry : 1716 internalGetAttributes().getMap().entrySet()) { 1717 com.google.protobuf.MapEntry<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> 1718 attributes__ = 1719 AttributesDefaultEntryHolder.defaultEntry 1720 .newBuilderForType() 1721 .setKey(entry.getKey()) 1722 .setValue(entry.getValue()) 1723 .build(); 1724 size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, attributes__); 1725 } 1726 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { 1727 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, cartId_); 1728 } 1729 if (purchaseTransaction_ != null) { 1730 size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPurchaseTransaction()); 1731 } 1732 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { 1733 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, searchQuery_); 1734 } 1735 { 1736 int dataSize = 0; 1737 for (int i = 0; i < pageCategories_.size(); i++) { 1738 dataSize += computeStringSizeNoTag(pageCategories_.getRaw(i)); 1739 } 1740 size += dataSize; 1741 size += 1 * getPageCategoriesList().size(); 1742 } 1743 if (userInfo_ != null) { 1744 size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUserInfo()); 1745 } 1746 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { 1747 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, uri_); 1748 } 1749 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { 1750 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, referrerUri_); 1751 } 1752 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageViewId_)) { 1753 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, pageViewId_); 1754 } 1755 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { 1756 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, filter_); 1757 } 1758 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { 1759 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, orderBy_); 1760 } 1761 if (offset_ != 0) { 1762 size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, offset_); 1763 } 1764 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { 1765 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, sessionId_); 1766 } 1767 if (completionDetail_ != null) { 1768 size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCompletionDetail()); 1769 } 1770 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entity_)) { 1771 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(23, entity_); 1772 } 1773 size += getUnknownFields().getSerializedSize(); 1774 memoizedSize = size; 1775 return size; 1776 } 1777 1778 @java.lang.Override equals(final java.lang.Object obj)1779 public boolean equals(final java.lang.Object obj) { 1780 if (obj == this) { 1781 return true; 1782 } 1783 if (!(obj instanceof com.google.cloud.retail.v2.UserEvent)) { 1784 return super.equals(obj); 1785 } 1786 com.google.cloud.retail.v2.UserEvent other = (com.google.cloud.retail.v2.UserEvent) obj; 1787 1788 if (!getEventType().equals(other.getEventType())) return false; 1789 if (!getVisitorId().equals(other.getVisitorId())) return false; 1790 if (!getSessionId().equals(other.getSessionId())) return false; 1791 if (hasEventTime() != other.hasEventTime()) return false; 1792 if (hasEventTime()) { 1793 if (!getEventTime().equals(other.getEventTime())) return false; 1794 } 1795 if (!getExperimentIdsList().equals(other.getExperimentIdsList())) return false; 1796 if (!getAttributionToken().equals(other.getAttributionToken())) return false; 1797 if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; 1798 if (hasCompletionDetail() != other.hasCompletionDetail()) return false; 1799 if (hasCompletionDetail()) { 1800 if (!getCompletionDetail().equals(other.getCompletionDetail())) return false; 1801 } 1802 if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; 1803 if (!getCartId().equals(other.getCartId())) return false; 1804 if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; 1805 if (hasPurchaseTransaction()) { 1806 if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) return false; 1807 } 1808 if (!getSearchQuery().equals(other.getSearchQuery())) return false; 1809 if (!getFilter().equals(other.getFilter())) return false; 1810 if (!getOrderBy().equals(other.getOrderBy())) return false; 1811 if (getOffset() != other.getOffset()) return false; 1812 if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; 1813 if (hasUserInfo() != other.hasUserInfo()) return false; 1814 if (hasUserInfo()) { 1815 if (!getUserInfo().equals(other.getUserInfo())) return false; 1816 } 1817 if (!getUri().equals(other.getUri())) return false; 1818 if (!getReferrerUri().equals(other.getReferrerUri())) return false; 1819 if (!getPageViewId().equals(other.getPageViewId())) return false; 1820 if (!getEntity().equals(other.getEntity())) return false; 1821 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1822 return true; 1823 } 1824 1825 @java.lang.Override hashCode()1826 public int hashCode() { 1827 if (memoizedHashCode != 0) { 1828 return memoizedHashCode; 1829 } 1830 int hash = 41; 1831 hash = (19 * hash) + getDescriptor().hashCode(); 1832 hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; 1833 hash = (53 * hash) + getEventType().hashCode(); 1834 hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; 1835 hash = (53 * hash) + getVisitorId().hashCode(); 1836 hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; 1837 hash = (53 * hash) + getSessionId().hashCode(); 1838 if (hasEventTime()) { 1839 hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; 1840 hash = (53 * hash) + getEventTime().hashCode(); 1841 } 1842 if (getExperimentIdsCount() > 0) { 1843 hash = (37 * hash) + EXPERIMENT_IDS_FIELD_NUMBER; 1844 hash = (53 * hash) + getExperimentIdsList().hashCode(); 1845 } 1846 hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; 1847 hash = (53 * hash) + getAttributionToken().hashCode(); 1848 if (getProductDetailsCount() > 0) { 1849 hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; 1850 hash = (53 * hash) + getProductDetailsList().hashCode(); 1851 } 1852 if (hasCompletionDetail()) { 1853 hash = (37 * hash) + COMPLETION_DETAIL_FIELD_NUMBER; 1854 hash = (53 * hash) + getCompletionDetail().hashCode(); 1855 } 1856 if (!internalGetAttributes().getMap().isEmpty()) { 1857 hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; 1858 hash = (53 * hash) + internalGetAttributes().hashCode(); 1859 } 1860 hash = (37 * hash) + CART_ID_FIELD_NUMBER; 1861 hash = (53 * hash) + getCartId().hashCode(); 1862 if (hasPurchaseTransaction()) { 1863 hash = (37 * hash) + PURCHASE_TRANSACTION_FIELD_NUMBER; 1864 hash = (53 * hash) + getPurchaseTransaction().hashCode(); 1865 } 1866 hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; 1867 hash = (53 * hash) + getSearchQuery().hashCode(); 1868 hash = (37 * hash) + FILTER_FIELD_NUMBER; 1869 hash = (53 * hash) + getFilter().hashCode(); 1870 hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; 1871 hash = (53 * hash) + getOrderBy().hashCode(); 1872 hash = (37 * hash) + OFFSET_FIELD_NUMBER; 1873 hash = (53 * hash) + getOffset(); 1874 if (getPageCategoriesCount() > 0) { 1875 hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; 1876 hash = (53 * hash) + getPageCategoriesList().hashCode(); 1877 } 1878 if (hasUserInfo()) { 1879 hash = (37 * hash) + USER_INFO_FIELD_NUMBER; 1880 hash = (53 * hash) + getUserInfo().hashCode(); 1881 } 1882 hash = (37 * hash) + URI_FIELD_NUMBER; 1883 hash = (53 * hash) + getUri().hashCode(); 1884 hash = (37 * hash) + REFERRER_URI_FIELD_NUMBER; 1885 hash = (53 * hash) + getReferrerUri().hashCode(); 1886 hash = (37 * hash) + PAGE_VIEW_ID_FIELD_NUMBER; 1887 hash = (53 * hash) + getPageViewId().hashCode(); 1888 hash = (37 * hash) + ENTITY_FIELD_NUMBER; 1889 hash = (53 * hash) + getEntity().hashCode(); 1890 hash = (29 * hash) + getUnknownFields().hashCode(); 1891 memoizedHashCode = hash; 1892 return hash; 1893 } 1894 parseFrom(java.nio.ByteBuffer data)1895 public static com.google.cloud.retail.v2.UserEvent parseFrom(java.nio.ByteBuffer data) 1896 throws com.google.protobuf.InvalidProtocolBufferException { 1897 return PARSER.parseFrom(data); 1898 } 1899 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1900 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1901 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1902 throws com.google.protobuf.InvalidProtocolBufferException { 1903 return PARSER.parseFrom(data, extensionRegistry); 1904 } 1905 parseFrom(com.google.protobuf.ByteString data)1906 public static com.google.cloud.retail.v2.UserEvent parseFrom(com.google.protobuf.ByteString data) 1907 throws com.google.protobuf.InvalidProtocolBufferException { 1908 return PARSER.parseFrom(data); 1909 } 1910 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1911 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1912 com.google.protobuf.ByteString data, 1913 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1914 throws com.google.protobuf.InvalidProtocolBufferException { 1915 return PARSER.parseFrom(data, extensionRegistry); 1916 } 1917 parseFrom(byte[] data)1918 public static com.google.cloud.retail.v2.UserEvent parseFrom(byte[] data) 1919 throws com.google.protobuf.InvalidProtocolBufferException { 1920 return PARSER.parseFrom(data); 1921 } 1922 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1923 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1924 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1925 throws com.google.protobuf.InvalidProtocolBufferException { 1926 return PARSER.parseFrom(data, extensionRegistry); 1927 } 1928 parseFrom(java.io.InputStream input)1929 public static com.google.cloud.retail.v2.UserEvent parseFrom(java.io.InputStream input) 1930 throws java.io.IOException { 1931 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1932 } 1933 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1934 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1935 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1936 throws java.io.IOException { 1937 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1938 PARSER, input, extensionRegistry); 1939 } 1940 parseDelimitedFrom(java.io.InputStream input)1941 public static com.google.cloud.retail.v2.UserEvent parseDelimitedFrom(java.io.InputStream input) 1942 throws java.io.IOException { 1943 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1944 } 1945 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1946 public static com.google.cloud.retail.v2.UserEvent parseDelimitedFrom( 1947 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1948 throws java.io.IOException { 1949 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1950 PARSER, input, extensionRegistry); 1951 } 1952 parseFrom( com.google.protobuf.CodedInputStream input)1953 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1954 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1955 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1956 } 1957 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1958 public static com.google.cloud.retail.v2.UserEvent parseFrom( 1959 com.google.protobuf.CodedInputStream input, 1960 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1961 throws java.io.IOException { 1962 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1963 PARSER, input, extensionRegistry); 1964 } 1965 1966 @java.lang.Override newBuilderForType()1967 public Builder newBuilderForType() { 1968 return newBuilder(); 1969 } 1970 newBuilder()1971 public static Builder newBuilder() { 1972 return DEFAULT_INSTANCE.toBuilder(); 1973 } 1974 newBuilder(com.google.cloud.retail.v2.UserEvent prototype)1975 public static Builder newBuilder(com.google.cloud.retail.v2.UserEvent prototype) { 1976 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1977 } 1978 1979 @java.lang.Override toBuilder()1980 public Builder toBuilder() { 1981 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1982 } 1983 1984 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1985 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1986 Builder builder = new Builder(parent); 1987 return builder; 1988 } 1989 /** 1990 * 1991 * 1992 * <pre> 1993 * UserEvent captures all metadata information Retail API needs to know about 1994 * how end users interact with customers' website. 1995 * </pre> 1996 * 1997 * Protobuf type {@code google.cloud.retail.v2.UserEvent} 1998 */ 1999 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 2000 implements 2001 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.UserEvent) 2002 com.google.cloud.retail.v2.UserEventOrBuilder { getDescriptor()2003 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 2004 return com.google.cloud.retail.v2.UserEventProto 2005 .internal_static_google_cloud_retail_v2_UserEvent_descriptor; 2006 } 2007 2008 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)2009 protected com.google.protobuf.MapField internalGetMapField(int number) { 2010 switch (number) { 2011 case 7: 2012 return internalGetAttributes(); 2013 default: 2014 throw new RuntimeException("Invalid map field number: " + number); 2015 } 2016 } 2017 2018 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)2019 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 2020 switch (number) { 2021 case 7: 2022 return internalGetMutableAttributes(); 2023 default: 2024 throw new RuntimeException("Invalid map field number: " + number); 2025 } 2026 } 2027 2028 @java.lang.Override 2029 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()2030 internalGetFieldAccessorTable() { 2031 return com.google.cloud.retail.v2.UserEventProto 2032 .internal_static_google_cloud_retail_v2_UserEvent_fieldAccessorTable 2033 .ensureFieldAccessorsInitialized( 2034 com.google.cloud.retail.v2.UserEvent.class, 2035 com.google.cloud.retail.v2.UserEvent.Builder.class); 2036 } 2037 2038 // Construct using com.google.cloud.retail.v2.UserEvent.newBuilder() Builder()2039 private Builder() {} 2040 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2041 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2042 super(parent); 2043 } 2044 2045 @java.lang.Override clear()2046 public Builder clear() { 2047 super.clear(); 2048 bitField0_ = 0; 2049 eventType_ = ""; 2050 visitorId_ = ""; 2051 sessionId_ = ""; 2052 eventTime_ = null; 2053 if (eventTimeBuilder_ != null) { 2054 eventTimeBuilder_.dispose(); 2055 eventTimeBuilder_ = null; 2056 } 2057 experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; 2058 bitField0_ = (bitField0_ & ~0x00000010); 2059 attributionToken_ = ""; 2060 if (productDetailsBuilder_ == null) { 2061 productDetails_ = java.util.Collections.emptyList(); 2062 } else { 2063 productDetails_ = null; 2064 productDetailsBuilder_.clear(); 2065 } 2066 bitField0_ = (bitField0_ & ~0x00000040); 2067 completionDetail_ = null; 2068 if (completionDetailBuilder_ != null) { 2069 completionDetailBuilder_.dispose(); 2070 completionDetailBuilder_ = null; 2071 } 2072 internalGetMutableAttributes().clear(); 2073 cartId_ = ""; 2074 purchaseTransaction_ = null; 2075 if (purchaseTransactionBuilder_ != null) { 2076 purchaseTransactionBuilder_.dispose(); 2077 purchaseTransactionBuilder_ = null; 2078 } 2079 searchQuery_ = ""; 2080 filter_ = ""; 2081 orderBy_ = ""; 2082 offset_ = 0; 2083 pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; 2084 bitField0_ = (bitField0_ & ~0x00008000); 2085 userInfo_ = null; 2086 if (userInfoBuilder_ != null) { 2087 userInfoBuilder_.dispose(); 2088 userInfoBuilder_ = null; 2089 } 2090 uri_ = ""; 2091 referrerUri_ = ""; 2092 pageViewId_ = ""; 2093 entity_ = ""; 2094 return this; 2095 } 2096 2097 @java.lang.Override getDescriptorForType()2098 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2099 return com.google.cloud.retail.v2.UserEventProto 2100 .internal_static_google_cloud_retail_v2_UserEvent_descriptor; 2101 } 2102 2103 @java.lang.Override getDefaultInstanceForType()2104 public com.google.cloud.retail.v2.UserEvent getDefaultInstanceForType() { 2105 return com.google.cloud.retail.v2.UserEvent.getDefaultInstance(); 2106 } 2107 2108 @java.lang.Override build()2109 public com.google.cloud.retail.v2.UserEvent build() { 2110 com.google.cloud.retail.v2.UserEvent result = buildPartial(); 2111 if (!result.isInitialized()) { 2112 throw newUninitializedMessageException(result); 2113 } 2114 return result; 2115 } 2116 2117 @java.lang.Override buildPartial()2118 public com.google.cloud.retail.v2.UserEvent buildPartial() { 2119 com.google.cloud.retail.v2.UserEvent result = new com.google.cloud.retail.v2.UserEvent(this); 2120 buildPartialRepeatedFields(result); 2121 if (bitField0_ != 0) { 2122 buildPartial0(result); 2123 } 2124 onBuilt(); 2125 return result; 2126 } 2127 buildPartialRepeatedFields(com.google.cloud.retail.v2.UserEvent result)2128 private void buildPartialRepeatedFields(com.google.cloud.retail.v2.UserEvent result) { 2129 if (((bitField0_ & 0x00000010) != 0)) { 2130 experimentIds_ = experimentIds_.getUnmodifiableView(); 2131 bitField0_ = (bitField0_ & ~0x00000010); 2132 } 2133 result.experimentIds_ = experimentIds_; 2134 if (productDetailsBuilder_ == null) { 2135 if (((bitField0_ & 0x00000040) != 0)) { 2136 productDetails_ = java.util.Collections.unmodifiableList(productDetails_); 2137 bitField0_ = (bitField0_ & ~0x00000040); 2138 } 2139 result.productDetails_ = productDetails_; 2140 } else { 2141 result.productDetails_ = productDetailsBuilder_.build(); 2142 } 2143 if (((bitField0_ & 0x00008000) != 0)) { 2144 pageCategories_ = pageCategories_.getUnmodifiableView(); 2145 bitField0_ = (bitField0_ & ~0x00008000); 2146 } 2147 result.pageCategories_ = pageCategories_; 2148 } 2149 buildPartial0(com.google.cloud.retail.v2.UserEvent result)2150 private void buildPartial0(com.google.cloud.retail.v2.UserEvent result) { 2151 int from_bitField0_ = bitField0_; 2152 if (((from_bitField0_ & 0x00000001) != 0)) { 2153 result.eventType_ = eventType_; 2154 } 2155 if (((from_bitField0_ & 0x00000002) != 0)) { 2156 result.visitorId_ = visitorId_; 2157 } 2158 if (((from_bitField0_ & 0x00000004) != 0)) { 2159 result.sessionId_ = sessionId_; 2160 } 2161 if (((from_bitField0_ & 0x00000008) != 0)) { 2162 result.eventTime_ = eventTimeBuilder_ == null ? eventTime_ : eventTimeBuilder_.build(); 2163 } 2164 if (((from_bitField0_ & 0x00000020) != 0)) { 2165 result.attributionToken_ = attributionToken_; 2166 } 2167 if (((from_bitField0_ & 0x00000080) != 0)) { 2168 result.completionDetail_ = 2169 completionDetailBuilder_ == null ? completionDetail_ : completionDetailBuilder_.build(); 2170 } 2171 if (((from_bitField0_ & 0x00000100) != 0)) { 2172 result.attributes_ = internalGetAttributes(); 2173 result.attributes_.makeImmutable(); 2174 } 2175 if (((from_bitField0_ & 0x00000200) != 0)) { 2176 result.cartId_ = cartId_; 2177 } 2178 if (((from_bitField0_ & 0x00000400) != 0)) { 2179 result.purchaseTransaction_ = 2180 purchaseTransactionBuilder_ == null 2181 ? purchaseTransaction_ 2182 : purchaseTransactionBuilder_.build(); 2183 } 2184 if (((from_bitField0_ & 0x00000800) != 0)) { 2185 result.searchQuery_ = searchQuery_; 2186 } 2187 if (((from_bitField0_ & 0x00001000) != 0)) { 2188 result.filter_ = filter_; 2189 } 2190 if (((from_bitField0_ & 0x00002000) != 0)) { 2191 result.orderBy_ = orderBy_; 2192 } 2193 if (((from_bitField0_ & 0x00004000) != 0)) { 2194 result.offset_ = offset_; 2195 } 2196 if (((from_bitField0_ & 0x00010000) != 0)) { 2197 result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build(); 2198 } 2199 if (((from_bitField0_ & 0x00020000) != 0)) { 2200 result.uri_ = uri_; 2201 } 2202 if (((from_bitField0_ & 0x00040000) != 0)) { 2203 result.referrerUri_ = referrerUri_; 2204 } 2205 if (((from_bitField0_ & 0x00080000) != 0)) { 2206 result.pageViewId_ = pageViewId_; 2207 } 2208 if (((from_bitField0_ & 0x00100000) != 0)) { 2209 result.entity_ = entity_; 2210 } 2211 } 2212 2213 @java.lang.Override clone()2214 public Builder clone() { 2215 return super.clone(); 2216 } 2217 2218 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2219 public Builder setField( 2220 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2221 return super.setField(field, value); 2222 } 2223 2224 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2225 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2226 return super.clearField(field); 2227 } 2228 2229 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2230 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2231 return super.clearOneof(oneof); 2232 } 2233 2234 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2235 public Builder setRepeatedField( 2236 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2237 return super.setRepeatedField(field, index, value); 2238 } 2239 2240 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2241 public Builder addRepeatedField( 2242 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2243 return super.addRepeatedField(field, value); 2244 } 2245 2246 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2247 public Builder mergeFrom(com.google.protobuf.Message other) { 2248 if (other instanceof com.google.cloud.retail.v2.UserEvent) { 2249 return mergeFrom((com.google.cloud.retail.v2.UserEvent) other); 2250 } else { 2251 super.mergeFrom(other); 2252 return this; 2253 } 2254 } 2255 mergeFrom(com.google.cloud.retail.v2.UserEvent other)2256 public Builder mergeFrom(com.google.cloud.retail.v2.UserEvent other) { 2257 if (other == com.google.cloud.retail.v2.UserEvent.getDefaultInstance()) return this; 2258 if (!other.getEventType().isEmpty()) { 2259 eventType_ = other.eventType_; 2260 bitField0_ |= 0x00000001; 2261 onChanged(); 2262 } 2263 if (!other.getVisitorId().isEmpty()) { 2264 visitorId_ = other.visitorId_; 2265 bitField0_ |= 0x00000002; 2266 onChanged(); 2267 } 2268 if (!other.getSessionId().isEmpty()) { 2269 sessionId_ = other.sessionId_; 2270 bitField0_ |= 0x00000004; 2271 onChanged(); 2272 } 2273 if (other.hasEventTime()) { 2274 mergeEventTime(other.getEventTime()); 2275 } 2276 if (!other.experimentIds_.isEmpty()) { 2277 if (experimentIds_.isEmpty()) { 2278 experimentIds_ = other.experimentIds_; 2279 bitField0_ = (bitField0_ & ~0x00000010); 2280 } else { 2281 ensureExperimentIdsIsMutable(); 2282 experimentIds_.addAll(other.experimentIds_); 2283 } 2284 onChanged(); 2285 } 2286 if (!other.getAttributionToken().isEmpty()) { 2287 attributionToken_ = other.attributionToken_; 2288 bitField0_ |= 0x00000020; 2289 onChanged(); 2290 } 2291 if (productDetailsBuilder_ == null) { 2292 if (!other.productDetails_.isEmpty()) { 2293 if (productDetails_.isEmpty()) { 2294 productDetails_ = other.productDetails_; 2295 bitField0_ = (bitField0_ & ~0x00000040); 2296 } else { 2297 ensureProductDetailsIsMutable(); 2298 productDetails_.addAll(other.productDetails_); 2299 } 2300 onChanged(); 2301 } 2302 } else { 2303 if (!other.productDetails_.isEmpty()) { 2304 if (productDetailsBuilder_.isEmpty()) { 2305 productDetailsBuilder_.dispose(); 2306 productDetailsBuilder_ = null; 2307 productDetails_ = other.productDetails_; 2308 bitField0_ = (bitField0_ & ~0x00000040); 2309 productDetailsBuilder_ = 2310 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 2311 ? getProductDetailsFieldBuilder() 2312 : null; 2313 } else { 2314 productDetailsBuilder_.addAllMessages(other.productDetails_); 2315 } 2316 } 2317 } 2318 if (other.hasCompletionDetail()) { 2319 mergeCompletionDetail(other.getCompletionDetail()); 2320 } 2321 internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); 2322 bitField0_ |= 0x00000100; 2323 if (!other.getCartId().isEmpty()) { 2324 cartId_ = other.cartId_; 2325 bitField0_ |= 0x00000200; 2326 onChanged(); 2327 } 2328 if (other.hasPurchaseTransaction()) { 2329 mergePurchaseTransaction(other.getPurchaseTransaction()); 2330 } 2331 if (!other.getSearchQuery().isEmpty()) { 2332 searchQuery_ = other.searchQuery_; 2333 bitField0_ |= 0x00000800; 2334 onChanged(); 2335 } 2336 if (!other.getFilter().isEmpty()) { 2337 filter_ = other.filter_; 2338 bitField0_ |= 0x00001000; 2339 onChanged(); 2340 } 2341 if (!other.getOrderBy().isEmpty()) { 2342 orderBy_ = other.orderBy_; 2343 bitField0_ |= 0x00002000; 2344 onChanged(); 2345 } 2346 if (other.getOffset() != 0) { 2347 setOffset(other.getOffset()); 2348 } 2349 if (!other.pageCategories_.isEmpty()) { 2350 if (pageCategories_.isEmpty()) { 2351 pageCategories_ = other.pageCategories_; 2352 bitField0_ = (bitField0_ & ~0x00008000); 2353 } else { 2354 ensurePageCategoriesIsMutable(); 2355 pageCategories_.addAll(other.pageCategories_); 2356 } 2357 onChanged(); 2358 } 2359 if (other.hasUserInfo()) { 2360 mergeUserInfo(other.getUserInfo()); 2361 } 2362 if (!other.getUri().isEmpty()) { 2363 uri_ = other.uri_; 2364 bitField0_ |= 0x00020000; 2365 onChanged(); 2366 } 2367 if (!other.getReferrerUri().isEmpty()) { 2368 referrerUri_ = other.referrerUri_; 2369 bitField0_ |= 0x00040000; 2370 onChanged(); 2371 } 2372 if (!other.getPageViewId().isEmpty()) { 2373 pageViewId_ = other.pageViewId_; 2374 bitField0_ |= 0x00080000; 2375 onChanged(); 2376 } 2377 if (!other.getEntity().isEmpty()) { 2378 entity_ = other.entity_; 2379 bitField0_ |= 0x00100000; 2380 onChanged(); 2381 } 2382 this.mergeUnknownFields(other.getUnknownFields()); 2383 onChanged(); 2384 return this; 2385 } 2386 2387 @java.lang.Override isInitialized()2388 public final boolean isInitialized() { 2389 return true; 2390 } 2391 2392 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2393 public Builder mergeFrom( 2394 com.google.protobuf.CodedInputStream input, 2395 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2396 throws java.io.IOException { 2397 if (extensionRegistry == null) { 2398 throw new java.lang.NullPointerException(); 2399 } 2400 try { 2401 boolean done = false; 2402 while (!done) { 2403 int tag = input.readTag(); 2404 switch (tag) { 2405 case 0: 2406 done = true; 2407 break; 2408 case 10: 2409 { 2410 eventType_ = input.readStringRequireUtf8(); 2411 bitField0_ |= 0x00000001; 2412 break; 2413 } // case 10 2414 case 18: 2415 { 2416 visitorId_ = input.readStringRequireUtf8(); 2417 bitField0_ |= 0x00000002; 2418 break; 2419 } // case 18 2420 case 26: 2421 { 2422 input.readMessage(getEventTimeFieldBuilder().getBuilder(), extensionRegistry); 2423 bitField0_ |= 0x00000008; 2424 break; 2425 } // case 26 2426 case 34: 2427 { 2428 java.lang.String s = input.readStringRequireUtf8(); 2429 ensureExperimentIdsIsMutable(); 2430 experimentIds_.add(s); 2431 break; 2432 } // case 34 2433 case 42: 2434 { 2435 attributionToken_ = input.readStringRequireUtf8(); 2436 bitField0_ |= 0x00000020; 2437 break; 2438 } // case 42 2439 case 50: 2440 { 2441 com.google.cloud.retail.v2.ProductDetail m = 2442 input.readMessage( 2443 com.google.cloud.retail.v2.ProductDetail.parser(), extensionRegistry); 2444 if (productDetailsBuilder_ == null) { 2445 ensureProductDetailsIsMutable(); 2446 productDetails_.add(m); 2447 } else { 2448 productDetailsBuilder_.addMessage(m); 2449 } 2450 break; 2451 } // case 50 2452 case 58: 2453 { 2454 com.google.protobuf.MapEntry< 2455 java.lang.String, com.google.cloud.retail.v2.CustomAttribute> 2456 attributes__ = 2457 input.readMessage( 2458 AttributesDefaultEntryHolder.defaultEntry.getParserForType(), 2459 extensionRegistry); 2460 internalGetMutableAttributes() 2461 .getMutableMap() 2462 .put(attributes__.getKey(), attributes__.getValue()); 2463 bitField0_ |= 0x00000100; 2464 break; 2465 } // case 58 2466 case 66: 2467 { 2468 cartId_ = input.readStringRequireUtf8(); 2469 bitField0_ |= 0x00000200; 2470 break; 2471 } // case 66 2472 case 74: 2473 { 2474 input.readMessage( 2475 getPurchaseTransactionFieldBuilder().getBuilder(), extensionRegistry); 2476 bitField0_ |= 0x00000400; 2477 break; 2478 } // case 74 2479 case 82: 2480 { 2481 searchQuery_ = input.readStringRequireUtf8(); 2482 bitField0_ |= 0x00000800; 2483 break; 2484 } // case 82 2485 case 90: 2486 { 2487 java.lang.String s = input.readStringRequireUtf8(); 2488 ensurePageCategoriesIsMutable(); 2489 pageCategories_.add(s); 2490 break; 2491 } // case 90 2492 case 98: 2493 { 2494 input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); 2495 bitField0_ |= 0x00010000; 2496 break; 2497 } // case 98 2498 case 106: 2499 { 2500 uri_ = input.readStringRequireUtf8(); 2501 bitField0_ |= 0x00020000; 2502 break; 2503 } // case 106 2504 case 114: 2505 { 2506 referrerUri_ = input.readStringRequireUtf8(); 2507 bitField0_ |= 0x00040000; 2508 break; 2509 } // case 114 2510 case 122: 2511 { 2512 pageViewId_ = input.readStringRequireUtf8(); 2513 bitField0_ |= 0x00080000; 2514 break; 2515 } // case 122 2516 case 130: 2517 { 2518 filter_ = input.readStringRequireUtf8(); 2519 bitField0_ |= 0x00001000; 2520 break; 2521 } // case 130 2522 case 138: 2523 { 2524 orderBy_ = input.readStringRequireUtf8(); 2525 bitField0_ |= 0x00002000; 2526 break; 2527 } // case 138 2528 case 144: 2529 { 2530 offset_ = input.readInt32(); 2531 bitField0_ |= 0x00004000; 2532 break; 2533 } // case 144 2534 case 170: 2535 { 2536 sessionId_ = input.readStringRequireUtf8(); 2537 bitField0_ |= 0x00000004; 2538 break; 2539 } // case 170 2540 case 178: 2541 { 2542 input.readMessage( 2543 getCompletionDetailFieldBuilder().getBuilder(), extensionRegistry); 2544 bitField0_ |= 0x00000080; 2545 break; 2546 } // case 178 2547 case 186: 2548 { 2549 entity_ = input.readStringRequireUtf8(); 2550 bitField0_ |= 0x00100000; 2551 break; 2552 } // case 186 2553 default: 2554 { 2555 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2556 done = true; // was an endgroup tag 2557 } 2558 break; 2559 } // default: 2560 } // switch (tag) 2561 } // while (!done) 2562 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2563 throw e.unwrapIOException(); 2564 } finally { 2565 onChanged(); 2566 } // finally 2567 return this; 2568 } 2569 2570 private int bitField0_; 2571 2572 private java.lang.Object eventType_ = ""; 2573 /** 2574 * 2575 * 2576 * <pre> 2577 * Required. User event type. Allowed values are: 2578 * * `add-to-cart`: Products being added to cart. 2579 * * `category-page-view`: Special pages such as sale or promotion pages 2580 * viewed. 2581 * * `detail-page-view`: Products detail page viewed. 2582 * * `home-page-view`: Homepage viewed. 2583 * * `promotion-offered`: Promotion is offered to a user. 2584 * * `promotion-not-offered`: Promotion is not offered to a user. 2585 * * `purchase-complete`: User finishing a purchase. 2586 * * `search`: Product search. 2587 * * `shopping-cart-page-view`: User viewing a shopping cart. 2588 * </pre> 2589 * 2590 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 2591 * 2592 * @return The eventType. 2593 */ getEventType()2594 public java.lang.String getEventType() { 2595 java.lang.Object ref = eventType_; 2596 if (!(ref instanceof java.lang.String)) { 2597 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2598 java.lang.String s = bs.toStringUtf8(); 2599 eventType_ = s; 2600 return s; 2601 } else { 2602 return (java.lang.String) ref; 2603 } 2604 } 2605 /** 2606 * 2607 * 2608 * <pre> 2609 * Required. User event type. Allowed values are: 2610 * * `add-to-cart`: Products being added to cart. 2611 * * `category-page-view`: Special pages such as sale or promotion pages 2612 * viewed. 2613 * * `detail-page-view`: Products detail page viewed. 2614 * * `home-page-view`: Homepage viewed. 2615 * * `promotion-offered`: Promotion is offered to a user. 2616 * * `promotion-not-offered`: Promotion is not offered to a user. 2617 * * `purchase-complete`: User finishing a purchase. 2618 * * `search`: Product search. 2619 * * `shopping-cart-page-view`: User viewing a shopping cart. 2620 * </pre> 2621 * 2622 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 2623 * 2624 * @return The bytes for eventType. 2625 */ getEventTypeBytes()2626 public com.google.protobuf.ByteString getEventTypeBytes() { 2627 java.lang.Object ref = eventType_; 2628 if (ref instanceof String) { 2629 com.google.protobuf.ByteString b = 2630 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2631 eventType_ = b; 2632 return b; 2633 } else { 2634 return (com.google.protobuf.ByteString) ref; 2635 } 2636 } 2637 /** 2638 * 2639 * 2640 * <pre> 2641 * Required. User event type. Allowed values are: 2642 * * `add-to-cart`: Products being added to cart. 2643 * * `category-page-view`: Special pages such as sale or promotion pages 2644 * viewed. 2645 * * `detail-page-view`: Products detail page viewed. 2646 * * `home-page-view`: Homepage viewed. 2647 * * `promotion-offered`: Promotion is offered to a user. 2648 * * `promotion-not-offered`: Promotion is not offered to a user. 2649 * * `purchase-complete`: User finishing a purchase. 2650 * * `search`: Product search. 2651 * * `shopping-cart-page-view`: User viewing a shopping cart. 2652 * </pre> 2653 * 2654 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 2655 * 2656 * @param value The eventType to set. 2657 * @return This builder for chaining. 2658 */ setEventType(java.lang.String value)2659 public Builder setEventType(java.lang.String value) { 2660 if (value == null) { 2661 throw new NullPointerException(); 2662 } 2663 eventType_ = value; 2664 bitField0_ |= 0x00000001; 2665 onChanged(); 2666 return this; 2667 } 2668 /** 2669 * 2670 * 2671 * <pre> 2672 * Required. User event type. Allowed values are: 2673 * * `add-to-cart`: Products being added to cart. 2674 * * `category-page-view`: Special pages such as sale or promotion pages 2675 * viewed. 2676 * * `detail-page-view`: Products detail page viewed. 2677 * * `home-page-view`: Homepage viewed. 2678 * * `promotion-offered`: Promotion is offered to a user. 2679 * * `promotion-not-offered`: Promotion is not offered to a user. 2680 * * `purchase-complete`: User finishing a purchase. 2681 * * `search`: Product search. 2682 * * `shopping-cart-page-view`: User viewing a shopping cart. 2683 * </pre> 2684 * 2685 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 2686 * 2687 * @return This builder for chaining. 2688 */ clearEventType()2689 public Builder clearEventType() { 2690 eventType_ = getDefaultInstance().getEventType(); 2691 bitField0_ = (bitField0_ & ~0x00000001); 2692 onChanged(); 2693 return this; 2694 } 2695 /** 2696 * 2697 * 2698 * <pre> 2699 * Required. User event type. Allowed values are: 2700 * * `add-to-cart`: Products being added to cart. 2701 * * `category-page-view`: Special pages such as sale or promotion pages 2702 * viewed. 2703 * * `detail-page-view`: Products detail page viewed. 2704 * * `home-page-view`: Homepage viewed. 2705 * * `promotion-offered`: Promotion is offered to a user. 2706 * * `promotion-not-offered`: Promotion is not offered to a user. 2707 * * `purchase-complete`: User finishing a purchase. 2708 * * `search`: Product search. 2709 * * `shopping-cart-page-view`: User viewing a shopping cart. 2710 * </pre> 2711 * 2712 * <code>string event_type = 1 [(.google.api.field_behavior) = REQUIRED];</code> 2713 * 2714 * @param value The bytes for eventType to set. 2715 * @return This builder for chaining. 2716 */ setEventTypeBytes(com.google.protobuf.ByteString value)2717 public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { 2718 if (value == null) { 2719 throw new NullPointerException(); 2720 } 2721 checkByteStringIsUtf8(value); 2722 eventType_ = value; 2723 bitField0_ |= 0x00000001; 2724 onChanged(); 2725 return this; 2726 } 2727 2728 private java.lang.Object visitorId_ = ""; 2729 /** 2730 * 2731 * 2732 * <pre> 2733 * Required. A unique identifier for tracking visitors. 2734 * For example, this could be implemented with an HTTP cookie, which should be 2735 * able to uniquely identify a visitor on a single device. This unique 2736 * identifier should not change if the visitor log in/out of the website. 2737 * Don't set the field to the same fixed ID for different users. This mixes 2738 * the event history of those users together, which results in degraded model 2739 * quality. 2740 * The field must be a UTF-8 encoded string with a length limit of 128 2741 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 2742 * The field should not contain PII or user-data. We recommend to use Google 2743 * Analytics [Client 2744 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 2745 * for this field. 2746 * </pre> 2747 * 2748 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 2749 * 2750 * @return The visitorId. 2751 */ getVisitorId()2752 public java.lang.String getVisitorId() { 2753 java.lang.Object ref = visitorId_; 2754 if (!(ref instanceof java.lang.String)) { 2755 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2756 java.lang.String s = bs.toStringUtf8(); 2757 visitorId_ = s; 2758 return s; 2759 } else { 2760 return (java.lang.String) ref; 2761 } 2762 } 2763 /** 2764 * 2765 * 2766 * <pre> 2767 * Required. A unique identifier for tracking visitors. 2768 * For example, this could be implemented with an HTTP cookie, which should be 2769 * able to uniquely identify a visitor on a single device. This unique 2770 * identifier should not change if the visitor log in/out of the website. 2771 * Don't set the field to the same fixed ID for different users. This mixes 2772 * the event history of those users together, which results in degraded model 2773 * quality. 2774 * The field must be a UTF-8 encoded string with a length limit of 128 2775 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 2776 * The field should not contain PII or user-data. We recommend to use Google 2777 * Analytics [Client 2778 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 2779 * for this field. 2780 * </pre> 2781 * 2782 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 2783 * 2784 * @return The bytes for visitorId. 2785 */ getVisitorIdBytes()2786 public com.google.protobuf.ByteString getVisitorIdBytes() { 2787 java.lang.Object ref = visitorId_; 2788 if (ref instanceof String) { 2789 com.google.protobuf.ByteString b = 2790 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2791 visitorId_ = b; 2792 return b; 2793 } else { 2794 return (com.google.protobuf.ByteString) ref; 2795 } 2796 } 2797 /** 2798 * 2799 * 2800 * <pre> 2801 * Required. A unique identifier for tracking visitors. 2802 * For example, this could be implemented with an HTTP cookie, which should be 2803 * able to uniquely identify a visitor on a single device. This unique 2804 * identifier should not change if the visitor log in/out of the website. 2805 * Don't set the field to the same fixed ID for different users. This mixes 2806 * the event history of those users together, which results in degraded model 2807 * quality. 2808 * The field must be a UTF-8 encoded string with a length limit of 128 2809 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 2810 * The field should not contain PII or user-data. We recommend to use Google 2811 * Analytics [Client 2812 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 2813 * for this field. 2814 * </pre> 2815 * 2816 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 2817 * 2818 * @param value The visitorId to set. 2819 * @return This builder for chaining. 2820 */ setVisitorId(java.lang.String value)2821 public Builder setVisitorId(java.lang.String value) { 2822 if (value == null) { 2823 throw new NullPointerException(); 2824 } 2825 visitorId_ = value; 2826 bitField0_ |= 0x00000002; 2827 onChanged(); 2828 return this; 2829 } 2830 /** 2831 * 2832 * 2833 * <pre> 2834 * Required. A unique identifier for tracking visitors. 2835 * For example, this could be implemented with an HTTP cookie, which should be 2836 * able to uniquely identify a visitor on a single device. This unique 2837 * identifier should not change if the visitor log in/out of the website. 2838 * Don't set the field to the same fixed ID for different users. This mixes 2839 * the event history of those users together, which results in degraded model 2840 * quality. 2841 * The field must be a UTF-8 encoded string with a length limit of 128 2842 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 2843 * The field should not contain PII or user-data. We recommend to use Google 2844 * Analytics [Client 2845 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 2846 * for this field. 2847 * </pre> 2848 * 2849 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 2850 * 2851 * @return This builder for chaining. 2852 */ clearVisitorId()2853 public Builder clearVisitorId() { 2854 visitorId_ = getDefaultInstance().getVisitorId(); 2855 bitField0_ = (bitField0_ & ~0x00000002); 2856 onChanged(); 2857 return this; 2858 } 2859 /** 2860 * 2861 * 2862 * <pre> 2863 * Required. A unique identifier for tracking visitors. 2864 * For example, this could be implemented with an HTTP cookie, which should be 2865 * able to uniquely identify a visitor on a single device. This unique 2866 * identifier should not change if the visitor log in/out of the website. 2867 * Don't set the field to the same fixed ID for different users. This mixes 2868 * the event history of those users together, which results in degraded model 2869 * quality. 2870 * The field must be a UTF-8 encoded string with a length limit of 128 2871 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 2872 * The field should not contain PII or user-data. We recommend to use Google 2873 * Analytics [Client 2874 * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 2875 * for this field. 2876 * </pre> 2877 * 2878 * <code>string visitor_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 2879 * 2880 * @param value The bytes for visitorId to set. 2881 * @return This builder for chaining. 2882 */ setVisitorIdBytes(com.google.protobuf.ByteString value)2883 public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { 2884 if (value == null) { 2885 throw new NullPointerException(); 2886 } 2887 checkByteStringIsUtf8(value); 2888 visitorId_ = value; 2889 bitField0_ |= 0x00000002; 2890 onChanged(); 2891 return this; 2892 } 2893 2894 private java.lang.Object sessionId_ = ""; 2895 /** 2896 * 2897 * 2898 * <pre> 2899 * A unique identifier for tracking a visitor session with a length limit of 2900 * 128 bytes. A session is an aggregation of an end user behavior in a time 2901 * span. 2902 * A general guideline to populate the sesion_id: 2903 * 1. If user has no activity for 30 min, a new session_id should be assigned. 2904 * 2. The session_id should be unique across users, suggest use uuid or add 2905 * visitor_id as prefix. 2906 * </pre> 2907 * 2908 * <code>string session_id = 21;</code> 2909 * 2910 * @return The sessionId. 2911 */ getSessionId()2912 public java.lang.String getSessionId() { 2913 java.lang.Object ref = sessionId_; 2914 if (!(ref instanceof java.lang.String)) { 2915 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2916 java.lang.String s = bs.toStringUtf8(); 2917 sessionId_ = s; 2918 return s; 2919 } else { 2920 return (java.lang.String) ref; 2921 } 2922 } 2923 /** 2924 * 2925 * 2926 * <pre> 2927 * A unique identifier for tracking a visitor session with a length limit of 2928 * 128 bytes. A session is an aggregation of an end user behavior in a time 2929 * span. 2930 * A general guideline to populate the sesion_id: 2931 * 1. If user has no activity for 30 min, a new session_id should be assigned. 2932 * 2. The session_id should be unique across users, suggest use uuid or add 2933 * visitor_id as prefix. 2934 * </pre> 2935 * 2936 * <code>string session_id = 21;</code> 2937 * 2938 * @return The bytes for sessionId. 2939 */ getSessionIdBytes()2940 public com.google.protobuf.ByteString getSessionIdBytes() { 2941 java.lang.Object ref = sessionId_; 2942 if (ref instanceof String) { 2943 com.google.protobuf.ByteString b = 2944 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2945 sessionId_ = b; 2946 return b; 2947 } else { 2948 return (com.google.protobuf.ByteString) ref; 2949 } 2950 } 2951 /** 2952 * 2953 * 2954 * <pre> 2955 * A unique identifier for tracking a visitor session with a length limit of 2956 * 128 bytes. A session is an aggregation of an end user behavior in a time 2957 * span. 2958 * A general guideline to populate the sesion_id: 2959 * 1. If user has no activity for 30 min, a new session_id should be assigned. 2960 * 2. The session_id should be unique across users, suggest use uuid or add 2961 * visitor_id as prefix. 2962 * </pre> 2963 * 2964 * <code>string session_id = 21;</code> 2965 * 2966 * @param value The sessionId to set. 2967 * @return This builder for chaining. 2968 */ setSessionId(java.lang.String value)2969 public Builder setSessionId(java.lang.String value) { 2970 if (value == null) { 2971 throw new NullPointerException(); 2972 } 2973 sessionId_ = value; 2974 bitField0_ |= 0x00000004; 2975 onChanged(); 2976 return this; 2977 } 2978 /** 2979 * 2980 * 2981 * <pre> 2982 * A unique identifier for tracking a visitor session with a length limit of 2983 * 128 bytes. A session is an aggregation of an end user behavior in a time 2984 * span. 2985 * A general guideline to populate the sesion_id: 2986 * 1. If user has no activity for 30 min, a new session_id should be assigned. 2987 * 2. The session_id should be unique across users, suggest use uuid or add 2988 * visitor_id as prefix. 2989 * </pre> 2990 * 2991 * <code>string session_id = 21;</code> 2992 * 2993 * @return This builder for chaining. 2994 */ clearSessionId()2995 public Builder clearSessionId() { 2996 sessionId_ = getDefaultInstance().getSessionId(); 2997 bitField0_ = (bitField0_ & ~0x00000004); 2998 onChanged(); 2999 return this; 3000 } 3001 /** 3002 * 3003 * 3004 * <pre> 3005 * A unique identifier for tracking a visitor session with a length limit of 3006 * 128 bytes. A session is an aggregation of an end user behavior in a time 3007 * span. 3008 * A general guideline to populate the sesion_id: 3009 * 1. If user has no activity for 30 min, a new session_id should be assigned. 3010 * 2. The session_id should be unique across users, suggest use uuid or add 3011 * visitor_id as prefix. 3012 * </pre> 3013 * 3014 * <code>string session_id = 21;</code> 3015 * 3016 * @param value The bytes for sessionId to set. 3017 * @return This builder for chaining. 3018 */ setSessionIdBytes(com.google.protobuf.ByteString value)3019 public Builder setSessionIdBytes(com.google.protobuf.ByteString value) { 3020 if (value == null) { 3021 throw new NullPointerException(); 3022 } 3023 checkByteStringIsUtf8(value); 3024 sessionId_ = value; 3025 bitField0_ |= 0x00000004; 3026 onChanged(); 3027 return this; 3028 } 3029 3030 private com.google.protobuf.Timestamp eventTime_; 3031 private com.google.protobuf.SingleFieldBuilderV3< 3032 com.google.protobuf.Timestamp, 3033 com.google.protobuf.Timestamp.Builder, 3034 com.google.protobuf.TimestampOrBuilder> 3035 eventTimeBuilder_; 3036 /** 3037 * 3038 * 3039 * <pre> 3040 * Only required for 3041 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3042 * method. Timestamp of when the user event happened. 3043 * </pre> 3044 * 3045 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3046 * 3047 * @return Whether the eventTime field is set. 3048 */ hasEventTime()3049 public boolean hasEventTime() { 3050 return ((bitField0_ & 0x00000008) != 0); 3051 } 3052 /** 3053 * 3054 * 3055 * <pre> 3056 * Only required for 3057 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3058 * method. Timestamp of when the user event happened. 3059 * </pre> 3060 * 3061 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3062 * 3063 * @return The eventTime. 3064 */ getEventTime()3065 public com.google.protobuf.Timestamp getEventTime() { 3066 if (eventTimeBuilder_ == null) { 3067 return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; 3068 } else { 3069 return eventTimeBuilder_.getMessage(); 3070 } 3071 } 3072 /** 3073 * 3074 * 3075 * <pre> 3076 * Only required for 3077 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3078 * method. Timestamp of when the user event happened. 3079 * </pre> 3080 * 3081 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3082 */ setEventTime(com.google.protobuf.Timestamp value)3083 public Builder setEventTime(com.google.protobuf.Timestamp value) { 3084 if (eventTimeBuilder_ == null) { 3085 if (value == null) { 3086 throw new NullPointerException(); 3087 } 3088 eventTime_ = value; 3089 } else { 3090 eventTimeBuilder_.setMessage(value); 3091 } 3092 bitField0_ |= 0x00000008; 3093 onChanged(); 3094 return this; 3095 } 3096 /** 3097 * 3098 * 3099 * <pre> 3100 * Only required for 3101 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3102 * method. Timestamp of when the user event happened. 3103 * </pre> 3104 * 3105 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3106 */ setEventTime(com.google.protobuf.Timestamp.Builder builderForValue)3107 public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { 3108 if (eventTimeBuilder_ == null) { 3109 eventTime_ = builderForValue.build(); 3110 } else { 3111 eventTimeBuilder_.setMessage(builderForValue.build()); 3112 } 3113 bitField0_ |= 0x00000008; 3114 onChanged(); 3115 return this; 3116 } 3117 /** 3118 * 3119 * 3120 * <pre> 3121 * Only required for 3122 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3123 * method. Timestamp of when the user event happened. 3124 * </pre> 3125 * 3126 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3127 */ mergeEventTime(com.google.protobuf.Timestamp value)3128 public Builder mergeEventTime(com.google.protobuf.Timestamp value) { 3129 if (eventTimeBuilder_ == null) { 3130 if (((bitField0_ & 0x00000008) != 0) 3131 && eventTime_ != null 3132 && eventTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 3133 getEventTimeBuilder().mergeFrom(value); 3134 } else { 3135 eventTime_ = value; 3136 } 3137 } else { 3138 eventTimeBuilder_.mergeFrom(value); 3139 } 3140 bitField0_ |= 0x00000008; 3141 onChanged(); 3142 return this; 3143 } 3144 /** 3145 * 3146 * 3147 * <pre> 3148 * Only required for 3149 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3150 * method. Timestamp of when the user event happened. 3151 * </pre> 3152 * 3153 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3154 */ clearEventTime()3155 public Builder clearEventTime() { 3156 bitField0_ = (bitField0_ & ~0x00000008); 3157 eventTime_ = null; 3158 if (eventTimeBuilder_ != null) { 3159 eventTimeBuilder_.dispose(); 3160 eventTimeBuilder_ = null; 3161 } 3162 onChanged(); 3163 return this; 3164 } 3165 /** 3166 * 3167 * 3168 * <pre> 3169 * Only required for 3170 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3171 * method. Timestamp of when the user event happened. 3172 * </pre> 3173 * 3174 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3175 */ getEventTimeBuilder()3176 public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { 3177 bitField0_ |= 0x00000008; 3178 onChanged(); 3179 return getEventTimeFieldBuilder().getBuilder(); 3180 } 3181 /** 3182 * 3183 * 3184 * <pre> 3185 * Only required for 3186 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3187 * method. Timestamp of when the user event happened. 3188 * </pre> 3189 * 3190 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3191 */ getEventTimeOrBuilder()3192 public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { 3193 if (eventTimeBuilder_ != null) { 3194 return eventTimeBuilder_.getMessageOrBuilder(); 3195 } else { 3196 return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; 3197 } 3198 } 3199 /** 3200 * 3201 * 3202 * <pre> 3203 * Only required for 3204 * [UserEventService.ImportUserEvents][google.cloud.retail.v2.UserEventService.ImportUserEvents] 3205 * method. Timestamp of when the user event happened. 3206 * </pre> 3207 * 3208 * <code>.google.protobuf.Timestamp event_time = 3;</code> 3209 */ 3210 private com.google.protobuf.SingleFieldBuilderV3< 3211 com.google.protobuf.Timestamp, 3212 com.google.protobuf.Timestamp.Builder, 3213 com.google.protobuf.TimestampOrBuilder> getEventTimeFieldBuilder()3214 getEventTimeFieldBuilder() { 3215 if (eventTimeBuilder_ == null) { 3216 eventTimeBuilder_ = 3217 new com.google.protobuf.SingleFieldBuilderV3< 3218 com.google.protobuf.Timestamp, 3219 com.google.protobuf.Timestamp.Builder, 3220 com.google.protobuf.TimestampOrBuilder>( 3221 getEventTime(), getParentForChildren(), isClean()); 3222 eventTime_ = null; 3223 } 3224 return eventTimeBuilder_; 3225 } 3226 3227 private com.google.protobuf.LazyStringList experimentIds_ = 3228 com.google.protobuf.LazyStringArrayList.EMPTY; 3229 ensureExperimentIdsIsMutable()3230 private void ensureExperimentIdsIsMutable() { 3231 if (!((bitField0_ & 0x00000010) != 0)) { 3232 experimentIds_ = new com.google.protobuf.LazyStringArrayList(experimentIds_); 3233 bitField0_ |= 0x00000010; 3234 } 3235 } 3236 /** 3237 * 3238 * 3239 * <pre> 3240 * A list of identifiers for the independent experiment groups this user event 3241 * belongs to. This is used to distinguish between user events associated with 3242 * different experiment setups (e.g. using Retail API, using different 3243 * recommendation models). 3244 * </pre> 3245 * 3246 * <code>repeated string experiment_ids = 4;</code> 3247 * 3248 * @return A list containing the experimentIds. 3249 */ getExperimentIdsList()3250 public com.google.protobuf.ProtocolStringList getExperimentIdsList() { 3251 return experimentIds_.getUnmodifiableView(); 3252 } 3253 /** 3254 * 3255 * 3256 * <pre> 3257 * A list of identifiers for the independent experiment groups this user event 3258 * belongs to. This is used to distinguish between user events associated with 3259 * different experiment setups (e.g. using Retail API, using different 3260 * recommendation models). 3261 * </pre> 3262 * 3263 * <code>repeated string experiment_ids = 4;</code> 3264 * 3265 * @return The count of experimentIds. 3266 */ getExperimentIdsCount()3267 public int getExperimentIdsCount() { 3268 return experimentIds_.size(); 3269 } 3270 /** 3271 * 3272 * 3273 * <pre> 3274 * A list of identifiers for the independent experiment groups this user event 3275 * belongs to. This is used to distinguish between user events associated with 3276 * different experiment setups (e.g. using Retail API, using different 3277 * recommendation models). 3278 * </pre> 3279 * 3280 * <code>repeated string experiment_ids = 4;</code> 3281 * 3282 * @param index The index of the element to return. 3283 * @return The experimentIds at the given index. 3284 */ getExperimentIds(int index)3285 public java.lang.String getExperimentIds(int index) { 3286 return experimentIds_.get(index); 3287 } 3288 /** 3289 * 3290 * 3291 * <pre> 3292 * A list of identifiers for the independent experiment groups this user event 3293 * belongs to. This is used to distinguish between user events associated with 3294 * different experiment setups (e.g. using Retail API, using different 3295 * recommendation models). 3296 * </pre> 3297 * 3298 * <code>repeated string experiment_ids = 4;</code> 3299 * 3300 * @param index The index of the value to return. 3301 * @return The bytes of the experimentIds at the given index. 3302 */ getExperimentIdsBytes(int index)3303 public com.google.protobuf.ByteString getExperimentIdsBytes(int index) { 3304 return experimentIds_.getByteString(index); 3305 } 3306 /** 3307 * 3308 * 3309 * <pre> 3310 * A list of identifiers for the independent experiment groups this user event 3311 * belongs to. This is used to distinguish between user events associated with 3312 * different experiment setups (e.g. using Retail API, using different 3313 * recommendation models). 3314 * </pre> 3315 * 3316 * <code>repeated string experiment_ids = 4;</code> 3317 * 3318 * @param index The index to set the value at. 3319 * @param value The experimentIds to set. 3320 * @return This builder for chaining. 3321 */ setExperimentIds(int index, java.lang.String value)3322 public Builder setExperimentIds(int index, java.lang.String value) { 3323 if (value == null) { 3324 throw new NullPointerException(); 3325 } 3326 ensureExperimentIdsIsMutable(); 3327 experimentIds_.set(index, value); 3328 onChanged(); 3329 return this; 3330 } 3331 /** 3332 * 3333 * 3334 * <pre> 3335 * A list of identifiers for the independent experiment groups this user event 3336 * belongs to. This is used to distinguish between user events associated with 3337 * different experiment setups (e.g. using Retail API, using different 3338 * recommendation models). 3339 * </pre> 3340 * 3341 * <code>repeated string experiment_ids = 4;</code> 3342 * 3343 * @param value The experimentIds to add. 3344 * @return This builder for chaining. 3345 */ addExperimentIds(java.lang.String value)3346 public Builder addExperimentIds(java.lang.String value) { 3347 if (value == null) { 3348 throw new NullPointerException(); 3349 } 3350 ensureExperimentIdsIsMutable(); 3351 experimentIds_.add(value); 3352 onChanged(); 3353 return this; 3354 } 3355 /** 3356 * 3357 * 3358 * <pre> 3359 * A list of identifiers for the independent experiment groups this user event 3360 * belongs to. This is used to distinguish between user events associated with 3361 * different experiment setups (e.g. using Retail API, using different 3362 * recommendation models). 3363 * </pre> 3364 * 3365 * <code>repeated string experiment_ids = 4;</code> 3366 * 3367 * @param values The experimentIds to add. 3368 * @return This builder for chaining. 3369 */ addAllExperimentIds(java.lang.Iterable<java.lang.String> values)3370 public Builder addAllExperimentIds(java.lang.Iterable<java.lang.String> values) { 3371 ensureExperimentIdsIsMutable(); 3372 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, experimentIds_); 3373 onChanged(); 3374 return this; 3375 } 3376 /** 3377 * 3378 * 3379 * <pre> 3380 * A list of identifiers for the independent experiment groups this user event 3381 * belongs to. This is used to distinguish between user events associated with 3382 * different experiment setups (e.g. using Retail API, using different 3383 * recommendation models). 3384 * </pre> 3385 * 3386 * <code>repeated string experiment_ids = 4;</code> 3387 * 3388 * @return This builder for chaining. 3389 */ clearExperimentIds()3390 public Builder clearExperimentIds() { 3391 experimentIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; 3392 bitField0_ = (bitField0_ & ~0x00000010); 3393 onChanged(); 3394 return this; 3395 } 3396 /** 3397 * 3398 * 3399 * <pre> 3400 * A list of identifiers for the independent experiment groups this user event 3401 * belongs to. This is used to distinguish between user events associated with 3402 * different experiment setups (e.g. using Retail API, using different 3403 * recommendation models). 3404 * </pre> 3405 * 3406 * <code>repeated string experiment_ids = 4;</code> 3407 * 3408 * @param value The bytes of the experimentIds to add. 3409 * @return This builder for chaining. 3410 */ addExperimentIdsBytes(com.google.protobuf.ByteString value)3411 public Builder addExperimentIdsBytes(com.google.protobuf.ByteString value) { 3412 if (value == null) { 3413 throw new NullPointerException(); 3414 } 3415 checkByteStringIsUtf8(value); 3416 ensureExperimentIdsIsMutable(); 3417 experimentIds_.add(value); 3418 onChanged(); 3419 return this; 3420 } 3421 3422 private java.lang.Object attributionToken_ = ""; 3423 /** 3424 * 3425 * 3426 * <pre> 3427 * Highly recommended for user events that are the result of 3428 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3429 * This field enables accurate attribution of recommendation model 3430 * performance. 3431 * The value must be a valid 3432 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3433 * for user events that are the result of 3434 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3435 * The value must be a valid 3436 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 3437 * for user events that are the result of 3438 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 3439 * This token enables us to accurately attribute page view or purchase back to 3440 * the event and the particular predict response containing this 3441 * clicked/purchased product. If user clicks on product K in the 3442 * recommendation results, pass 3443 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3444 * as a URL parameter to product K's page. When recording events on product 3445 * K's page, log the 3446 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3447 * to this field. 3448 * </pre> 3449 * 3450 * <code>string attribution_token = 5;</code> 3451 * 3452 * @return The attributionToken. 3453 */ getAttributionToken()3454 public java.lang.String getAttributionToken() { 3455 java.lang.Object ref = attributionToken_; 3456 if (!(ref instanceof java.lang.String)) { 3457 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3458 java.lang.String s = bs.toStringUtf8(); 3459 attributionToken_ = s; 3460 return s; 3461 } else { 3462 return (java.lang.String) ref; 3463 } 3464 } 3465 /** 3466 * 3467 * 3468 * <pre> 3469 * Highly recommended for user events that are the result of 3470 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3471 * This field enables accurate attribution of recommendation model 3472 * performance. 3473 * The value must be a valid 3474 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3475 * for user events that are the result of 3476 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3477 * The value must be a valid 3478 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 3479 * for user events that are the result of 3480 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 3481 * This token enables us to accurately attribute page view or purchase back to 3482 * the event and the particular predict response containing this 3483 * clicked/purchased product. If user clicks on product K in the 3484 * recommendation results, pass 3485 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3486 * as a URL parameter to product K's page. When recording events on product 3487 * K's page, log the 3488 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3489 * to this field. 3490 * </pre> 3491 * 3492 * <code>string attribution_token = 5;</code> 3493 * 3494 * @return The bytes for attributionToken. 3495 */ getAttributionTokenBytes()3496 public com.google.protobuf.ByteString getAttributionTokenBytes() { 3497 java.lang.Object ref = attributionToken_; 3498 if (ref instanceof String) { 3499 com.google.protobuf.ByteString b = 3500 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3501 attributionToken_ = b; 3502 return b; 3503 } else { 3504 return (com.google.protobuf.ByteString) ref; 3505 } 3506 } 3507 /** 3508 * 3509 * 3510 * <pre> 3511 * Highly recommended for user events that are the result of 3512 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3513 * This field enables accurate attribution of recommendation model 3514 * performance. 3515 * The value must be a valid 3516 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3517 * for user events that are the result of 3518 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3519 * The value must be a valid 3520 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 3521 * for user events that are the result of 3522 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 3523 * This token enables us to accurately attribute page view or purchase back to 3524 * the event and the particular predict response containing this 3525 * clicked/purchased product. If user clicks on product K in the 3526 * recommendation results, pass 3527 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3528 * as a URL parameter to product K's page. When recording events on product 3529 * K's page, log the 3530 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3531 * to this field. 3532 * </pre> 3533 * 3534 * <code>string attribution_token = 5;</code> 3535 * 3536 * @param value The attributionToken to set. 3537 * @return This builder for chaining. 3538 */ setAttributionToken(java.lang.String value)3539 public Builder setAttributionToken(java.lang.String value) { 3540 if (value == null) { 3541 throw new NullPointerException(); 3542 } 3543 attributionToken_ = value; 3544 bitField0_ |= 0x00000020; 3545 onChanged(); 3546 return this; 3547 } 3548 /** 3549 * 3550 * 3551 * <pre> 3552 * Highly recommended for user events that are the result of 3553 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3554 * This field enables accurate attribution of recommendation model 3555 * performance. 3556 * The value must be a valid 3557 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3558 * for user events that are the result of 3559 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3560 * The value must be a valid 3561 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 3562 * for user events that are the result of 3563 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 3564 * This token enables us to accurately attribute page view or purchase back to 3565 * the event and the particular predict response containing this 3566 * clicked/purchased product. If user clicks on product K in the 3567 * recommendation results, pass 3568 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3569 * as a URL parameter to product K's page. When recording events on product 3570 * K's page, log the 3571 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3572 * to this field. 3573 * </pre> 3574 * 3575 * <code>string attribution_token = 5;</code> 3576 * 3577 * @return This builder for chaining. 3578 */ clearAttributionToken()3579 public Builder clearAttributionToken() { 3580 attributionToken_ = getDefaultInstance().getAttributionToken(); 3581 bitField0_ = (bitField0_ & ~0x00000020); 3582 onChanged(); 3583 return this; 3584 } 3585 /** 3586 * 3587 * 3588 * <pre> 3589 * Highly recommended for user events that are the result of 3590 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3591 * This field enables accurate attribution of recommendation model 3592 * performance. 3593 * The value must be a valid 3594 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3595 * for user events that are the result of 3596 * [PredictionService.Predict][google.cloud.retail.v2.PredictionService.Predict]. 3597 * The value must be a valid 3598 * [SearchResponse.attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 3599 * for user events that are the result of 3600 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. 3601 * This token enables us to accurately attribute page view or purchase back to 3602 * the event and the particular predict response containing this 3603 * clicked/purchased product. If user clicks on product K in the 3604 * recommendation results, pass 3605 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3606 * as a URL parameter to product K's page. When recording events on product 3607 * K's page, log the 3608 * [PredictResponse.attribution_token][google.cloud.retail.v2.PredictResponse.attribution_token] 3609 * to this field. 3610 * </pre> 3611 * 3612 * <code>string attribution_token = 5;</code> 3613 * 3614 * @param value The bytes for attributionToken to set. 3615 * @return This builder for chaining. 3616 */ setAttributionTokenBytes(com.google.protobuf.ByteString value)3617 public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { 3618 if (value == null) { 3619 throw new NullPointerException(); 3620 } 3621 checkByteStringIsUtf8(value); 3622 attributionToken_ = value; 3623 bitField0_ |= 0x00000020; 3624 onChanged(); 3625 return this; 3626 } 3627 3628 private java.util.List<com.google.cloud.retail.v2.ProductDetail> productDetails_ = 3629 java.util.Collections.emptyList(); 3630 ensureProductDetailsIsMutable()3631 private void ensureProductDetailsIsMutable() { 3632 if (!((bitField0_ & 0x00000040) != 0)) { 3633 productDetails_ = 3634 new java.util.ArrayList<com.google.cloud.retail.v2.ProductDetail>(productDetails_); 3635 bitField0_ |= 0x00000040; 3636 } 3637 } 3638 3639 private com.google.protobuf.RepeatedFieldBuilderV3< 3640 com.google.cloud.retail.v2.ProductDetail, 3641 com.google.cloud.retail.v2.ProductDetail.Builder, 3642 com.google.cloud.retail.v2.ProductDetailOrBuilder> 3643 productDetailsBuilder_; 3644 3645 /** 3646 * 3647 * 3648 * <pre> 3649 * The main product details related to the event. 3650 * This field is optional except for the following event types: 3651 * * `add-to-cart` 3652 * * `detail-page-view` 3653 * * `purchase-complete` 3654 * In a `search` event, this field represents the products returned to the end 3655 * user on the current page (the end user may have not finished browsing the 3656 * whole page yet). When a new page is returned to the end user, after 3657 * pagination/filtering/ordering even for the same query, a new `search` event 3658 * with different 3659 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3660 * desired. The end user may have not finished browsing the whole page yet. 3661 * </pre> 3662 * 3663 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3664 */ getProductDetailsList()3665 public java.util.List<com.google.cloud.retail.v2.ProductDetail> getProductDetailsList() { 3666 if (productDetailsBuilder_ == null) { 3667 return java.util.Collections.unmodifiableList(productDetails_); 3668 } else { 3669 return productDetailsBuilder_.getMessageList(); 3670 } 3671 } 3672 /** 3673 * 3674 * 3675 * <pre> 3676 * The main product details related to the event. 3677 * This field is optional except for the following event types: 3678 * * `add-to-cart` 3679 * * `detail-page-view` 3680 * * `purchase-complete` 3681 * In a `search` event, this field represents the products returned to the end 3682 * user on the current page (the end user may have not finished browsing the 3683 * whole page yet). When a new page is returned to the end user, after 3684 * pagination/filtering/ordering even for the same query, a new `search` event 3685 * with different 3686 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3687 * desired. The end user may have not finished browsing the whole page yet. 3688 * </pre> 3689 * 3690 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3691 */ getProductDetailsCount()3692 public int getProductDetailsCount() { 3693 if (productDetailsBuilder_ == null) { 3694 return productDetails_.size(); 3695 } else { 3696 return productDetailsBuilder_.getCount(); 3697 } 3698 } 3699 /** 3700 * 3701 * 3702 * <pre> 3703 * The main product details related to the event. 3704 * This field is optional except for the following event types: 3705 * * `add-to-cart` 3706 * * `detail-page-view` 3707 * * `purchase-complete` 3708 * In a `search` event, this field represents the products returned to the end 3709 * user on the current page (the end user may have not finished browsing the 3710 * whole page yet). When a new page is returned to the end user, after 3711 * pagination/filtering/ordering even for the same query, a new `search` event 3712 * with different 3713 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3714 * desired. The end user may have not finished browsing the whole page yet. 3715 * </pre> 3716 * 3717 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3718 */ getProductDetails(int index)3719 public com.google.cloud.retail.v2.ProductDetail getProductDetails(int index) { 3720 if (productDetailsBuilder_ == null) { 3721 return productDetails_.get(index); 3722 } else { 3723 return productDetailsBuilder_.getMessage(index); 3724 } 3725 } 3726 /** 3727 * 3728 * 3729 * <pre> 3730 * The main product details related to the event. 3731 * This field is optional except for the following event types: 3732 * * `add-to-cart` 3733 * * `detail-page-view` 3734 * * `purchase-complete` 3735 * In a `search` event, this field represents the products returned to the end 3736 * user on the current page (the end user may have not finished browsing the 3737 * whole page yet). When a new page is returned to the end user, after 3738 * pagination/filtering/ordering even for the same query, a new `search` event 3739 * with different 3740 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3741 * desired. The end user may have not finished browsing the whole page yet. 3742 * </pre> 3743 * 3744 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3745 */ setProductDetails(int index, com.google.cloud.retail.v2.ProductDetail value)3746 public Builder setProductDetails(int index, com.google.cloud.retail.v2.ProductDetail value) { 3747 if (productDetailsBuilder_ == null) { 3748 if (value == null) { 3749 throw new NullPointerException(); 3750 } 3751 ensureProductDetailsIsMutable(); 3752 productDetails_.set(index, value); 3753 onChanged(); 3754 } else { 3755 productDetailsBuilder_.setMessage(index, value); 3756 } 3757 return this; 3758 } 3759 /** 3760 * 3761 * 3762 * <pre> 3763 * The main product details related to the event. 3764 * This field is optional except for the following event types: 3765 * * `add-to-cart` 3766 * * `detail-page-view` 3767 * * `purchase-complete` 3768 * In a `search` event, this field represents the products returned to the end 3769 * user on the current page (the end user may have not finished browsing the 3770 * whole page yet). When a new page is returned to the end user, after 3771 * pagination/filtering/ordering even for the same query, a new `search` event 3772 * with different 3773 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3774 * desired. The end user may have not finished browsing the whole page yet. 3775 * </pre> 3776 * 3777 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3778 */ setProductDetails( int index, com.google.cloud.retail.v2.ProductDetail.Builder builderForValue)3779 public Builder setProductDetails( 3780 int index, com.google.cloud.retail.v2.ProductDetail.Builder builderForValue) { 3781 if (productDetailsBuilder_ == null) { 3782 ensureProductDetailsIsMutable(); 3783 productDetails_.set(index, builderForValue.build()); 3784 onChanged(); 3785 } else { 3786 productDetailsBuilder_.setMessage(index, builderForValue.build()); 3787 } 3788 return this; 3789 } 3790 /** 3791 * 3792 * 3793 * <pre> 3794 * The main product details related to the event. 3795 * This field is optional except for the following event types: 3796 * * `add-to-cart` 3797 * * `detail-page-view` 3798 * * `purchase-complete` 3799 * In a `search` event, this field represents the products returned to the end 3800 * user on the current page (the end user may have not finished browsing the 3801 * whole page yet). When a new page is returned to the end user, after 3802 * pagination/filtering/ordering even for the same query, a new `search` event 3803 * with different 3804 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3805 * desired. The end user may have not finished browsing the whole page yet. 3806 * </pre> 3807 * 3808 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3809 */ addProductDetails(com.google.cloud.retail.v2.ProductDetail value)3810 public Builder addProductDetails(com.google.cloud.retail.v2.ProductDetail value) { 3811 if (productDetailsBuilder_ == null) { 3812 if (value == null) { 3813 throw new NullPointerException(); 3814 } 3815 ensureProductDetailsIsMutable(); 3816 productDetails_.add(value); 3817 onChanged(); 3818 } else { 3819 productDetailsBuilder_.addMessage(value); 3820 } 3821 return this; 3822 } 3823 /** 3824 * 3825 * 3826 * <pre> 3827 * The main product details related to the event. 3828 * This field is optional except for the following event types: 3829 * * `add-to-cart` 3830 * * `detail-page-view` 3831 * * `purchase-complete` 3832 * In a `search` event, this field represents the products returned to the end 3833 * user on the current page (the end user may have not finished browsing the 3834 * whole page yet). When a new page is returned to the end user, after 3835 * pagination/filtering/ordering even for the same query, a new `search` event 3836 * with different 3837 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3838 * desired. The end user may have not finished browsing the whole page yet. 3839 * </pre> 3840 * 3841 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3842 */ addProductDetails(int index, com.google.cloud.retail.v2.ProductDetail value)3843 public Builder addProductDetails(int index, com.google.cloud.retail.v2.ProductDetail value) { 3844 if (productDetailsBuilder_ == null) { 3845 if (value == null) { 3846 throw new NullPointerException(); 3847 } 3848 ensureProductDetailsIsMutable(); 3849 productDetails_.add(index, value); 3850 onChanged(); 3851 } else { 3852 productDetailsBuilder_.addMessage(index, value); 3853 } 3854 return this; 3855 } 3856 /** 3857 * 3858 * 3859 * <pre> 3860 * The main product details related to the event. 3861 * This field is optional except for the following event types: 3862 * * `add-to-cart` 3863 * * `detail-page-view` 3864 * * `purchase-complete` 3865 * In a `search` event, this field represents the products returned to the end 3866 * user on the current page (the end user may have not finished browsing the 3867 * whole page yet). When a new page is returned to the end user, after 3868 * pagination/filtering/ordering even for the same query, a new `search` event 3869 * with different 3870 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3871 * desired. The end user may have not finished browsing the whole page yet. 3872 * </pre> 3873 * 3874 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3875 */ addProductDetails( com.google.cloud.retail.v2.ProductDetail.Builder builderForValue)3876 public Builder addProductDetails( 3877 com.google.cloud.retail.v2.ProductDetail.Builder builderForValue) { 3878 if (productDetailsBuilder_ == null) { 3879 ensureProductDetailsIsMutable(); 3880 productDetails_.add(builderForValue.build()); 3881 onChanged(); 3882 } else { 3883 productDetailsBuilder_.addMessage(builderForValue.build()); 3884 } 3885 return this; 3886 } 3887 /** 3888 * 3889 * 3890 * <pre> 3891 * The main product details related to the event. 3892 * This field is optional except for the following event types: 3893 * * `add-to-cart` 3894 * * `detail-page-view` 3895 * * `purchase-complete` 3896 * In a `search` event, this field represents the products returned to the end 3897 * user on the current page (the end user may have not finished browsing the 3898 * whole page yet). When a new page is returned to the end user, after 3899 * pagination/filtering/ordering even for the same query, a new `search` event 3900 * with different 3901 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3902 * desired. The end user may have not finished browsing the whole page yet. 3903 * </pre> 3904 * 3905 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3906 */ addProductDetails( int index, com.google.cloud.retail.v2.ProductDetail.Builder builderForValue)3907 public Builder addProductDetails( 3908 int index, com.google.cloud.retail.v2.ProductDetail.Builder builderForValue) { 3909 if (productDetailsBuilder_ == null) { 3910 ensureProductDetailsIsMutable(); 3911 productDetails_.add(index, builderForValue.build()); 3912 onChanged(); 3913 } else { 3914 productDetailsBuilder_.addMessage(index, builderForValue.build()); 3915 } 3916 return this; 3917 } 3918 /** 3919 * 3920 * 3921 * <pre> 3922 * The main product details related to the event. 3923 * This field is optional except for the following event types: 3924 * * `add-to-cart` 3925 * * `detail-page-view` 3926 * * `purchase-complete` 3927 * In a `search` event, this field represents the products returned to the end 3928 * user on the current page (the end user may have not finished browsing the 3929 * whole page yet). When a new page is returned to the end user, after 3930 * pagination/filtering/ordering even for the same query, a new `search` event 3931 * with different 3932 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3933 * desired. The end user may have not finished browsing the whole page yet. 3934 * </pre> 3935 * 3936 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3937 */ addAllProductDetails( java.lang.Iterable<? extends com.google.cloud.retail.v2.ProductDetail> values)3938 public Builder addAllProductDetails( 3939 java.lang.Iterable<? extends com.google.cloud.retail.v2.ProductDetail> values) { 3940 if (productDetailsBuilder_ == null) { 3941 ensureProductDetailsIsMutable(); 3942 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); 3943 onChanged(); 3944 } else { 3945 productDetailsBuilder_.addAllMessages(values); 3946 } 3947 return this; 3948 } 3949 /** 3950 * 3951 * 3952 * <pre> 3953 * The main product details related to the event. 3954 * This field is optional except for the following event types: 3955 * * `add-to-cart` 3956 * * `detail-page-view` 3957 * * `purchase-complete` 3958 * In a `search` event, this field represents the products returned to the end 3959 * user on the current page (the end user may have not finished browsing the 3960 * whole page yet). When a new page is returned to the end user, after 3961 * pagination/filtering/ordering even for the same query, a new `search` event 3962 * with different 3963 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3964 * desired. The end user may have not finished browsing the whole page yet. 3965 * </pre> 3966 * 3967 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3968 */ clearProductDetails()3969 public Builder clearProductDetails() { 3970 if (productDetailsBuilder_ == null) { 3971 productDetails_ = java.util.Collections.emptyList(); 3972 bitField0_ = (bitField0_ & ~0x00000040); 3973 onChanged(); 3974 } else { 3975 productDetailsBuilder_.clear(); 3976 } 3977 return this; 3978 } 3979 /** 3980 * 3981 * 3982 * <pre> 3983 * The main product details related to the event. 3984 * This field is optional except for the following event types: 3985 * * `add-to-cart` 3986 * * `detail-page-view` 3987 * * `purchase-complete` 3988 * In a `search` event, this field represents the products returned to the end 3989 * user on the current page (the end user may have not finished browsing the 3990 * whole page yet). When a new page is returned to the end user, after 3991 * pagination/filtering/ordering even for the same query, a new `search` event 3992 * with different 3993 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 3994 * desired. The end user may have not finished browsing the whole page yet. 3995 * </pre> 3996 * 3997 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 3998 */ removeProductDetails(int index)3999 public Builder removeProductDetails(int index) { 4000 if (productDetailsBuilder_ == null) { 4001 ensureProductDetailsIsMutable(); 4002 productDetails_.remove(index); 4003 onChanged(); 4004 } else { 4005 productDetailsBuilder_.remove(index); 4006 } 4007 return this; 4008 } 4009 /** 4010 * 4011 * 4012 * <pre> 4013 * The main product details related to the event. 4014 * This field is optional except for the following event types: 4015 * * `add-to-cart` 4016 * * `detail-page-view` 4017 * * `purchase-complete` 4018 * In a `search` event, this field represents the products returned to the end 4019 * user on the current page (the end user may have not finished browsing the 4020 * whole page yet). When a new page is returned to the end user, after 4021 * pagination/filtering/ordering even for the same query, a new `search` event 4022 * with different 4023 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4024 * desired. The end user may have not finished browsing the whole page yet. 4025 * </pre> 4026 * 4027 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4028 */ getProductDetailsBuilder(int index)4029 public com.google.cloud.retail.v2.ProductDetail.Builder getProductDetailsBuilder(int index) { 4030 return getProductDetailsFieldBuilder().getBuilder(index); 4031 } 4032 /** 4033 * 4034 * 4035 * <pre> 4036 * The main product details related to the event. 4037 * This field is optional except for the following event types: 4038 * * `add-to-cart` 4039 * * `detail-page-view` 4040 * * `purchase-complete` 4041 * In a `search` event, this field represents the products returned to the end 4042 * user on the current page (the end user may have not finished browsing the 4043 * whole page yet). When a new page is returned to the end user, after 4044 * pagination/filtering/ordering even for the same query, a new `search` event 4045 * with different 4046 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4047 * desired. The end user may have not finished browsing the whole page yet. 4048 * </pre> 4049 * 4050 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4051 */ getProductDetailsOrBuilder(int index)4052 public com.google.cloud.retail.v2.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { 4053 if (productDetailsBuilder_ == null) { 4054 return productDetails_.get(index); 4055 } else { 4056 return productDetailsBuilder_.getMessageOrBuilder(index); 4057 } 4058 } 4059 /** 4060 * 4061 * 4062 * <pre> 4063 * The main product details related to the event. 4064 * This field is optional except for the following event types: 4065 * * `add-to-cart` 4066 * * `detail-page-view` 4067 * * `purchase-complete` 4068 * In a `search` event, this field represents the products returned to the end 4069 * user on the current page (the end user may have not finished browsing the 4070 * whole page yet). When a new page is returned to the end user, after 4071 * pagination/filtering/ordering even for the same query, a new `search` event 4072 * with different 4073 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4074 * desired. The end user may have not finished browsing the whole page yet. 4075 * </pre> 4076 * 4077 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4078 */ 4079 public java.util.List<? extends com.google.cloud.retail.v2.ProductDetailOrBuilder> getProductDetailsOrBuilderList()4080 getProductDetailsOrBuilderList() { 4081 if (productDetailsBuilder_ != null) { 4082 return productDetailsBuilder_.getMessageOrBuilderList(); 4083 } else { 4084 return java.util.Collections.unmodifiableList(productDetails_); 4085 } 4086 } 4087 /** 4088 * 4089 * 4090 * <pre> 4091 * The main product details related to the event. 4092 * This field is optional except for the following event types: 4093 * * `add-to-cart` 4094 * * `detail-page-view` 4095 * * `purchase-complete` 4096 * In a `search` event, this field represents the products returned to the end 4097 * user on the current page (the end user may have not finished browsing the 4098 * whole page yet). When a new page is returned to the end user, after 4099 * pagination/filtering/ordering even for the same query, a new `search` event 4100 * with different 4101 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4102 * desired. The end user may have not finished browsing the whole page yet. 4103 * </pre> 4104 * 4105 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4106 */ addProductDetailsBuilder()4107 public com.google.cloud.retail.v2.ProductDetail.Builder addProductDetailsBuilder() { 4108 return getProductDetailsFieldBuilder() 4109 .addBuilder(com.google.cloud.retail.v2.ProductDetail.getDefaultInstance()); 4110 } 4111 /** 4112 * 4113 * 4114 * <pre> 4115 * The main product details related to the event. 4116 * This field is optional except for the following event types: 4117 * * `add-to-cart` 4118 * * `detail-page-view` 4119 * * `purchase-complete` 4120 * In a `search` event, this field represents the products returned to the end 4121 * user on the current page (the end user may have not finished browsing the 4122 * whole page yet). When a new page is returned to the end user, after 4123 * pagination/filtering/ordering even for the same query, a new `search` event 4124 * with different 4125 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4126 * desired. The end user may have not finished browsing the whole page yet. 4127 * </pre> 4128 * 4129 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4130 */ addProductDetailsBuilder(int index)4131 public com.google.cloud.retail.v2.ProductDetail.Builder addProductDetailsBuilder(int index) { 4132 return getProductDetailsFieldBuilder() 4133 .addBuilder(index, com.google.cloud.retail.v2.ProductDetail.getDefaultInstance()); 4134 } 4135 /** 4136 * 4137 * 4138 * <pre> 4139 * The main product details related to the event. 4140 * This field is optional except for the following event types: 4141 * * `add-to-cart` 4142 * * `detail-page-view` 4143 * * `purchase-complete` 4144 * In a `search` event, this field represents the products returned to the end 4145 * user on the current page (the end user may have not finished browsing the 4146 * whole page yet). When a new page is returned to the end user, after 4147 * pagination/filtering/ordering even for the same query, a new `search` event 4148 * with different 4149 * [product_details][google.cloud.retail.v2.UserEvent.product_details] is 4150 * desired. The end user may have not finished browsing the whole page yet. 4151 * </pre> 4152 * 4153 * <code>repeated .google.cloud.retail.v2.ProductDetail product_details = 6;</code> 4154 */ 4155 public java.util.List<com.google.cloud.retail.v2.ProductDetail.Builder> getProductDetailsBuilderList()4156 getProductDetailsBuilderList() { 4157 return getProductDetailsFieldBuilder().getBuilderList(); 4158 } 4159 4160 private com.google.protobuf.RepeatedFieldBuilderV3< 4161 com.google.cloud.retail.v2.ProductDetail, 4162 com.google.cloud.retail.v2.ProductDetail.Builder, 4163 com.google.cloud.retail.v2.ProductDetailOrBuilder> getProductDetailsFieldBuilder()4164 getProductDetailsFieldBuilder() { 4165 if (productDetailsBuilder_ == null) { 4166 productDetailsBuilder_ = 4167 new com.google.protobuf.RepeatedFieldBuilderV3< 4168 com.google.cloud.retail.v2.ProductDetail, 4169 com.google.cloud.retail.v2.ProductDetail.Builder, 4170 com.google.cloud.retail.v2.ProductDetailOrBuilder>( 4171 productDetails_, 4172 ((bitField0_ & 0x00000040) != 0), 4173 getParentForChildren(), 4174 isClean()); 4175 productDetails_ = null; 4176 } 4177 return productDetailsBuilder_; 4178 } 4179 4180 private com.google.cloud.retail.v2.CompletionDetail completionDetail_; 4181 private com.google.protobuf.SingleFieldBuilderV3< 4182 com.google.cloud.retail.v2.CompletionDetail, 4183 com.google.cloud.retail.v2.CompletionDetail.Builder, 4184 com.google.cloud.retail.v2.CompletionDetailOrBuilder> 4185 completionDetailBuilder_; 4186 /** 4187 * 4188 * 4189 * <pre> 4190 * The main auto-completion details related to the event. 4191 * This field should be set for `search` event when autocomplete function is 4192 * enabled and the user clicks a suggestion for search. 4193 * </pre> 4194 * 4195 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4196 * 4197 * @return Whether the completionDetail field is set. 4198 */ hasCompletionDetail()4199 public boolean hasCompletionDetail() { 4200 return ((bitField0_ & 0x00000080) != 0); 4201 } 4202 /** 4203 * 4204 * 4205 * <pre> 4206 * The main auto-completion details related to the event. 4207 * This field should be set for `search` event when autocomplete function is 4208 * enabled and the user clicks a suggestion for search. 4209 * </pre> 4210 * 4211 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4212 * 4213 * @return The completionDetail. 4214 */ getCompletionDetail()4215 public com.google.cloud.retail.v2.CompletionDetail getCompletionDetail() { 4216 if (completionDetailBuilder_ == null) { 4217 return completionDetail_ == null 4218 ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() 4219 : completionDetail_; 4220 } else { 4221 return completionDetailBuilder_.getMessage(); 4222 } 4223 } 4224 /** 4225 * 4226 * 4227 * <pre> 4228 * The main auto-completion details related to the event. 4229 * This field should be set for `search` event when autocomplete function is 4230 * enabled and the user clicks a suggestion for search. 4231 * </pre> 4232 * 4233 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4234 */ setCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value)4235 public Builder setCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value) { 4236 if (completionDetailBuilder_ == null) { 4237 if (value == null) { 4238 throw new NullPointerException(); 4239 } 4240 completionDetail_ = value; 4241 } else { 4242 completionDetailBuilder_.setMessage(value); 4243 } 4244 bitField0_ |= 0x00000080; 4245 onChanged(); 4246 return this; 4247 } 4248 /** 4249 * 4250 * 4251 * <pre> 4252 * The main auto-completion details related to the event. 4253 * This field should be set for `search` event when autocomplete function is 4254 * enabled and the user clicks a suggestion for search. 4255 * </pre> 4256 * 4257 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4258 */ setCompletionDetail( com.google.cloud.retail.v2.CompletionDetail.Builder builderForValue)4259 public Builder setCompletionDetail( 4260 com.google.cloud.retail.v2.CompletionDetail.Builder builderForValue) { 4261 if (completionDetailBuilder_ == null) { 4262 completionDetail_ = builderForValue.build(); 4263 } else { 4264 completionDetailBuilder_.setMessage(builderForValue.build()); 4265 } 4266 bitField0_ |= 0x00000080; 4267 onChanged(); 4268 return this; 4269 } 4270 /** 4271 * 4272 * 4273 * <pre> 4274 * The main auto-completion details related to the event. 4275 * This field should be set for `search` event when autocomplete function is 4276 * enabled and the user clicks a suggestion for search. 4277 * </pre> 4278 * 4279 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4280 */ mergeCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value)4281 public Builder mergeCompletionDetail(com.google.cloud.retail.v2.CompletionDetail value) { 4282 if (completionDetailBuilder_ == null) { 4283 if (((bitField0_ & 0x00000080) != 0) 4284 && completionDetail_ != null 4285 && completionDetail_ 4286 != com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance()) { 4287 getCompletionDetailBuilder().mergeFrom(value); 4288 } else { 4289 completionDetail_ = value; 4290 } 4291 } else { 4292 completionDetailBuilder_.mergeFrom(value); 4293 } 4294 bitField0_ |= 0x00000080; 4295 onChanged(); 4296 return this; 4297 } 4298 /** 4299 * 4300 * 4301 * <pre> 4302 * The main auto-completion details related to the event. 4303 * This field should be set for `search` event when autocomplete function is 4304 * enabled and the user clicks a suggestion for search. 4305 * </pre> 4306 * 4307 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4308 */ clearCompletionDetail()4309 public Builder clearCompletionDetail() { 4310 bitField0_ = (bitField0_ & ~0x00000080); 4311 completionDetail_ = null; 4312 if (completionDetailBuilder_ != null) { 4313 completionDetailBuilder_.dispose(); 4314 completionDetailBuilder_ = null; 4315 } 4316 onChanged(); 4317 return this; 4318 } 4319 /** 4320 * 4321 * 4322 * <pre> 4323 * The main auto-completion details related to the event. 4324 * This field should be set for `search` event when autocomplete function is 4325 * enabled and the user clicks a suggestion for search. 4326 * </pre> 4327 * 4328 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4329 */ getCompletionDetailBuilder()4330 public com.google.cloud.retail.v2.CompletionDetail.Builder getCompletionDetailBuilder() { 4331 bitField0_ |= 0x00000080; 4332 onChanged(); 4333 return getCompletionDetailFieldBuilder().getBuilder(); 4334 } 4335 /** 4336 * 4337 * 4338 * <pre> 4339 * The main auto-completion details related to the event. 4340 * This field should be set for `search` event when autocomplete function is 4341 * enabled and the user clicks a suggestion for search. 4342 * </pre> 4343 * 4344 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4345 */ getCompletionDetailOrBuilder()4346 public com.google.cloud.retail.v2.CompletionDetailOrBuilder getCompletionDetailOrBuilder() { 4347 if (completionDetailBuilder_ != null) { 4348 return completionDetailBuilder_.getMessageOrBuilder(); 4349 } else { 4350 return completionDetail_ == null 4351 ? com.google.cloud.retail.v2.CompletionDetail.getDefaultInstance() 4352 : completionDetail_; 4353 } 4354 } 4355 /** 4356 * 4357 * 4358 * <pre> 4359 * The main auto-completion details related to the event. 4360 * This field should be set for `search` event when autocomplete function is 4361 * enabled and the user clicks a suggestion for search. 4362 * </pre> 4363 * 4364 * <code>.google.cloud.retail.v2.CompletionDetail completion_detail = 22;</code> 4365 */ 4366 private com.google.protobuf.SingleFieldBuilderV3< 4367 com.google.cloud.retail.v2.CompletionDetail, 4368 com.google.cloud.retail.v2.CompletionDetail.Builder, 4369 com.google.cloud.retail.v2.CompletionDetailOrBuilder> getCompletionDetailFieldBuilder()4370 getCompletionDetailFieldBuilder() { 4371 if (completionDetailBuilder_ == null) { 4372 completionDetailBuilder_ = 4373 new com.google.protobuf.SingleFieldBuilderV3< 4374 com.google.cloud.retail.v2.CompletionDetail, 4375 com.google.cloud.retail.v2.CompletionDetail.Builder, 4376 com.google.cloud.retail.v2.CompletionDetailOrBuilder>( 4377 getCompletionDetail(), getParentForChildren(), isClean()); 4378 completionDetail_ = null; 4379 } 4380 return completionDetailBuilder_; 4381 } 4382 4383 private com.google.protobuf.MapField< 4384 java.lang.String, com.google.cloud.retail.v2.CustomAttribute> 4385 attributes_; 4386 4387 private com.google.protobuf.MapField< 4388 java.lang.String, com.google.cloud.retail.v2.CustomAttribute> internalGetAttributes()4389 internalGetAttributes() { 4390 if (attributes_ == null) { 4391 return com.google.protobuf.MapField.emptyMapField( 4392 AttributesDefaultEntryHolder.defaultEntry); 4393 } 4394 return attributes_; 4395 } 4396 4397 private com.google.protobuf.MapField< 4398 java.lang.String, com.google.cloud.retail.v2.CustomAttribute> internalGetMutableAttributes()4399 internalGetMutableAttributes() { 4400 if (attributes_ == null) { 4401 attributes_ = 4402 com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); 4403 } 4404 if (!attributes_.isMutable()) { 4405 attributes_ = attributes_.copy(); 4406 } 4407 bitField0_ |= 0x00000100; 4408 onChanged(); 4409 return attributes_; 4410 } 4411 getAttributesCount()4412 public int getAttributesCount() { 4413 return internalGetAttributes().getMap().size(); 4414 } 4415 /** 4416 * 4417 * 4418 * <pre> 4419 * Extra user event features to include in the recommendation model. 4420 * If you provide custom attributes for ingested user events, also include 4421 * them in the user events that you associate with prediction requests. Custom 4422 * attribute formatting must be consistent between imported events and events 4423 * provided with prediction requests. This lets the Retail API use 4424 * those custom attributes when training models and serving predictions, which 4425 * helps improve recommendation quality. 4426 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4427 * error is returned: 4428 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4429 * characters. 4430 * * For text attributes, at most 400 values are allowed. Empty values are not 4431 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4432 * 256 characters. 4433 * * For number attributes, at most 400 values are allowed. 4434 * For product recommendations, an example of extra user information is 4435 * traffic_channel, which is how a user arrives at the site. Users can arrive 4436 * at the site by coming to the site directly, coming through Google 4437 * search, or in other ways. 4438 * </pre> 4439 * 4440 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4441 */ 4442 @java.lang.Override containsAttributes(java.lang.String key)4443 public boolean containsAttributes(java.lang.String key) { 4444 if (key == null) { 4445 throw new NullPointerException("map key"); 4446 } 4447 return internalGetAttributes().getMap().containsKey(key); 4448 } 4449 /** Use {@link #getAttributesMap()} instead. */ 4450 @java.lang.Override 4451 @java.lang.Deprecated 4452 public java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> getAttributes()4453 getAttributes() { 4454 return getAttributesMap(); 4455 } 4456 /** 4457 * 4458 * 4459 * <pre> 4460 * Extra user event features to include in the recommendation model. 4461 * If you provide custom attributes for ingested user events, also include 4462 * them in the user events that you associate with prediction requests. Custom 4463 * attribute formatting must be consistent between imported events and events 4464 * provided with prediction requests. This lets the Retail API use 4465 * those custom attributes when training models and serving predictions, which 4466 * helps improve recommendation quality. 4467 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4468 * error is returned: 4469 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4470 * characters. 4471 * * For text attributes, at most 400 values are allowed. Empty values are not 4472 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4473 * 256 characters. 4474 * * For number attributes, at most 400 values are allowed. 4475 * For product recommendations, an example of extra user information is 4476 * traffic_channel, which is how a user arrives at the site. Users can arrive 4477 * at the site by coming to the site directly, coming through Google 4478 * search, or in other ways. 4479 * </pre> 4480 * 4481 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4482 */ 4483 @java.lang.Override 4484 public java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> getAttributesMap()4485 getAttributesMap() { 4486 return internalGetAttributes().getMap(); 4487 } 4488 /** 4489 * 4490 * 4491 * <pre> 4492 * Extra user event features to include in the recommendation model. 4493 * If you provide custom attributes for ingested user events, also include 4494 * them in the user events that you associate with prediction requests. Custom 4495 * attribute formatting must be consistent between imported events and events 4496 * provided with prediction requests. This lets the Retail API use 4497 * those custom attributes when training models and serving predictions, which 4498 * helps improve recommendation quality. 4499 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4500 * error is returned: 4501 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4502 * characters. 4503 * * For text attributes, at most 400 values are allowed. Empty values are not 4504 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4505 * 256 characters. 4506 * * For number attributes, at most 400 values are allowed. 4507 * For product recommendations, an example of extra user information is 4508 * traffic_channel, which is how a user arrives at the site. Users can arrive 4509 * at the site by coming to the site directly, coming through Google 4510 * search, or in other ways. 4511 * </pre> 4512 * 4513 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4514 */ 4515 @java.lang.Override getAttributesOrDefault( java.lang.String key, com.google.cloud.retail.v2.CustomAttribute defaultValue)4516 public /* nullable */ com.google.cloud.retail.v2.CustomAttribute getAttributesOrDefault( 4517 java.lang.String key, 4518 /* nullable */ 4519 com.google.cloud.retail.v2.CustomAttribute defaultValue) { 4520 if (key == null) { 4521 throw new NullPointerException("map key"); 4522 } 4523 java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> map = 4524 internalGetAttributes().getMap(); 4525 return map.containsKey(key) ? map.get(key) : defaultValue; 4526 } 4527 /** 4528 * 4529 * 4530 * <pre> 4531 * Extra user event features to include in the recommendation model. 4532 * If you provide custom attributes for ingested user events, also include 4533 * them in the user events that you associate with prediction requests. Custom 4534 * attribute formatting must be consistent between imported events and events 4535 * provided with prediction requests. This lets the Retail API use 4536 * those custom attributes when training models and serving predictions, which 4537 * helps improve recommendation quality. 4538 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4539 * error is returned: 4540 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4541 * characters. 4542 * * For text attributes, at most 400 values are allowed. Empty values are not 4543 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4544 * 256 characters. 4545 * * For number attributes, at most 400 values are allowed. 4546 * For product recommendations, an example of extra user information is 4547 * traffic_channel, which is how a user arrives at the site. Users can arrive 4548 * at the site by coming to the site directly, coming through Google 4549 * search, or in other ways. 4550 * </pre> 4551 * 4552 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4553 */ 4554 @java.lang.Override getAttributesOrThrow(java.lang.String key)4555 public com.google.cloud.retail.v2.CustomAttribute getAttributesOrThrow(java.lang.String key) { 4556 if (key == null) { 4557 throw new NullPointerException("map key"); 4558 } 4559 java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> map = 4560 internalGetAttributes().getMap(); 4561 if (!map.containsKey(key)) { 4562 throw new java.lang.IllegalArgumentException(); 4563 } 4564 return map.get(key); 4565 } 4566 clearAttributes()4567 public Builder clearAttributes() { 4568 bitField0_ = (bitField0_ & ~0x00000100); 4569 internalGetMutableAttributes().getMutableMap().clear(); 4570 return this; 4571 } 4572 /** 4573 * 4574 * 4575 * <pre> 4576 * Extra user event features to include in the recommendation model. 4577 * If you provide custom attributes for ingested user events, also include 4578 * them in the user events that you associate with prediction requests. Custom 4579 * attribute formatting must be consistent between imported events and events 4580 * provided with prediction requests. This lets the Retail API use 4581 * those custom attributes when training models and serving predictions, which 4582 * helps improve recommendation quality. 4583 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4584 * error is returned: 4585 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4586 * characters. 4587 * * For text attributes, at most 400 values are allowed. Empty values are not 4588 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4589 * 256 characters. 4590 * * For number attributes, at most 400 values are allowed. 4591 * For product recommendations, an example of extra user information is 4592 * traffic_channel, which is how a user arrives at the site. Users can arrive 4593 * at the site by coming to the site directly, coming through Google 4594 * search, or in other ways. 4595 * </pre> 4596 * 4597 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4598 */ removeAttributes(java.lang.String key)4599 public Builder removeAttributes(java.lang.String key) { 4600 if (key == null) { 4601 throw new NullPointerException("map key"); 4602 } 4603 internalGetMutableAttributes().getMutableMap().remove(key); 4604 return this; 4605 } 4606 /** Use alternate mutation accessors instead. */ 4607 @java.lang.Deprecated 4608 public java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> getMutableAttributes()4609 getMutableAttributes() { 4610 bitField0_ |= 0x00000100; 4611 return internalGetMutableAttributes().getMutableMap(); 4612 } 4613 /** 4614 * 4615 * 4616 * <pre> 4617 * Extra user event features to include in the recommendation model. 4618 * If you provide custom attributes for ingested user events, also include 4619 * them in the user events that you associate with prediction requests. Custom 4620 * attribute formatting must be consistent between imported events and events 4621 * provided with prediction requests. This lets the Retail API use 4622 * those custom attributes when training models and serving predictions, which 4623 * helps improve recommendation quality. 4624 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4625 * error is returned: 4626 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4627 * characters. 4628 * * For text attributes, at most 400 values are allowed. Empty values are not 4629 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4630 * 256 characters. 4631 * * For number attributes, at most 400 values are allowed. 4632 * For product recommendations, an example of extra user information is 4633 * traffic_channel, which is how a user arrives at the site. Users can arrive 4634 * at the site by coming to the site directly, coming through Google 4635 * search, or in other ways. 4636 * </pre> 4637 * 4638 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4639 */ putAttributes( java.lang.String key, com.google.cloud.retail.v2.CustomAttribute value)4640 public Builder putAttributes( 4641 java.lang.String key, com.google.cloud.retail.v2.CustomAttribute value) { 4642 if (key == null) { 4643 throw new NullPointerException("map key"); 4644 } 4645 if (value == null) { 4646 throw new NullPointerException("map value"); 4647 } 4648 internalGetMutableAttributes().getMutableMap().put(key, value); 4649 bitField0_ |= 0x00000100; 4650 return this; 4651 } 4652 /** 4653 * 4654 * 4655 * <pre> 4656 * Extra user event features to include in the recommendation model. 4657 * If you provide custom attributes for ingested user events, also include 4658 * them in the user events that you associate with prediction requests. Custom 4659 * attribute formatting must be consistent between imported events and events 4660 * provided with prediction requests. This lets the Retail API use 4661 * those custom attributes when training models and serving predictions, which 4662 * helps improve recommendation quality. 4663 * This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 4664 * error is returned: 4665 * * The key must be a UTF-8 encoded string with a length limit of 5,000 4666 * characters. 4667 * * For text attributes, at most 400 values are allowed. Empty values are not 4668 * allowed. Each value must be a UTF-8 encoded string with a length limit of 4669 * 256 characters. 4670 * * For number attributes, at most 400 values are allowed. 4671 * For product recommendations, an example of extra user information is 4672 * traffic_channel, which is how a user arrives at the site. Users can arrive 4673 * at the site by coming to the site directly, coming through Google 4674 * search, or in other ways. 4675 * </pre> 4676 * 4677 * <code>map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 7;</code> 4678 */ putAllAttributes( java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> values)4679 public Builder putAllAttributes( 4680 java.util.Map<java.lang.String, com.google.cloud.retail.v2.CustomAttribute> values) { 4681 internalGetMutableAttributes().getMutableMap().putAll(values); 4682 bitField0_ |= 0x00000100; 4683 return this; 4684 } 4685 4686 private java.lang.Object cartId_ = ""; 4687 /** 4688 * 4689 * 4690 * <pre> 4691 * The ID or name of the associated shopping cart. This ID is used 4692 * to associate multiple items added or present in the cart before purchase. 4693 * This can only be set for `add-to-cart`, `purchase-complete`, or 4694 * `shopping-cart-page-view` events. 4695 * </pre> 4696 * 4697 * <code>string cart_id = 8;</code> 4698 * 4699 * @return The cartId. 4700 */ getCartId()4701 public java.lang.String getCartId() { 4702 java.lang.Object ref = cartId_; 4703 if (!(ref instanceof java.lang.String)) { 4704 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 4705 java.lang.String s = bs.toStringUtf8(); 4706 cartId_ = s; 4707 return s; 4708 } else { 4709 return (java.lang.String) ref; 4710 } 4711 } 4712 /** 4713 * 4714 * 4715 * <pre> 4716 * The ID or name of the associated shopping cart. This ID is used 4717 * to associate multiple items added or present in the cart before purchase. 4718 * This can only be set for `add-to-cart`, `purchase-complete`, or 4719 * `shopping-cart-page-view` events. 4720 * </pre> 4721 * 4722 * <code>string cart_id = 8;</code> 4723 * 4724 * @return The bytes for cartId. 4725 */ getCartIdBytes()4726 public com.google.protobuf.ByteString getCartIdBytes() { 4727 java.lang.Object ref = cartId_; 4728 if (ref instanceof String) { 4729 com.google.protobuf.ByteString b = 4730 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 4731 cartId_ = b; 4732 return b; 4733 } else { 4734 return (com.google.protobuf.ByteString) ref; 4735 } 4736 } 4737 /** 4738 * 4739 * 4740 * <pre> 4741 * The ID or name of the associated shopping cart. This ID is used 4742 * to associate multiple items added or present in the cart before purchase. 4743 * This can only be set for `add-to-cart`, `purchase-complete`, or 4744 * `shopping-cart-page-view` events. 4745 * </pre> 4746 * 4747 * <code>string cart_id = 8;</code> 4748 * 4749 * @param value The cartId to set. 4750 * @return This builder for chaining. 4751 */ setCartId(java.lang.String value)4752 public Builder setCartId(java.lang.String value) { 4753 if (value == null) { 4754 throw new NullPointerException(); 4755 } 4756 cartId_ = value; 4757 bitField0_ |= 0x00000200; 4758 onChanged(); 4759 return this; 4760 } 4761 /** 4762 * 4763 * 4764 * <pre> 4765 * The ID or name of the associated shopping cart. This ID is used 4766 * to associate multiple items added or present in the cart before purchase. 4767 * This can only be set for `add-to-cart`, `purchase-complete`, or 4768 * `shopping-cart-page-view` events. 4769 * </pre> 4770 * 4771 * <code>string cart_id = 8;</code> 4772 * 4773 * @return This builder for chaining. 4774 */ clearCartId()4775 public Builder clearCartId() { 4776 cartId_ = getDefaultInstance().getCartId(); 4777 bitField0_ = (bitField0_ & ~0x00000200); 4778 onChanged(); 4779 return this; 4780 } 4781 /** 4782 * 4783 * 4784 * <pre> 4785 * The ID or name of the associated shopping cart. This ID is used 4786 * to associate multiple items added or present in the cart before purchase. 4787 * This can only be set for `add-to-cart`, `purchase-complete`, or 4788 * `shopping-cart-page-view` events. 4789 * </pre> 4790 * 4791 * <code>string cart_id = 8;</code> 4792 * 4793 * @param value The bytes for cartId to set. 4794 * @return This builder for chaining. 4795 */ setCartIdBytes(com.google.protobuf.ByteString value)4796 public Builder setCartIdBytes(com.google.protobuf.ByteString value) { 4797 if (value == null) { 4798 throw new NullPointerException(); 4799 } 4800 checkByteStringIsUtf8(value); 4801 cartId_ = value; 4802 bitField0_ |= 0x00000200; 4803 onChanged(); 4804 return this; 4805 } 4806 4807 private com.google.cloud.retail.v2.PurchaseTransaction purchaseTransaction_; 4808 private com.google.protobuf.SingleFieldBuilderV3< 4809 com.google.cloud.retail.v2.PurchaseTransaction, 4810 com.google.cloud.retail.v2.PurchaseTransaction.Builder, 4811 com.google.cloud.retail.v2.PurchaseTransactionOrBuilder> 4812 purchaseTransactionBuilder_; 4813 /** 4814 * 4815 * 4816 * <pre> 4817 * A transaction represents the entire purchase transaction. 4818 * Required for `purchase-complete` events. Other event types should not set 4819 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4820 * </pre> 4821 * 4822 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4823 * 4824 * @return Whether the purchaseTransaction field is set. 4825 */ hasPurchaseTransaction()4826 public boolean hasPurchaseTransaction() { 4827 return ((bitField0_ & 0x00000400) != 0); 4828 } 4829 /** 4830 * 4831 * 4832 * <pre> 4833 * A transaction represents the entire purchase transaction. 4834 * Required for `purchase-complete` events. Other event types should not set 4835 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4836 * </pre> 4837 * 4838 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4839 * 4840 * @return The purchaseTransaction. 4841 */ getPurchaseTransaction()4842 public com.google.cloud.retail.v2.PurchaseTransaction getPurchaseTransaction() { 4843 if (purchaseTransactionBuilder_ == null) { 4844 return purchaseTransaction_ == null 4845 ? com.google.cloud.retail.v2.PurchaseTransaction.getDefaultInstance() 4846 : purchaseTransaction_; 4847 } else { 4848 return purchaseTransactionBuilder_.getMessage(); 4849 } 4850 } 4851 /** 4852 * 4853 * 4854 * <pre> 4855 * A transaction represents the entire purchase transaction. 4856 * Required for `purchase-complete` events. Other event types should not set 4857 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4858 * </pre> 4859 * 4860 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4861 */ setPurchaseTransaction(com.google.cloud.retail.v2.PurchaseTransaction value)4862 public Builder setPurchaseTransaction(com.google.cloud.retail.v2.PurchaseTransaction value) { 4863 if (purchaseTransactionBuilder_ == null) { 4864 if (value == null) { 4865 throw new NullPointerException(); 4866 } 4867 purchaseTransaction_ = value; 4868 } else { 4869 purchaseTransactionBuilder_.setMessage(value); 4870 } 4871 bitField0_ |= 0x00000400; 4872 onChanged(); 4873 return this; 4874 } 4875 /** 4876 * 4877 * 4878 * <pre> 4879 * A transaction represents the entire purchase transaction. 4880 * Required for `purchase-complete` events. Other event types should not set 4881 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4882 * </pre> 4883 * 4884 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4885 */ setPurchaseTransaction( com.google.cloud.retail.v2.PurchaseTransaction.Builder builderForValue)4886 public Builder setPurchaseTransaction( 4887 com.google.cloud.retail.v2.PurchaseTransaction.Builder builderForValue) { 4888 if (purchaseTransactionBuilder_ == null) { 4889 purchaseTransaction_ = builderForValue.build(); 4890 } else { 4891 purchaseTransactionBuilder_.setMessage(builderForValue.build()); 4892 } 4893 bitField0_ |= 0x00000400; 4894 onChanged(); 4895 return this; 4896 } 4897 /** 4898 * 4899 * 4900 * <pre> 4901 * A transaction represents the entire purchase transaction. 4902 * Required for `purchase-complete` events. Other event types should not set 4903 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4904 * </pre> 4905 * 4906 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4907 */ mergePurchaseTransaction(com.google.cloud.retail.v2.PurchaseTransaction value)4908 public Builder mergePurchaseTransaction(com.google.cloud.retail.v2.PurchaseTransaction value) { 4909 if (purchaseTransactionBuilder_ == null) { 4910 if (((bitField0_ & 0x00000400) != 0) 4911 && purchaseTransaction_ != null 4912 && purchaseTransaction_ 4913 != com.google.cloud.retail.v2.PurchaseTransaction.getDefaultInstance()) { 4914 getPurchaseTransactionBuilder().mergeFrom(value); 4915 } else { 4916 purchaseTransaction_ = value; 4917 } 4918 } else { 4919 purchaseTransactionBuilder_.mergeFrom(value); 4920 } 4921 bitField0_ |= 0x00000400; 4922 onChanged(); 4923 return this; 4924 } 4925 /** 4926 * 4927 * 4928 * <pre> 4929 * A transaction represents the entire purchase transaction. 4930 * Required for `purchase-complete` events. Other event types should not set 4931 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4932 * </pre> 4933 * 4934 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4935 */ clearPurchaseTransaction()4936 public Builder clearPurchaseTransaction() { 4937 bitField0_ = (bitField0_ & ~0x00000400); 4938 purchaseTransaction_ = null; 4939 if (purchaseTransactionBuilder_ != null) { 4940 purchaseTransactionBuilder_.dispose(); 4941 purchaseTransactionBuilder_ = null; 4942 } 4943 onChanged(); 4944 return this; 4945 } 4946 /** 4947 * 4948 * 4949 * <pre> 4950 * A transaction represents the entire purchase transaction. 4951 * Required for `purchase-complete` events. Other event types should not set 4952 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4953 * </pre> 4954 * 4955 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4956 */ getPurchaseTransactionBuilder()4957 public com.google.cloud.retail.v2.PurchaseTransaction.Builder getPurchaseTransactionBuilder() { 4958 bitField0_ |= 0x00000400; 4959 onChanged(); 4960 return getPurchaseTransactionFieldBuilder().getBuilder(); 4961 } 4962 /** 4963 * 4964 * 4965 * <pre> 4966 * A transaction represents the entire purchase transaction. 4967 * Required for `purchase-complete` events. Other event types should not set 4968 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4969 * </pre> 4970 * 4971 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4972 */ 4973 public com.google.cloud.retail.v2.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder()4974 getPurchaseTransactionOrBuilder() { 4975 if (purchaseTransactionBuilder_ != null) { 4976 return purchaseTransactionBuilder_.getMessageOrBuilder(); 4977 } else { 4978 return purchaseTransaction_ == null 4979 ? com.google.cloud.retail.v2.PurchaseTransaction.getDefaultInstance() 4980 : purchaseTransaction_; 4981 } 4982 } 4983 /** 4984 * 4985 * 4986 * <pre> 4987 * A transaction represents the entire purchase transaction. 4988 * Required for `purchase-complete` events. Other event types should not set 4989 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 4990 * </pre> 4991 * 4992 * <code>.google.cloud.retail.v2.PurchaseTransaction purchase_transaction = 9;</code> 4993 */ 4994 private com.google.protobuf.SingleFieldBuilderV3< 4995 com.google.cloud.retail.v2.PurchaseTransaction, 4996 com.google.cloud.retail.v2.PurchaseTransaction.Builder, 4997 com.google.cloud.retail.v2.PurchaseTransactionOrBuilder> getPurchaseTransactionFieldBuilder()4998 getPurchaseTransactionFieldBuilder() { 4999 if (purchaseTransactionBuilder_ == null) { 5000 purchaseTransactionBuilder_ = 5001 new com.google.protobuf.SingleFieldBuilderV3< 5002 com.google.cloud.retail.v2.PurchaseTransaction, 5003 com.google.cloud.retail.v2.PurchaseTransaction.Builder, 5004 com.google.cloud.retail.v2.PurchaseTransactionOrBuilder>( 5005 getPurchaseTransaction(), getParentForChildren(), isClean()); 5006 purchaseTransaction_ = null; 5007 } 5008 return purchaseTransactionBuilder_; 5009 } 5010 5011 private java.lang.Object searchQuery_ = ""; 5012 /** 5013 * 5014 * 5015 * <pre> 5016 * The user's search query. 5017 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 5018 * definition. 5019 * The value must be a UTF-8 encoded string with a length limit of 5,000 5020 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5021 * At least one of 5022 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5023 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5024 * required for `search` events. Other event types should not set this field. 5025 * Otherwise, an INVALID_ARGUMENT error is returned. 5026 * </pre> 5027 * 5028 * <code>string search_query = 10;</code> 5029 * 5030 * @return The searchQuery. 5031 */ getSearchQuery()5032 public java.lang.String getSearchQuery() { 5033 java.lang.Object ref = searchQuery_; 5034 if (!(ref instanceof java.lang.String)) { 5035 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 5036 java.lang.String s = bs.toStringUtf8(); 5037 searchQuery_ = s; 5038 return s; 5039 } else { 5040 return (java.lang.String) ref; 5041 } 5042 } 5043 /** 5044 * 5045 * 5046 * <pre> 5047 * The user's search query. 5048 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 5049 * definition. 5050 * The value must be a UTF-8 encoded string with a length limit of 5,000 5051 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5052 * At least one of 5053 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5054 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5055 * required for `search` events. Other event types should not set this field. 5056 * Otherwise, an INVALID_ARGUMENT error is returned. 5057 * </pre> 5058 * 5059 * <code>string search_query = 10;</code> 5060 * 5061 * @return The bytes for searchQuery. 5062 */ getSearchQueryBytes()5063 public com.google.protobuf.ByteString getSearchQueryBytes() { 5064 java.lang.Object ref = searchQuery_; 5065 if (ref instanceof String) { 5066 com.google.protobuf.ByteString b = 5067 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 5068 searchQuery_ = b; 5069 return b; 5070 } else { 5071 return (com.google.protobuf.ByteString) ref; 5072 } 5073 } 5074 /** 5075 * 5076 * 5077 * <pre> 5078 * The user's search query. 5079 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 5080 * definition. 5081 * The value must be a UTF-8 encoded string with a length limit of 5,000 5082 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5083 * At least one of 5084 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5085 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5086 * required for `search` events. Other event types should not set this field. 5087 * Otherwise, an INVALID_ARGUMENT error is returned. 5088 * </pre> 5089 * 5090 * <code>string search_query = 10;</code> 5091 * 5092 * @param value The searchQuery to set. 5093 * @return This builder for chaining. 5094 */ setSearchQuery(java.lang.String value)5095 public Builder setSearchQuery(java.lang.String value) { 5096 if (value == null) { 5097 throw new NullPointerException(); 5098 } 5099 searchQuery_ = value; 5100 bitField0_ |= 0x00000800; 5101 onChanged(); 5102 return this; 5103 } 5104 /** 5105 * 5106 * 5107 * <pre> 5108 * The user's search query. 5109 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 5110 * definition. 5111 * The value must be a UTF-8 encoded string with a length limit of 5,000 5112 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5113 * At least one of 5114 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5115 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5116 * required for `search` events. Other event types should not set this field. 5117 * Otherwise, an INVALID_ARGUMENT error is returned. 5118 * </pre> 5119 * 5120 * <code>string search_query = 10;</code> 5121 * 5122 * @return This builder for chaining. 5123 */ clearSearchQuery()5124 public Builder clearSearchQuery() { 5125 searchQuery_ = getDefaultInstance().getSearchQuery(); 5126 bitField0_ = (bitField0_ & ~0x00000800); 5127 onChanged(); 5128 return this; 5129 } 5130 /** 5131 * 5132 * 5133 * <pre> 5134 * The user's search query. 5135 * See [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] for 5136 * definition. 5137 * The value must be a UTF-8 encoded string with a length limit of 5,000 5138 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5139 * At least one of 5140 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5141 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5142 * required for `search` events. Other event types should not set this field. 5143 * Otherwise, an INVALID_ARGUMENT error is returned. 5144 * </pre> 5145 * 5146 * <code>string search_query = 10;</code> 5147 * 5148 * @param value The bytes for searchQuery to set. 5149 * @return This builder for chaining. 5150 */ setSearchQueryBytes(com.google.protobuf.ByteString value)5151 public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { 5152 if (value == null) { 5153 throw new NullPointerException(); 5154 } 5155 checkByteStringIsUtf8(value); 5156 searchQuery_ = value; 5157 bitField0_ |= 0x00000800; 5158 onChanged(); 5159 return this; 5160 } 5161 5162 private java.lang.Object filter_ = ""; 5163 /** 5164 * 5165 * 5166 * <pre> 5167 * The filter syntax consists of an expression language for constructing a 5168 * predicate from one or more fields of the products being filtered. 5169 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 5170 * definition and syntax. 5171 * The value must be a UTF-8 encoded string with a length limit of 1,000 5172 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5173 * </pre> 5174 * 5175 * <code>string filter = 16;</code> 5176 * 5177 * @return The filter. 5178 */ getFilter()5179 public java.lang.String getFilter() { 5180 java.lang.Object ref = filter_; 5181 if (!(ref instanceof java.lang.String)) { 5182 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 5183 java.lang.String s = bs.toStringUtf8(); 5184 filter_ = s; 5185 return s; 5186 } else { 5187 return (java.lang.String) ref; 5188 } 5189 } 5190 /** 5191 * 5192 * 5193 * <pre> 5194 * The filter syntax consists of an expression language for constructing a 5195 * predicate from one or more fields of the products being filtered. 5196 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 5197 * definition and syntax. 5198 * The value must be a UTF-8 encoded string with a length limit of 1,000 5199 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5200 * </pre> 5201 * 5202 * <code>string filter = 16;</code> 5203 * 5204 * @return The bytes for filter. 5205 */ getFilterBytes()5206 public com.google.protobuf.ByteString getFilterBytes() { 5207 java.lang.Object ref = filter_; 5208 if (ref instanceof String) { 5209 com.google.protobuf.ByteString b = 5210 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 5211 filter_ = b; 5212 return b; 5213 } else { 5214 return (com.google.protobuf.ByteString) ref; 5215 } 5216 } 5217 /** 5218 * 5219 * 5220 * <pre> 5221 * The filter syntax consists of an expression language for constructing a 5222 * predicate from one or more fields of the products being filtered. 5223 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 5224 * definition and syntax. 5225 * The value must be a UTF-8 encoded string with a length limit of 1,000 5226 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5227 * </pre> 5228 * 5229 * <code>string filter = 16;</code> 5230 * 5231 * @param value The filter to set. 5232 * @return This builder for chaining. 5233 */ setFilter(java.lang.String value)5234 public Builder setFilter(java.lang.String value) { 5235 if (value == null) { 5236 throw new NullPointerException(); 5237 } 5238 filter_ = value; 5239 bitField0_ |= 0x00001000; 5240 onChanged(); 5241 return this; 5242 } 5243 /** 5244 * 5245 * 5246 * <pre> 5247 * The filter syntax consists of an expression language for constructing a 5248 * predicate from one or more fields of the products being filtered. 5249 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 5250 * definition and syntax. 5251 * The value must be a UTF-8 encoded string with a length limit of 1,000 5252 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5253 * </pre> 5254 * 5255 * <code>string filter = 16;</code> 5256 * 5257 * @return This builder for chaining. 5258 */ clearFilter()5259 public Builder clearFilter() { 5260 filter_ = getDefaultInstance().getFilter(); 5261 bitField0_ = (bitField0_ & ~0x00001000); 5262 onChanged(); 5263 return this; 5264 } 5265 /** 5266 * 5267 * 5268 * <pre> 5269 * The filter syntax consists of an expression language for constructing a 5270 * predicate from one or more fields of the products being filtered. 5271 * See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for 5272 * definition and syntax. 5273 * The value must be a UTF-8 encoded string with a length limit of 1,000 5274 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5275 * </pre> 5276 * 5277 * <code>string filter = 16;</code> 5278 * 5279 * @param value The bytes for filter to set. 5280 * @return This builder for chaining. 5281 */ setFilterBytes(com.google.protobuf.ByteString value)5282 public Builder setFilterBytes(com.google.protobuf.ByteString value) { 5283 if (value == null) { 5284 throw new NullPointerException(); 5285 } 5286 checkByteStringIsUtf8(value); 5287 filter_ = value; 5288 bitField0_ |= 0x00001000; 5289 onChanged(); 5290 return this; 5291 } 5292 5293 private java.lang.Object orderBy_ = ""; 5294 /** 5295 * 5296 * 5297 * <pre> 5298 * The order in which products are returned. 5299 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 5300 * for definition and syntax. 5301 * The value must be a UTF-8 encoded string with a length limit of 1,000 5302 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5303 * This can only be set for `search` events. Other event types should not set 5304 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5305 * </pre> 5306 * 5307 * <code>string order_by = 17;</code> 5308 * 5309 * @return The orderBy. 5310 */ getOrderBy()5311 public java.lang.String getOrderBy() { 5312 java.lang.Object ref = orderBy_; 5313 if (!(ref instanceof java.lang.String)) { 5314 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 5315 java.lang.String s = bs.toStringUtf8(); 5316 orderBy_ = s; 5317 return s; 5318 } else { 5319 return (java.lang.String) ref; 5320 } 5321 } 5322 /** 5323 * 5324 * 5325 * <pre> 5326 * The order in which products are returned. 5327 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 5328 * for definition and syntax. 5329 * The value must be a UTF-8 encoded string with a length limit of 1,000 5330 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5331 * This can only be set for `search` events. Other event types should not set 5332 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5333 * </pre> 5334 * 5335 * <code>string order_by = 17;</code> 5336 * 5337 * @return The bytes for orderBy. 5338 */ getOrderByBytes()5339 public com.google.protobuf.ByteString getOrderByBytes() { 5340 java.lang.Object ref = orderBy_; 5341 if (ref instanceof String) { 5342 com.google.protobuf.ByteString b = 5343 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 5344 orderBy_ = b; 5345 return b; 5346 } else { 5347 return (com.google.protobuf.ByteString) ref; 5348 } 5349 } 5350 /** 5351 * 5352 * 5353 * <pre> 5354 * The order in which products are returned. 5355 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 5356 * for definition and syntax. 5357 * The value must be a UTF-8 encoded string with a length limit of 1,000 5358 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5359 * This can only be set for `search` events. Other event types should not set 5360 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5361 * </pre> 5362 * 5363 * <code>string order_by = 17;</code> 5364 * 5365 * @param value The orderBy to set. 5366 * @return This builder for chaining. 5367 */ setOrderBy(java.lang.String value)5368 public Builder setOrderBy(java.lang.String value) { 5369 if (value == null) { 5370 throw new NullPointerException(); 5371 } 5372 orderBy_ = value; 5373 bitField0_ |= 0x00002000; 5374 onChanged(); 5375 return this; 5376 } 5377 /** 5378 * 5379 * 5380 * <pre> 5381 * The order in which products are returned. 5382 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 5383 * for definition and syntax. 5384 * The value must be a UTF-8 encoded string with a length limit of 1,000 5385 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5386 * This can only be set for `search` events. Other event types should not set 5387 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5388 * </pre> 5389 * 5390 * <code>string order_by = 17;</code> 5391 * 5392 * @return This builder for chaining. 5393 */ clearOrderBy()5394 public Builder clearOrderBy() { 5395 orderBy_ = getDefaultInstance().getOrderBy(); 5396 bitField0_ = (bitField0_ & ~0x00002000); 5397 onChanged(); 5398 return this; 5399 } 5400 /** 5401 * 5402 * 5403 * <pre> 5404 * The order in which products are returned. 5405 * See [SearchRequest.order_by][google.cloud.retail.v2.SearchRequest.order_by] 5406 * for definition and syntax. 5407 * The value must be a UTF-8 encoded string with a length limit of 1,000 5408 * characters. Otherwise, an INVALID_ARGUMENT error is returned. 5409 * This can only be set for `search` events. Other event types should not set 5410 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5411 * </pre> 5412 * 5413 * <code>string order_by = 17;</code> 5414 * 5415 * @param value The bytes for orderBy to set. 5416 * @return This builder for chaining. 5417 */ setOrderByBytes(com.google.protobuf.ByteString value)5418 public Builder setOrderByBytes(com.google.protobuf.ByteString value) { 5419 if (value == null) { 5420 throw new NullPointerException(); 5421 } 5422 checkByteStringIsUtf8(value); 5423 orderBy_ = value; 5424 bitField0_ |= 0x00002000; 5425 onChanged(); 5426 return this; 5427 } 5428 5429 private int offset_; 5430 /** 5431 * 5432 * 5433 * <pre> 5434 * An integer that specifies the current offset for pagination (the 0-indexed 5435 * starting location, amongst the products deemed by the API as relevant). 5436 * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for 5437 * definition. 5438 * If this field is negative, an INVALID_ARGUMENT is returned. 5439 * This can only be set for `search` events. Other event types should not set 5440 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5441 * </pre> 5442 * 5443 * <code>int32 offset = 18;</code> 5444 * 5445 * @return The offset. 5446 */ 5447 @java.lang.Override getOffset()5448 public int getOffset() { 5449 return offset_; 5450 } 5451 /** 5452 * 5453 * 5454 * <pre> 5455 * An integer that specifies the current offset for pagination (the 0-indexed 5456 * starting location, amongst the products deemed by the API as relevant). 5457 * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for 5458 * definition. 5459 * If this field is negative, an INVALID_ARGUMENT is returned. 5460 * This can only be set for `search` events. Other event types should not set 5461 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5462 * </pre> 5463 * 5464 * <code>int32 offset = 18;</code> 5465 * 5466 * @param value The offset to set. 5467 * @return This builder for chaining. 5468 */ setOffset(int value)5469 public Builder setOffset(int value) { 5470 5471 offset_ = value; 5472 bitField0_ |= 0x00004000; 5473 onChanged(); 5474 return this; 5475 } 5476 /** 5477 * 5478 * 5479 * <pre> 5480 * An integer that specifies the current offset for pagination (the 0-indexed 5481 * starting location, amongst the products deemed by the API as relevant). 5482 * See [SearchRequest.offset][google.cloud.retail.v2.SearchRequest.offset] for 5483 * definition. 5484 * If this field is negative, an INVALID_ARGUMENT is returned. 5485 * This can only be set for `search` events. Other event types should not set 5486 * this field. Otherwise, an INVALID_ARGUMENT error is returned. 5487 * </pre> 5488 * 5489 * <code>int32 offset = 18;</code> 5490 * 5491 * @return This builder for chaining. 5492 */ clearOffset()5493 public Builder clearOffset() { 5494 bitField0_ = (bitField0_ & ~0x00004000); 5495 offset_ = 0; 5496 onChanged(); 5497 return this; 5498 } 5499 5500 private com.google.protobuf.LazyStringList pageCategories_ = 5501 com.google.protobuf.LazyStringArrayList.EMPTY; 5502 ensurePageCategoriesIsMutable()5503 private void ensurePageCategoriesIsMutable() { 5504 if (!((bitField0_ & 0x00008000) != 0)) { 5505 pageCategories_ = new com.google.protobuf.LazyStringArrayList(pageCategories_); 5506 bitField0_ |= 0x00008000; 5507 } 5508 } 5509 /** 5510 * 5511 * 5512 * <pre> 5513 * The categories associated with a category page. 5514 * To represent full path of category, use '>' sign to separate different 5515 * hierarchies. If '>' is part of the category name, replace it with 5516 * other character(s). 5517 * Category pages include special pages such as sales or promotions. For 5518 * instance, a special sale page may have the category hierarchy: 5519 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5520 * Required for `category-page-view` events. At least one of 5521 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5522 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5523 * required for `search` events. Other event types should not set this field. 5524 * Otherwise, an INVALID_ARGUMENT error is returned. 5525 * </pre> 5526 * 5527 * <code>repeated string page_categories = 11;</code> 5528 * 5529 * @return A list containing the pageCategories. 5530 */ getPageCategoriesList()5531 public com.google.protobuf.ProtocolStringList getPageCategoriesList() { 5532 return pageCategories_.getUnmodifiableView(); 5533 } 5534 /** 5535 * 5536 * 5537 * <pre> 5538 * The categories associated with a category page. 5539 * To represent full path of category, use '>' sign to separate different 5540 * hierarchies. If '>' is part of the category name, replace it with 5541 * other character(s). 5542 * Category pages include special pages such as sales or promotions. For 5543 * instance, a special sale page may have the category hierarchy: 5544 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5545 * Required for `category-page-view` events. At least one of 5546 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5547 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5548 * required for `search` events. Other event types should not set this field. 5549 * Otherwise, an INVALID_ARGUMENT error is returned. 5550 * </pre> 5551 * 5552 * <code>repeated string page_categories = 11;</code> 5553 * 5554 * @return The count of pageCategories. 5555 */ getPageCategoriesCount()5556 public int getPageCategoriesCount() { 5557 return pageCategories_.size(); 5558 } 5559 /** 5560 * 5561 * 5562 * <pre> 5563 * The categories associated with a category page. 5564 * To represent full path of category, use '>' sign to separate different 5565 * hierarchies. If '>' is part of the category name, replace it with 5566 * other character(s). 5567 * Category pages include special pages such as sales or promotions. For 5568 * instance, a special sale page may have the category hierarchy: 5569 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5570 * Required for `category-page-view` events. At least one of 5571 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5572 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5573 * required for `search` events. Other event types should not set this field. 5574 * Otherwise, an INVALID_ARGUMENT error is returned. 5575 * </pre> 5576 * 5577 * <code>repeated string page_categories = 11;</code> 5578 * 5579 * @param index The index of the element to return. 5580 * @return The pageCategories at the given index. 5581 */ getPageCategories(int index)5582 public java.lang.String getPageCategories(int index) { 5583 return pageCategories_.get(index); 5584 } 5585 /** 5586 * 5587 * 5588 * <pre> 5589 * The categories associated with a category page. 5590 * To represent full path of category, use '>' sign to separate different 5591 * hierarchies. If '>' is part of the category name, replace it with 5592 * other character(s). 5593 * Category pages include special pages such as sales or promotions. For 5594 * instance, a special sale page may have the category hierarchy: 5595 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5596 * Required for `category-page-view` events. At least one of 5597 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5598 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5599 * required for `search` events. Other event types should not set this field. 5600 * Otherwise, an INVALID_ARGUMENT error is returned. 5601 * </pre> 5602 * 5603 * <code>repeated string page_categories = 11;</code> 5604 * 5605 * @param index The index of the value to return. 5606 * @return The bytes of the pageCategories at the given index. 5607 */ getPageCategoriesBytes(int index)5608 public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { 5609 return pageCategories_.getByteString(index); 5610 } 5611 /** 5612 * 5613 * 5614 * <pre> 5615 * The categories associated with a category page. 5616 * To represent full path of category, use '>' sign to separate different 5617 * hierarchies. If '>' is part of the category name, replace it with 5618 * other character(s). 5619 * Category pages include special pages such as sales or promotions. For 5620 * instance, a special sale page may have the category hierarchy: 5621 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5622 * Required for `category-page-view` events. At least one of 5623 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5624 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5625 * required for `search` events. Other event types should not set this field. 5626 * Otherwise, an INVALID_ARGUMENT error is returned. 5627 * </pre> 5628 * 5629 * <code>repeated string page_categories = 11;</code> 5630 * 5631 * @param index The index to set the value at. 5632 * @param value The pageCategories to set. 5633 * @return This builder for chaining. 5634 */ setPageCategories(int index, java.lang.String value)5635 public Builder setPageCategories(int index, java.lang.String value) { 5636 if (value == null) { 5637 throw new NullPointerException(); 5638 } 5639 ensurePageCategoriesIsMutable(); 5640 pageCategories_.set(index, value); 5641 onChanged(); 5642 return this; 5643 } 5644 /** 5645 * 5646 * 5647 * <pre> 5648 * The categories associated with a category page. 5649 * To represent full path of category, use '>' sign to separate different 5650 * hierarchies. If '>' is part of the category name, replace it with 5651 * other character(s). 5652 * Category pages include special pages such as sales or promotions. For 5653 * instance, a special sale page may have the category hierarchy: 5654 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5655 * Required for `category-page-view` events. At least one of 5656 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5657 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5658 * required for `search` events. Other event types should not set this field. 5659 * Otherwise, an INVALID_ARGUMENT error is returned. 5660 * </pre> 5661 * 5662 * <code>repeated string page_categories = 11;</code> 5663 * 5664 * @param value The pageCategories to add. 5665 * @return This builder for chaining. 5666 */ addPageCategories(java.lang.String value)5667 public Builder addPageCategories(java.lang.String value) { 5668 if (value == null) { 5669 throw new NullPointerException(); 5670 } 5671 ensurePageCategoriesIsMutable(); 5672 pageCategories_.add(value); 5673 onChanged(); 5674 return this; 5675 } 5676 /** 5677 * 5678 * 5679 * <pre> 5680 * The categories associated with a category page. 5681 * To represent full path of category, use '>' sign to separate different 5682 * hierarchies. If '>' is part of the category name, replace it with 5683 * other character(s). 5684 * Category pages include special pages such as sales or promotions. For 5685 * instance, a special sale page may have the category hierarchy: 5686 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5687 * Required for `category-page-view` events. At least one of 5688 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5689 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5690 * required for `search` events. Other event types should not set this field. 5691 * Otherwise, an INVALID_ARGUMENT error is returned. 5692 * </pre> 5693 * 5694 * <code>repeated string page_categories = 11;</code> 5695 * 5696 * @param values The pageCategories to add. 5697 * @return This builder for chaining. 5698 */ addAllPageCategories(java.lang.Iterable<java.lang.String> values)5699 public Builder addAllPageCategories(java.lang.Iterable<java.lang.String> values) { 5700 ensurePageCategoriesIsMutable(); 5701 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); 5702 onChanged(); 5703 return this; 5704 } 5705 /** 5706 * 5707 * 5708 * <pre> 5709 * The categories associated with a category page. 5710 * To represent full path of category, use '>' sign to separate different 5711 * hierarchies. If '>' is part of the category name, replace it with 5712 * other character(s). 5713 * Category pages include special pages such as sales or promotions. For 5714 * instance, a special sale page may have the category hierarchy: 5715 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5716 * Required for `category-page-view` events. At least one of 5717 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5718 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5719 * required for `search` events. Other event types should not set this field. 5720 * Otherwise, an INVALID_ARGUMENT error is returned. 5721 * </pre> 5722 * 5723 * <code>repeated string page_categories = 11;</code> 5724 * 5725 * @return This builder for chaining. 5726 */ clearPageCategories()5727 public Builder clearPageCategories() { 5728 pageCategories_ = com.google.protobuf.LazyStringArrayList.EMPTY; 5729 bitField0_ = (bitField0_ & ~0x00008000); 5730 onChanged(); 5731 return this; 5732 } 5733 /** 5734 * 5735 * 5736 * <pre> 5737 * The categories associated with a category page. 5738 * To represent full path of category, use '>' sign to separate different 5739 * hierarchies. If '>' is part of the category name, replace it with 5740 * other character(s). 5741 * Category pages include special pages such as sales or promotions. For 5742 * instance, a special sale page may have the category hierarchy: 5743 * "pageCategories" : ["Sales > 2017 Black Friday Deals"]. 5744 * Required for `category-page-view` events. At least one of 5745 * [search_query][google.cloud.retail.v2.UserEvent.search_query] or 5746 * [page_categories][google.cloud.retail.v2.UserEvent.page_categories] is 5747 * required for `search` events. Other event types should not set this field. 5748 * Otherwise, an INVALID_ARGUMENT error is returned. 5749 * </pre> 5750 * 5751 * <code>repeated string page_categories = 11;</code> 5752 * 5753 * @param value The bytes of the pageCategories to add. 5754 * @return This builder for chaining. 5755 */ addPageCategoriesBytes(com.google.protobuf.ByteString value)5756 public Builder addPageCategoriesBytes(com.google.protobuf.ByteString value) { 5757 if (value == null) { 5758 throw new NullPointerException(); 5759 } 5760 checkByteStringIsUtf8(value); 5761 ensurePageCategoriesIsMutable(); 5762 pageCategories_.add(value); 5763 onChanged(); 5764 return this; 5765 } 5766 5767 private com.google.cloud.retail.v2.UserInfo userInfo_; 5768 private com.google.protobuf.SingleFieldBuilderV3< 5769 com.google.cloud.retail.v2.UserInfo, 5770 com.google.cloud.retail.v2.UserInfo.Builder, 5771 com.google.cloud.retail.v2.UserInfoOrBuilder> 5772 userInfoBuilder_; 5773 /** 5774 * 5775 * 5776 * <pre> 5777 * User information. 5778 * </pre> 5779 * 5780 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5781 * 5782 * @return Whether the userInfo field is set. 5783 */ hasUserInfo()5784 public boolean hasUserInfo() { 5785 return ((bitField0_ & 0x00010000) != 0); 5786 } 5787 /** 5788 * 5789 * 5790 * <pre> 5791 * User information. 5792 * </pre> 5793 * 5794 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5795 * 5796 * @return The userInfo. 5797 */ getUserInfo()5798 public com.google.cloud.retail.v2.UserInfo getUserInfo() { 5799 if (userInfoBuilder_ == null) { 5800 return userInfo_ == null 5801 ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() 5802 : userInfo_; 5803 } else { 5804 return userInfoBuilder_.getMessage(); 5805 } 5806 } 5807 /** 5808 * 5809 * 5810 * <pre> 5811 * User information. 5812 * </pre> 5813 * 5814 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5815 */ setUserInfo(com.google.cloud.retail.v2.UserInfo value)5816 public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo value) { 5817 if (userInfoBuilder_ == null) { 5818 if (value == null) { 5819 throw new NullPointerException(); 5820 } 5821 userInfo_ = value; 5822 } else { 5823 userInfoBuilder_.setMessage(value); 5824 } 5825 bitField0_ |= 0x00010000; 5826 onChanged(); 5827 return this; 5828 } 5829 /** 5830 * 5831 * 5832 * <pre> 5833 * User information. 5834 * </pre> 5835 * 5836 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5837 */ setUserInfo(com.google.cloud.retail.v2.UserInfo.Builder builderForValue)5838 public Builder setUserInfo(com.google.cloud.retail.v2.UserInfo.Builder builderForValue) { 5839 if (userInfoBuilder_ == null) { 5840 userInfo_ = builderForValue.build(); 5841 } else { 5842 userInfoBuilder_.setMessage(builderForValue.build()); 5843 } 5844 bitField0_ |= 0x00010000; 5845 onChanged(); 5846 return this; 5847 } 5848 /** 5849 * 5850 * 5851 * <pre> 5852 * User information. 5853 * </pre> 5854 * 5855 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5856 */ mergeUserInfo(com.google.cloud.retail.v2.UserInfo value)5857 public Builder mergeUserInfo(com.google.cloud.retail.v2.UserInfo value) { 5858 if (userInfoBuilder_ == null) { 5859 if (((bitField0_ & 0x00010000) != 0) 5860 && userInfo_ != null 5861 && userInfo_ != com.google.cloud.retail.v2.UserInfo.getDefaultInstance()) { 5862 getUserInfoBuilder().mergeFrom(value); 5863 } else { 5864 userInfo_ = value; 5865 } 5866 } else { 5867 userInfoBuilder_.mergeFrom(value); 5868 } 5869 bitField0_ |= 0x00010000; 5870 onChanged(); 5871 return this; 5872 } 5873 /** 5874 * 5875 * 5876 * <pre> 5877 * User information. 5878 * </pre> 5879 * 5880 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5881 */ clearUserInfo()5882 public Builder clearUserInfo() { 5883 bitField0_ = (bitField0_ & ~0x00010000); 5884 userInfo_ = null; 5885 if (userInfoBuilder_ != null) { 5886 userInfoBuilder_.dispose(); 5887 userInfoBuilder_ = null; 5888 } 5889 onChanged(); 5890 return this; 5891 } 5892 /** 5893 * 5894 * 5895 * <pre> 5896 * User information. 5897 * </pre> 5898 * 5899 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5900 */ getUserInfoBuilder()5901 public com.google.cloud.retail.v2.UserInfo.Builder getUserInfoBuilder() { 5902 bitField0_ |= 0x00010000; 5903 onChanged(); 5904 return getUserInfoFieldBuilder().getBuilder(); 5905 } 5906 /** 5907 * 5908 * 5909 * <pre> 5910 * User information. 5911 * </pre> 5912 * 5913 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5914 */ getUserInfoOrBuilder()5915 public com.google.cloud.retail.v2.UserInfoOrBuilder getUserInfoOrBuilder() { 5916 if (userInfoBuilder_ != null) { 5917 return userInfoBuilder_.getMessageOrBuilder(); 5918 } else { 5919 return userInfo_ == null 5920 ? com.google.cloud.retail.v2.UserInfo.getDefaultInstance() 5921 : userInfo_; 5922 } 5923 } 5924 /** 5925 * 5926 * 5927 * <pre> 5928 * User information. 5929 * </pre> 5930 * 5931 * <code>.google.cloud.retail.v2.UserInfo user_info = 12;</code> 5932 */ 5933 private com.google.protobuf.SingleFieldBuilderV3< 5934 com.google.cloud.retail.v2.UserInfo, 5935 com.google.cloud.retail.v2.UserInfo.Builder, 5936 com.google.cloud.retail.v2.UserInfoOrBuilder> getUserInfoFieldBuilder()5937 getUserInfoFieldBuilder() { 5938 if (userInfoBuilder_ == null) { 5939 userInfoBuilder_ = 5940 new com.google.protobuf.SingleFieldBuilderV3< 5941 com.google.cloud.retail.v2.UserInfo, 5942 com.google.cloud.retail.v2.UserInfo.Builder, 5943 com.google.cloud.retail.v2.UserInfoOrBuilder>( 5944 getUserInfo(), getParentForChildren(), isClean()); 5945 userInfo_ = null; 5946 } 5947 return userInfoBuilder_; 5948 } 5949 5950 private java.lang.Object uri_ = ""; 5951 /** 5952 * 5953 * 5954 * <pre> 5955 * Complete URL (window.location.href) of the user's current page. 5956 * When using the client side event reporting with JavaScript pixel and Google 5957 * Tag Manager, this value is filled in automatically. Maximum length 5,000 5958 * characters. 5959 * </pre> 5960 * 5961 * <code>string uri = 13;</code> 5962 * 5963 * @return The uri. 5964 */ getUri()5965 public java.lang.String getUri() { 5966 java.lang.Object ref = uri_; 5967 if (!(ref instanceof java.lang.String)) { 5968 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 5969 java.lang.String s = bs.toStringUtf8(); 5970 uri_ = s; 5971 return s; 5972 } else { 5973 return (java.lang.String) ref; 5974 } 5975 } 5976 /** 5977 * 5978 * 5979 * <pre> 5980 * Complete URL (window.location.href) of the user's current page. 5981 * When using the client side event reporting with JavaScript pixel and Google 5982 * Tag Manager, this value is filled in automatically. Maximum length 5,000 5983 * characters. 5984 * </pre> 5985 * 5986 * <code>string uri = 13;</code> 5987 * 5988 * @return The bytes for uri. 5989 */ getUriBytes()5990 public com.google.protobuf.ByteString getUriBytes() { 5991 java.lang.Object ref = uri_; 5992 if (ref instanceof String) { 5993 com.google.protobuf.ByteString b = 5994 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 5995 uri_ = b; 5996 return b; 5997 } else { 5998 return (com.google.protobuf.ByteString) ref; 5999 } 6000 } 6001 /** 6002 * 6003 * 6004 * <pre> 6005 * Complete URL (window.location.href) of the user's current page. 6006 * When using the client side event reporting with JavaScript pixel and Google 6007 * Tag Manager, this value is filled in automatically. Maximum length 5,000 6008 * characters. 6009 * </pre> 6010 * 6011 * <code>string uri = 13;</code> 6012 * 6013 * @param value The uri to set. 6014 * @return This builder for chaining. 6015 */ setUri(java.lang.String value)6016 public Builder setUri(java.lang.String value) { 6017 if (value == null) { 6018 throw new NullPointerException(); 6019 } 6020 uri_ = value; 6021 bitField0_ |= 0x00020000; 6022 onChanged(); 6023 return this; 6024 } 6025 /** 6026 * 6027 * 6028 * <pre> 6029 * Complete URL (window.location.href) of the user's current page. 6030 * When using the client side event reporting with JavaScript pixel and Google 6031 * Tag Manager, this value is filled in automatically. Maximum length 5,000 6032 * characters. 6033 * </pre> 6034 * 6035 * <code>string uri = 13;</code> 6036 * 6037 * @return This builder for chaining. 6038 */ clearUri()6039 public Builder clearUri() { 6040 uri_ = getDefaultInstance().getUri(); 6041 bitField0_ = (bitField0_ & ~0x00020000); 6042 onChanged(); 6043 return this; 6044 } 6045 /** 6046 * 6047 * 6048 * <pre> 6049 * Complete URL (window.location.href) of the user's current page. 6050 * When using the client side event reporting with JavaScript pixel and Google 6051 * Tag Manager, this value is filled in automatically. Maximum length 5,000 6052 * characters. 6053 * </pre> 6054 * 6055 * <code>string uri = 13;</code> 6056 * 6057 * @param value The bytes for uri to set. 6058 * @return This builder for chaining. 6059 */ setUriBytes(com.google.protobuf.ByteString value)6060 public Builder setUriBytes(com.google.protobuf.ByteString value) { 6061 if (value == null) { 6062 throw new NullPointerException(); 6063 } 6064 checkByteStringIsUtf8(value); 6065 uri_ = value; 6066 bitField0_ |= 0x00020000; 6067 onChanged(); 6068 return this; 6069 } 6070 6071 private java.lang.Object referrerUri_ = ""; 6072 /** 6073 * 6074 * 6075 * <pre> 6076 * The referrer URL of the current page. 6077 * When using the client side event reporting with JavaScript pixel and Google 6078 * Tag Manager, this value is filled in automatically. 6079 * </pre> 6080 * 6081 * <code>string referrer_uri = 14;</code> 6082 * 6083 * @return The referrerUri. 6084 */ getReferrerUri()6085 public java.lang.String getReferrerUri() { 6086 java.lang.Object ref = referrerUri_; 6087 if (!(ref instanceof java.lang.String)) { 6088 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6089 java.lang.String s = bs.toStringUtf8(); 6090 referrerUri_ = s; 6091 return s; 6092 } else { 6093 return (java.lang.String) ref; 6094 } 6095 } 6096 /** 6097 * 6098 * 6099 * <pre> 6100 * The referrer URL of the current page. 6101 * When using the client side event reporting with JavaScript pixel and Google 6102 * Tag Manager, this value is filled in automatically. 6103 * </pre> 6104 * 6105 * <code>string referrer_uri = 14;</code> 6106 * 6107 * @return The bytes for referrerUri. 6108 */ getReferrerUriBytes()6109 public com.google.protobuf.ByteString getReferrerUriBytes() { 6110 java.lang.Object ref = referrerUri_; 6111 if (ref instanceof String) { 6112 com.google.protobuf.ByteString b = 6113 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6114 referrerUri_ = b; 6115 return b; 6116 } else { 6117 return (com.google.protobuf.ByteString) ref; 6118 } 6119 } 6120 /** 6121 * 6122 * 6123 * <pre> 6124 * The referrer URL of the current page. 6125 * When using the client side event reporting with JavaScript pixel and Google 6126 * Tag Manager, this value is filled in automatically. 6127 * </pre> 6128 * 6129 * <code>string referrer_uri = 14;</code> 6130 * 6131 * @param value The referrerUri to set. 6132 * @return This builder for chaining. 6133 */ setReferrerUri(java.lang.String value)6134 public Builder setReferrerUri(java.lang.String value) { 6135 if (value == null) { 6136 throw new NullPointerException(); 6137 } 6138 referrerUri_ = value; 6139 bitField0_ |= 0x00040000; 6140 onChanged(); 6141 return this; 6142 } 6143 /** 6144 * 6145 * 6146 * <pre> 6147 * The referrer URL of the current page. 6148 * When using the client side event reporting with JavaScript pixel and Google 6149 * Tag Manager, this value is filled in automatically. 6150 * </pre> 6151 * 6152 * <code>string referrer_uri = 14;</code> 6153 * 6154 * @return This builder for chaining. 6155 */ clearReferrerUri()6156 public Builder clearReferrerUri() { 6157 referrerUri_ = getDefaultInstance().getReferrerUri(); 6158 bitField0_ = (bitField0_ & ~0x00040000); 6159 onChanged(); 6160 return this; 6161 } 6162 /** 6163 * 6164 * 6165 * <pre> 6166 * The referrer URL of the current page. 6167 * When using the client side event reporting with JavaScript pixel and Google 6168 * Tag Manager, this value is filled in automatically. 6169 * </pre> 6170 * 6171 * <code>string referrer_uri = 14;</code> 6172 * 6173 * @param value The bytes for referrerUri to set. 6174 * @return This builder for chaining. 6175 */ setReferrerUriBytes(com.google.protobuf.ByteString value)6176 public Builder setReferrerUriBytes(com.google.protobuf.ByteString value) { 6177 if (value == null) { 6178 throw new NullPointerException(); 6179 } 6180 checkByteStringIsUtf8(value); 6181 referrerUri_ = value; 6182 bitField0_ |= 0x00040000; 6183 onChanged(); 6184 return this; 6185 } 6186 6187 private java.lang.Object pageViewId_ = ""; 6188 /** 6189 * 6190 * 6191 * <pre> 6192 * A unique ID of a web page view. 6193 * This should be kept the same for all user events triggered from the same 6194 * pageview. For example, an item detail page view could trigger multiple 6195 * events as the user is browsing the page. The `pageViewId` property should 6196 * be kept the same for all these events so that they can be grouped together 6197 * properly. 6198 * When using the client side event reporting with JavaScript pixel and Google 6199 * Tag Manager, this value is filled in automatically. 6200 * </pre> 6201 * 6202 * <code>string page_view_id = 15;</code> 6203 * 6204 * @return The pageViewId. 6205 */ getPageViewId()6206 public java.lang.String getPageViewId() { 6207 java.lang.Object ref = pageViewId_; 6208 if (!(ref instanceof java.lang.String)) { 6209 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6210 java.lang.String s = bs.toStringUtf8(); 6211 pageViewId_ = s; 6212 return s; 6213 } else { 6214 return (java.lang.String) ref; 6215 } 6216 } 6217 /** 6218 * 6219 * 6220 * <pre> 6221 * A unique ID of a web page view. 6222 * This should be kept the same for all user events triggered from the same 6223 * pageview. For example, an item detail page view could trigger multiple 6224 * events as the user is browsing the page. The `pageViewId` property should 6225 * be kept the same for all these events so that they can be grouped together 6226 * properly. 6227 * When using the client side event reporting with JavaScript pixel and Google 6228 * Tag Manager, this value is filled in automatically. 6229 * </pre> 6230 * 6231 * <code>string page_view_id = 15;</code> 6232 * 6233 * @return The bytes for pageViewId. 6234 */ getPageViewIdBytes()6235 public com.google.protobuf.ByteString getPageViewIdBytes() { 6236 java.lang.Object ref = pageViewId_; 6237 if (ref instanceof String) { 6238 com.google.protobuf.ByteString b = 6239 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6240 pageViewId_ = b; 6241 return b; 6242 } else { 6243 return (com.google.protobuf.ByteString) ref; 6244 } 6245 } 6246 /** 6247 * 6248 * 6249 * <pre> 6250 * A unique ID of a web page view. 6251 * This should be kept the same for all user events triggered from the same 6252 * pageview. For example, an item detail page view could trigger multiple 6253 * events as the user is browsing the page. The `pageViewId` property should 6254 * be kept the same for all these events so that they can be grouped together 6255 * properly. 6256 * When using the client side event reporting with JavaScript pixel and Google 6257 * Tag Manager, this value is filled in automatically. 6258 * </pre> 6259 * 6260 * <code>string page_view_id = 15;</code> 6261 * 6262 * @param value The pageViewId to set. 6263 * @return This builder for chaining. 6264 */ setPageViewId(java.lang.String value)6265 public Builder setPageViewId(java.lang.String value) { 6266 if (value == null) { 6267 throw new NullPointerException(); 6268 } 6269 pageViewId_ = value; 6270 bitField0_ |= 0x00080000; 6271 onChanged(); 6272 return this; 6273 } 6274 /** 6275 * 6276 * 6277 * <pre> 6278 * A unique ID of a web page view. 6279 * This should be kept the same for all user events triggered from the same 6280 * pageview. For example, an item detail page view could trigger multiple 6281 * events as the user is browsing the page. The `pageViewId` property should 6282 * be kept the same for all these events so that they can be grouped together 6283 * properly. 6284 * When using the client side event reporting with JavaScript pixel and Google 6285 * Tag Manager, this value is filled in automatically. 6286 * </pre> 6287 * 6288 * <code>string page_view_id = 15;</code> 6289 * 6290 * @return This builder for chaining. 6291 */ clearPageViewId()6292 public Builder clearPageViewId() { 6293 pageViewId_ = getDefaultInstance().getPageViewId(); 6294 bitField0_ = (bitField0_ & ~0x00080000); 6295 onChanged(); 6296 return this; 6297 } 6298 /** 6299 * 6300 * 6301 * <pre> 6302 * A unique ID of a web page view. 6303 * This should be kept the same for all user events triggered from the same 6304 * pageview. For example, an item detail page view could trigger multiple 6305 * events as the user is browsing the page. The `pageViewId` property should 6306 * be kept the same for all these events so that they can be grouped together 6307 * properly. 6308 * When using the client side event reporting with JavaScript pixel and Google 6309 * Tag Manager, this value is filled in automatically. 6310 * </pre> 6311 * 6312 * <code>string page_view_id = 15;</code> 6313 * 6314 * @param value The bytes for pageViewId to set. 6315 * @return This builder for chaining. 6316 */ setPageViewIdBytes(com.google.protobuf.ByteString value)6317 public Builder setPageViewIdBytes(com.google.protobuf.ByteString value) { 6318 if (value == null) { 6319 throw new NullPointerException(); 6320 } 6321 checkByteStringIsUtf8(value); 6322 pageViewId_ = value; 6323 bitField0_ |= 0x00080000; 6324 onChanged(); 6325 return this; 6326 } 6327 6328 private java.lang.Object entity_ = ""; 6329 /** 6330 * 6331 * 6332 * <pre> 6333 * The entity for customers that may run multiple different entities, domains, 6334 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6335 * `google.com`, `youtube.com`, etc. 6336 * It is recommended to set this field to get better per-entity search, 6337 * completion and prediction results. 6338 * </pre> 6339 * 6340 * <code>string entity = 23;</code> 6341 * 6342 * @return The entity. 6343 */ getEntity()6344 public java.lang.String getEntity() { 6345 java.lang.Object ref = entity_; 6346 if (!(ref instanceof java.lang.String)) { 6347 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6348 java.lang.String s = bs.toStringUtf8(); 6349 entity_ = s; 6350 return s; 6351 } else { 6352 return (java.lang.String) ref; 6353 } 6354 } 6355 /** 6356 * 6357 * 6358 * <pre> 6359 * The entity for customers that may run multiple different entities, domains, 6360 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6361 * `google.com`, `youtube.com`, etc. 6362 * It is recommended to set this field to get better per-entity search, 6363 * completion and prediction results. 6364 * </pre> 6365 * 6366 * <code>string entity = 23;</code> 6367 * 6368 * @return The bytes for entity. 6369 */ getEntityBytes()6370 public com.google.protobuf.ByteString getEntityBytes() { 6371 java.lang.Object ref = entity_; 6372 if (ref instanceof String) { 6373 com.google.protobuf.ByteString b = 6374 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6375 entity_ = b; 6376 return b; 6377 } else { 6378 return (com.google.protobuf.ByteString) ref; 6379 } 6380 } 6381 /** 6382 * 6383 * 6384 * <pre> 6385 * The entity for customers that may run multiple different entities, domains, 6386 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6387 * `google.com`, `youtube.com`, etc. 6388 * It is recommended to set this field to get better per-entity search, 6389 * completion and prediction results. 6390 * </pre> 6391 * 6392 * <code>string entity = 23;</code> 6393 * 6394 * @param value The entity to set. 6395 * @return This builder for chaining. 6396 */ setEntity(java.lang.String value)6397 public Builder setEntity(java.lang.String value) { 6398 if (value == null) { 6399 throw new NullPointerException(); 6400 } 6401 entity_ = value; 6402 bitField0_ |= 0x00100000; 6403 onChanged(); 6404 return this; 6405 } 6406 /** 6407 * 6408 * 6409 * <pre> 6410 * The entity for customers that may run multiple different entities, domains, 6411 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6412 * `google.com`, `youtube.com`, etc. 6413 * It is recommended to set this field to get better per-entity search, 6414 * completion and prediction results. 6415 * </pre> 6416 * 6417 * <code>string entity = 23;</code> 6418 * 6419 * @return This builder for chaining. 6420 */ clearEntity()6421 public Builder clearEntity() { 6422 entity_ = getDefaultInstance().getEntity(); 6423 bitField0_ = (bitField0_ & ~0x00100000); 6424 onChanged(); 6425 return this; 6426 } 6427 /** 6428 * 6429 * 6430 * <pre> 6431 * The entity for customers that may run multiple different entities, domains, 6432 * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6433 * `google.com`, `youtube.com`, etc. 6434 * It is recommended to set this field to get better per-entity search, 6435 * completion and prediction results. 6436 * </pre> 6437 * 6438 * <code>string entity = 23;</code> 6439 * 6440 * @param value The bytes for entity to set. 6441 * @return This builder for chaining. 6442 */ setEntityBytes(com.google.protobuf.ByteString value)6443 public Builder setEntityBytes(com.google.protobuf.ByteString value) { 6444 if (value == null) { 6445 throw new NullPointerException(); 6446 } 6447 checkByteStringIsUtf8(value); 6448 entity_ = value; 6449 bitField0_ |= 0x00100000; 6450 onChanged(); 6451 return this; 6452 } 6453 6454 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)6455 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 6456 return super.setUnknownFields(unknownFields); 6457 } 6458 6459 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6460 public final Builder mergeUnknownFields( 6461 final com.google.protobuf.UnknownFieldSet unknownFields) { 6462 return super.mergeUnknownFields(unknownFields); 6463 } 6464 6465 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.UserEvent) 6466 } 6467 6468 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.UserEvent) 6469 private static final com.google.cloud.retail.v2.UserEvent DEFAULT_INSTANCE; 6470 6471 static { 6472 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.UserEvent(); 6473 } 6474 getDefaultInstance()6475 public static com.google.cloud.retail.v2.UserEvent getDefaultInstance() { 6476 return DEFAULT_INSTANCE; 6477 } 6478 6479 private static final com.google.protobuf.Parser<UserEvent> PARSER = 6480 new com.google.protobuf.AbstractParser<UserEvent>() { 6481 @java.lang.Override 6482 public UserEvent parsePartialFrom( 6483 com.google.protobuf.CodedInputStream input, 6484 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6485 throws com.google.protobuf.InvalidProtocolBufferException { 6486 Builder builder = newBuilder(); 6487 try { 6488 builder.mergeFrom(input, extensionRegistry); 6489 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 6490 throw e.setUnfinishedMessage(builder.buildPartial()); 6491 } catch (com.google.protobuf.UninitializedMessageException e) { 6492 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 6493 } catch (java.io.IOException e) { 6494 throw new com.google.protobuf.InvalidProtocolBufferException(e) 6495 .setUnfinishedMessage(builder.buildPartial()); 6496 } 6497 return builder.buildPartial(); 6498 } 6499 }; 6500 parser()6501 public static com.google.protobuf.Parser<UserEvent> parser() { 6502 return PARSER; 6503 } 6504 6505 @java.lang.Override getParserForType()6506 public com.google.protobuf.Parser<UserEvent> getParserForType() { 6507 return PARSER; 6508 } 6509 6510 @java.lang.Override getDefaultInstanceForType()6511 public com.google.cloud.retail.v2.UserEvent getDefaultInstanceForType() { 6512 return DEFAULT_INSTANCE; 6513 } 6514 } 6515