All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.recommendationengine.v1beta1.ProductEventDetail Maven / Gradle / Ivy

/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/recommendationengine/v1beta1/user_event.proto

// Protobuf Java Version: 3.25.5
package com.google.cloud.recommendationengine.v1beta1;

/**
 *
 *
 * 
 * ProductEventDetail captures user event information specific to retail
 * products.
 * 
* * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductEventDetail} */ public final class ProductEventDetail extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.ProductEventDetail) ProductEventDetailOrBuilder { private static final long serialVersionUID = 0L; // Use ProductEventDetail.newBuilder() to construct. private ProductEventDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private ProductEventDetail() { searchQuery_ = ""; pageCategories_ = java.util.Collections.emptyList(); productDetails_ = java.util.Collections.emptyList(); listId_ = ""; cartId_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ProductEventDetail(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.class, com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder.class); } private int bitField0_; public static final int SEARCH_QUERY_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object searchQuery_ = ""; /** * * *
   * Required for `search` events. Other event types should not set this field.
   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
   * 
* * string search_query = 1; * * @return The searchQuery. */ @java.lang.Override public java.lang.String getSearchQuery() { java.lang.Object ref = searchQuery_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); searchQuery_ = s; return s; } } /** * * *
   * Required for `search` events. Other event types should not set this field.
   * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
   * 
* * string search_query = 1; * * @return The bytes for searchQuery. */ @java.lang.Override public com.google.protobuf.ByteString getSearchQueryBytes() { java.lang.Object ref = searchQuery_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); searchQuery_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PAGE_CATEGORIES_FIELD_NUMBER = 2; @SuppressWarnings("serial") private java.util.List< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> pageCategories_; /** * * *
   * Required for `category-page-view` events. Other event types should not set
   * this field.
   * The categories associated with a category page.
   * Category pages include special pages such as sales or promotions. For
   * instance, a special sale page may have the category hierarchy:
   * categories : ["Sales", "2017 Black Friday Deals"].
   * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ @java.lang.Override public java.util.List getPageCategoriesList() { return pageCategories_; } /** * * *
   * Required for `category-page-view` events. Other event types should not set
   * this field.
   * The categories associated with a category page.
   * Category pages include special pages such as sales or promotions. For
   * instance, a special sale page may have the category hierarchy:
   * categories : ["Sales", "2017 Black Friday Deals"].
   * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ @java.lang.Override public java.util.List< ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> getPageCategoriesOrBuilderList() { return pageCategories_; } /** * * *
   * Required for `category-page-view` events. Other event types should not set
   * this field.
   * The categories associated with a category page.
   * Category pages include special pages such as sales or promotions. For
   * instance, a special sale page may have the category hierarchy:
   * categories : ["Sales", "2017 Black Friday Deals"].
   * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ @java.lang.Override public int getPageCategoriesCount() { return pageCategories_.size(); } /** * * *
   * Required for `category-page-view` events. Other event types should not set
   * this field.
   * The categories associated with a category page.
   * Category pages include special pages such as sales or promotions. For
   * instance, a special sale page may have the category hierarchy:
   * categories : ["Sales", "2017 Black Friday Deals"].
   * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy getPageCategories(int index) { return pageCategories_.get(index); } /** * * *
   * Required for `category-page-view` events. Other event types should not set
   * this field.
   * The categories associated with a category page.
   * Category pages include special pages such as sales or promotions. For
   * instance, a special sale page may have the category hierarchy:
   * categories : ["Sales", "2017 Black Friday Deals"].
   * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder getPageCategoriesOrBuilder(int index) { return pageCategories_.get(index); } public static final int PRODUCT_DETAILS_FIELD_NUMBER = 3; @SuppressWarnings("serial") private java.util.List productDetails_; /** * * *
   * The main product details related to the event.
   *
   * This field is required for the following event types:
   *
   * * `add-to-cart`
   * * `add-to-list`
   * * `checkout-start`
   * * `detail-page-view`
   * * `purchase-complete`
   * * `refund`
   * * `remove-from-cart`
   * * `remove-from-list`
   *
   * This field is optional for the following event types:
   *
   * * `page-visit`
   * * `shopping-cart-page-view` - note that 'product_details' should be set for
   *   this unless the shopping cart is empty.
   *
   * This field is not allowed for the following event types:
   *
   * * `category-page-view`
   * * `home-page-view`
   * * `search`
   * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ @java.lang.Override public java.util.List getProductDetailsList() { return productDetails_; } /** * * *
   * The main product details related to the event.
   *
   * This field is required for the following event types:
   *
   * * `add-to-cart`
   * * `add-to-list`
   * * `checkout-start`
   * * `detail-page-view`
   * * `purchase-complete`
   * * `refund`
   * * `remove-from-cart`
   * * `remove-from-list`
   *
   * This field is optional for the following event types:
   *
   * * `page-visit`
   * * `shopping-cart-page-view` - note that 'product_details' should be set for
   *   this unless the shopping cart is empty.
   *
   * This field is not allowed for the following event types:
   *
   * * `category-page-view`
   * * `home-page-view`
   * * `search`
   * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ @java.lang.Override public java.util.List< ? extends com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> getProductDetailsOrBuilderList() { return productDetails_; } /** * * *
   * The main product details related to the event.
   *
   * This field is required for the following event types:
   *
   * * `add-to-cart`
   * * `add-to-list`
   * * `checkout-start`
   * * `detail-page-view`
   * * `purchase-complete`
   * * `refund`
   * * `remove-from-cart`
   * * `remove-from-list`
   *
   * This field is optional for the following event types:
   *
   * * `page-visit`
   * * `shopping-cart-page-view` - note that 'product_details' should be set for
   *   this unless the shopping cart is empty.
   *
   * This field is not allowed for the following event types:
   *
   * * `category-page-view`
   * * `home-page-view`
   * * `search`
   * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ @java.lang.Override public int getProductDetailsCount() { return productDetails_.size(); } /** * * *
   * The main product details related to the event.
   *
   * This field is required for the following event types:
   *
   * * `add-to-cart`
   * * `add-to-list`
   * * `checkout-start`
   * * `detail-page-view`
   * * `purchase-complete`
   * * `refund`
   * * `remove-from-cart`
   * * `remove-from-list`
   *
   * This field is optional for the following event types:
   *
   * * `page-visit`
   * * `shopping-cart-page-view` - note that 'product_details' should be set for
   *   this unless the shopping cart is empty.
   *
   * This field is not allowed for the following event types:
   *
   * * `category-page-view`
   * * `home-page-view`
   * * `search`
   * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductDetail getProductDetails(int index) { return productDetails_.get(index); } /** * * *
   * The main product details related to the event.
   *
   * This field is required for the following event types:
   *
   * * `add-to-cart`
   * * `add-to-list`
   * * `checkout-start`
   * * `detail-page-view`
   * * `purchase-complete`
   * * `refund`
   * * `remove-from-cart`
   * * `remove-from-list`
   *
   * This field is optional for the following event types:
   *
   * * `page-visit`
   * * `shopping-cart-page-view` - note that 'product_details' should be set for
   *   this unless the shopping cart is empty.
   *
   * This field is not allowed for the following event types:
   *
   * * `category-page-view`
   * * `home-page-view`
   * * `search`
   * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { return productDetails_.get(index); } public static final int LIST_ID_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object listId_ = ""; /** * * *
   * Required for `add-to-list` and `remove-from-list` events. The id or name of
   * the list that the item is being added to or removed from. Other event types
   * should not set this field.
   * 
* * string list_id = 4; * * @return The listId. */ @java.lang.Override public java.lang.String getListId() { java.lang.Object ref = listId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); listId_ = s; return s; } } /** * * *
   * Required for `add-to-list` and `remove-from-list` events. The id or name of
   * the list that the item is being added to or removed from. Other event types
   * should not set this field.
   * 
* * string list_id = 4; * * @return The bytes for listId. */ @java.lang.Override public com.google.protobuf.ByteString getListIdBytes() { java.lang.Object ref = listId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); listId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int CART_ID_FIELD_NUMBER = 5; @SuppressWarnings("serial") private volatile java.lang.Object cartId_ = ""; /** * * *
   * Optional. The id or name of the associated shopping cart. This id is used
   * to associate multiple items added or present in the cart before purchase.
   *
   * This can only be set for `add-to-cart`, `remove-from-cart`,
   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
   * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The cartId. */ @java.lang.Override public java.lang.String getCartId() { java.lang.Object ref = cartId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); cartId_ = s; return s; } } /** * * *
   * Optional. The id or name of the associated shopping cart. This id is used
   * to associate multiple items added or present in the cart before purchase.
   *
   * This can only be set for `add-to-cart`, `remove-from-cart`,
   * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
   * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for cartId. */ @java.lang.Override public com.google.protobuf.ByteString getCartIdBytes() { java.lang.Object ref = cartId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); cartId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PURCHASE_TRANSACTION_FIELD_NUMBER = 6; private com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchaseTransaction_; /** * * *
   * Optional. A transaction represents the entire purchase transaction.
   * Required for `purchase-complete` events. Optional for `checkout-start`
   * events. Other event types should not set this field.
   * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the purchaseTransaction field is set. */ @java.lang.Override public boolean hasPurchaseTransaction() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * Optional. A transaction represents the entire purchase transaction.
   * Required for `purchase-complete` events. Optional for `checkout-start`
   * events. Other event types should not set this field.
   * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The purchaseTransaction. */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction getPurchaseTransaction() { return purchaseTransaction_ == null ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() : purchaseTransaction_; } /** * * *
   * Optional. A transaction represents the entire purchase transaction.
   * Required for `purchase-complete` events. Optional for `checkout-start`
   * events. Other event types should not set this field.
   * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder() { return purchaseTransaction_ == null ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() : purchaseTransaction_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, searchQuery_); } for (int i = 0; i < pageCategories_.size(); i++) { output.writeMessage(2, pageCategories_.get(i)); } for (int i = 0; i < productDetails_.size(); i++) { output.writeMessage(3, productDetails_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, listId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, cartId_); } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(6, getPurchaseTransaction()); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, searchQuery_); } for (int i = 0; i < pageCategories_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, pageCategories_.get(i)); } for (int i = 0; i < productDetails_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, productDetails_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, listId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cartId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, cartId_); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPurchaseTransaction()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.ProductEventDetail)) { return super.equals(obj); } com.google.cloud.recommendationengine.v1beta1.ProductEventDetail other = (com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) obj; if (!getSearchQuery().equals(other.getSearchQuery())) return false; if (!getPageCategoriesList().equals(other.getPageCategoriesList())) return false; if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; if (!getListId().equals(other.getListId())) return false; if (!getCartId().equals(other.getCartId())) return false; if (hasPurchaseTransaction() != other.hasPurchaseTransaction()) return false; if (hasPurchaseTransaction()) { if (!getPurchaseTransaction().equals(other.getPurchaseTransaction())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; hash = (53 * hash) + getSearchQuery().hashCode(); if (getPageCategoriesCount() > 0) { hash = (37 * hash) + PAGE_CATEGORIES_FIELD_NUMBER; hash = (53 * hash) + getPageCategoriesList().hashCode(); } if (getProductDetailsCount() > 0) { hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; hash = (53 * hash) + getProductDetailsList().hashCode(); } hash = (37 * hash) + LIST_ID_FIELD_NUMBER; hash = (53 * hash) + getListId().hashCode(); hash = (37 * hash) + CART_ID_FIELD_NUMBER; hash = (53 * hash) + getCartId().hashCode(); if (hasPurchaseTransaction()) { hash = (37 * hash) + PURCHASE_TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getPurchaseTransaction().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * ProductEventDetail captures user event information specific to retail
   * products.
   * 
* * Protobuf type {@code google.cloud.recommendationengine.v1beta1.ProductEventDetail} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.ProductEventDetail) com.google.cloud.recommendationengine.v1beta1.ProductEventDetailOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.class, com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.Builder.class); } // Construct using com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPageCategoriesFieldBuilder(); getProductDetailsFieldBuilder(); getPurchaseTransactionFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; searchQuery_ = ""; if (pageCategoriesBuilder_ == null) { pageCategories_ = java.util.Collections.emptyList(); } else { pageCategories_ = null; pageCategoriesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); if (productDetailsBuilder_ == null) { productDetails_ = java.util.Collections.emptyList(); } else { productDetails_ = null; productDetailsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); listId_ = ""; cartId_ = ""; purchaseTransaction_ = null; if (purchaseTransactionBuilder_ != null) { purchaseTransactionBuilder_.dispose(); purchaseTransactionBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_ProductEventDetail_descriptor; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail getDefaultInstanceForType() { return com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance(); } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail build() { com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail buildPartial() { com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result = new com.google.cloud.recommendationengine.v1beta1.ProductEventDetail(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result) { if (pageCategoriesBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { pageCategories_ = java.util.Collections.unmodifiableList(pageCategories_); bitField0_ = (bitField0_ & ~0x00000002); } result.pageCategories_ = pageCategories_; } else { result.pageCategories_ = pageCategoriesBuilder_.build(); } if (productDetailsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { productDetails_ = java.util.Collections.unmodifiableList(productDetails_); bitField0_ = (bitField0_ & ~0x00000004); } result.productDetails_ = productDetails_; } else { result.productDetails_ = productDetailsBuilder_.build(); } } private void buildPartial0( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.searchQuery_ = searchQuery_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.listId_ = listId_; } if (((from_bitField0_ & 0x00000010) != 0)) { result.cartId_ = cartId_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000020) != 0)) { result.purchaseTransaction_ = purchaseTransactionBuilder_ == null ? purchaseTransaction_ : purchaseTransactionBuilder_.build(); to_bitField0_ |= 0x00000001; } result.bitField0_ |= to_bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) { return mergeFrom((com.google.cloud.recommendationengine.v1beta1.ProductEventDetail) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.recommendationengine.v1beta1.ProductEventDetail other) { if (other == com.google.cloud.recommendationengine.v1beta1.ProductEventDetail.getDefaultInstance()) return this; if (!other.getSearchQuery().isEmpty()) { searchQuery_ = other.searchQuery_; bitField0_ |= 0x00000001; onChanged(); } if (pageCategoriesBuilder_ == null) { if (!other.pageCategories_.isEmpty()) { if (pageCategories_.isEmpty()) { pageCategories_ = other.pageCategories_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensurePageCategoriesIsMutable(); pageCategories_.addAll(other.pageCategories_); } onChanged(); } } else { if (!other.pageCategories_.isEmpty()) { if (pageCategoriesBuilder_.isEmpty()) { pageCategoriesBuilder_.dispose(); pageCategoriesBuilder_ = null; pageCategories_ = other.pageCategories_; bitField0_ = (bitField0_ & ~0x00000002); pageCategoriesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPageCategoriesFieldBuilder() : null; } else { pageCategoriesBuilder_.addAllMessages(other.pageCategories_); } } } if (productDetailsBuilder_ == null) { if (!other.productDetails_.isEmpty()) { if (productDetails_.isEmpty()) { productDetails_ = other.productDetails_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureProductDetailsIsMutable(); productDetails_.addAll(other.productDetails_); } onChanged(); } } else { if (!other.productDetails_.isEmpty()) { if (productDetailsBuilder_.isEmpty()) { productDetailsBuilder_.dispose(); productDetailsBuilder_ = null; productDetails_ = other.productDetails_; bitField0_ = (bitField0_ & ~0x00000004); productDetailsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getProductDetailsFieldBuilder() : null; } else { productDetailsBuilder_.addAllMessages(other.productDetails_); } } } if (!other.getListId().isEmpty()) { listId_ = other.listId_; bitField0_ |= 0x00000008; onChanged(); } if (!other.getCartId().isEmpty()) { cartId_ = other.cartId_; bitField0_ |= 0x00000010; onChanged(); } if (other.hasPurchaseTransaction()) { mergePurchaseTransaction(other.getPurchaseTransaction()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { searchQuery_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy m = input.readMessage( com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy .parser(), extensionRegistry); if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); pageCategories_.add(m); } else { pageCategoriesBuilder_.addMessage(m); } break; } // case 18 case 26: { com.google.cloud.recommendationengine.v1beta1.ProductDetail m = input.readMessage( com.google.cloud.recommendationengine.v1beta1.ProductDetail.parser(), extensionRegistry); if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); productDetails_.add(m); } else { productDetailsBuilder_.addMessage(m); } break; } // case 26 case 34: { listId_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000008; break; } // case 34 case 42: { cartId_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; } // case 42 case 50: { input.readMessage( getPurchaseTransactionFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000020; break; } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object searchQuery_ = ""; /** * * *
     * Required for `search` events. Other event types should not set this field.
     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
     * 
* * string search_query = 1; * * @return The searchQuery. */ public java.lang.String getSearchQuery() { java.lang.Object ref = searchQuery_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); searchQuery_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Required for `search` events. Other event types should not set this field.
     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
     * 
* * string search_query = 1; * * @return The bytes for searchQuery. */ public com.google.protobuf.ByteString getSearchQueryBytes() { java.lang.Object ref = searchQuery_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); searchQuery_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Required for `search` events. Other event types should not set this field.
     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
     * 
* * string search_query = 1; * * @param value The searchQuery to set. * @return This builder for chaining. */ public Builder setSearchQuery(java.lang.String value) { if (value == null) { throw new NullPointerException(); } searchQuery_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * Required for `search` events. Other event types should not set this field.
     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
     * 
* * string search_query = 1; * * @return This builder for chaining. */ public Builder clearSearchQuery() { searchQuery_ = getDefaultInstance().getSearchQuery(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * Required for `search` events. Other event types should not set this field.
     * The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
     * 
* * string search_query = 1; * * @param value The bytes for searchQuery to set. * @return This builder for chaining. */ public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); searchQuery_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.util.List< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> pageCategories_ = java.util.Collections.emptyList(); private void ensurePageCategoriesIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { pageCategories_ = new java.util.ArrayList< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy>( pageCategories_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> pageCategoriesBuilder_; /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public java.util.List< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> getPageCategoriesList() { if (pageCategoriesBuilder_ == null) { return java.util.Collections.unmodifiableList(pageCategories_); } else { return pageCategoriesBuilder_.getMessageList(); } } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public int getPageCategoriesCount() { if (pageCategoriesBuilder_ == null) { return pageCategories_.size(); } else { return pageCategoriesBuilder_.getCount(); } } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy getPageCategories(int index) { if (pageCategoriesBuilder_ == null) { return pageCategories_.get(index); } else { return pageCategoriesBuilder_.getMessage(index); } } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder setPageCategories( int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { if (pageCategoriesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePageCategoriesIsMutable(); pageCategories_.set(index, value); onChanged(); } else { pageCategoriesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder setPageCategories( int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder builderForValue) { if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); pageCategories_.set(index, builderForValue.build()); onChanged(); } else { pageCategoriesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder addPageCategories( com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { if (pageCategoriesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePageCategoriesIsMutable(); pageCategories_.add(value); onChanged(); } else { pageCategoriesBuilder_.addMessage(value); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder addPageCategories( int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy value) { if (pageCategoriesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePageCategoriesIsMutable(); pageCategories_.add(index, value); onChanged(); } else { pageCategoriesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder addPageCategories( com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder builderForValue) { if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); pageCategories_.add(builderForValue.build()); onChanged(); } else { pageCategoriesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder addPageCategories( int index, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder builderForValue) { if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); pageCategories_.add(index, builderForValue.build()); onChanged(); } else { pageCategoriesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder addAllPageCategories( java.lang.Iterable< ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy> values) { if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageCategories_); onChanged(); } else { pageCategoriesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder clearPageCategories() { if (pageCategoriesBuilder_ == null) { pageCategories_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { pageCategoriesBuilder_.clear(); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public Builder removePageCategories(int index) { if (pageCategoriesBuilder_ == null) { ensurePageCategoriesIsMutable(); pageCategories_.remove(index); onChanged(); } else { pageCategoriesBuilder_.remove(index); } return this; } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder getPageCategoriesBuilder(int index) { return getPageCategoriesFieldBuilder().getBuilder(index); } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder getPageCategoriesOrBuilder(int index) { if (pageCategoriesBuilder_ == null) { return pageCategories_.get(index); } else { return pageCategoriesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public java.util.List< ? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem .CategoryHierarchyOrBuilder> getPageCategoriesOrBuilderList() { if (pageCategoriesBuilder_ != null) { return pageCategoriesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(pageCategories_); } } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder addPageCategoriesBuilder() { return getPageCategoriesFieldBuilder() .addBuilder( com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy .getDefaultInstance()); } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder addPageCategoriesBuilder(int index) { return getPageCategoriesFieldBuilder() .addBuilder( index, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy .getDefaultInstance()); } /** * * *
     * Required for `category-page-view` events. Other event types should not set
     * this field.
     * The categories associated with a category page.
     * Category pages include special pages such as sales or promotions. For
     * instance, a special sale page may have the category hierarchy:
     * categories : ["Sales", "2017 Black Friday Deals"].
     * 
* * * repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; * */ public java.util.List< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder> getPageCategoriesBuilderList() { return getPageCategoriesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder> getPageCategoriesFieldBuilder() { if (pageCategoriesBuilder_ == null) { pageCategoriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy, com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy.Builder, com.google.cloud.recommendationengine.v1beta1.CatalogItem .CategoryHierarchyOrBuilder>( pageCategories_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); pageCategories_ = null; } return pageCategoriesBuilder_; } private java.util.List productDetails_ = java.util.Collections.emptyList(); private void ensureProductDetailsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { productDetails_ = new java.util.ArrayList( productDetails_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.ProductDetail, com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> productDetailsBuilder_; /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public java.util.List getProductDetailsList() { if (productDetailsBuilder_ == null) { return java.util.Collections.unmodifiableList(productDetails_); } else { return productDetailsBuilder_.getMessageList(); } } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public int getProductDetailsCount() { if (productDetailsBuilder_ == null) { return productDetails_.size(); } else { return productDetailsBuilder_.getCount(); } } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public com.google.cloud.recommendationengine.v1beta1.ProductDetail getProductDetails( int index) { if (productDetailsBuilder_ == null) { return productDetails_.get(index); } else { return productDetailsBuilder_.getMessage(index); } } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder setProductDetails( int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { if (productDetailsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureProductDetailsIsMutable(); productDetails_.set(index, value); onChanged(); } else { productDetailsBuilder_.setMessage(index, value); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder setProductDetails( int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); productDetails_.set(index, builderForValue.build()); onChanged(); } else { productDetailsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder addProductDetails( com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { if (productDetailsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureProductDetailsIsMutable(); productDetails_.add(value); onChanged(); } else { productDetailsBuilder_.addMessage(value); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder addProductDetails( int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail value) { if (productDetailsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureProductDetailsIsMutable(); productDetails_.add(index, value); onChanged(); } else { productDetailsBuilder_.addMessage(index, value); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder addProductDetails( com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); productDetails_.add(builderForValue.build()); onChanged(); } else { productDetailsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder addProductDetails( int index, com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder builderForValue) { if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); productDetails_.add(index, builderForValue.build()); onChanged(); } else { productDetailsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder addAllProductDetails( java.lang.Iterable values) { if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); onChanged(); } else { productDetailsBuilder_.addAllMessages(values); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder clearProductDetails() { if (productDetailsBuilder_ == null) { productDetails_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { productDetailsBuilder_.clear(); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public Builder removeProductDetails(int index) { if (productDetailsBuilder_ == null) { ensureProductDetailsIsMutable(); productDetails_.remove(index); onChanged(); } else { productDetailsBuilder_.remove(index); } return this; } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder getProductDetailsBuilder(int index) { return getProductDetailsFieldBuilder().getBuilder(index); } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { if (productDetailsBuilder_ == null) { return productDetails_.get(index); } else { return productDetailsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public java.util.List< ? extends com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> getProductDetailsOrBuilderList() { if (productDetailsBuilder_ != null) { return productDetailsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(productDetails_); } } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder addProductDetailsBuilder() { return getProductDetailsFieldBuilder() .addBuilder( com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance()); } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder addProductDetailsBuilder(int index) { return getProductDetailsFieldBuilder() .addBuilder( index, com.google.cloud.recommendationengine.v1beta1.ProductDetail.getDefaultInstance()); } /** * * *
     * The main product details related to the event.
     *
     * This field is required for the following event types:
     *
     * * `add-to-cart`
     * * `add-to-list`
     * * `checkout-start`
     * * `detail-page-view`
     * * `purchase-complete`
     * * `refund`
     * * `remove-from-cart`
     * * `remove-from-list`
     *
     * This field is optional for the following event types:
     *
     * * `page-visit`
     * * `shopping-cart-page-view` - note that 'product_details' should be set for
     *   this unless the shopping cart is empty.
     *
     * This field is not allowed for the following event types:
     *
     * * `category-page-view`
     * * `home-page-view`
     * * `search`
     * 
* * repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; * */ public java.util.List getProductDetailsBuilderList() { return getProductDetailsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.ProductDetail, com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder> getProductDetailsFieldBuilder() { if (productDetailsBuilder_ == null) { productDetailsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.ProductDetail, com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder, com.google.cloud.recommendationengine.v1beta1.ProductDetailOrBuilder>( productDetails_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); productDetails_ = null; } return productDetailsBuilder_; } private java.lang.Object listId_ = ""; /** * * *
     * Required for `add-to-list` and `remove-from-list` events. The id or name of
     * the list that the item is being added to or removed from. Other event types
     * should not set this field.
     * 
* * string list_id = 4; * * @return The listId. */ public java.lang.String getListId() { java.lang.Object ref = listId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); listId_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Required for `add-to-list` and `remove-from-list` events. The id or name of
     * the list that the item is being added to or removed from. Other event types
     * should not set this field.
     * 
* * string list_id = 4; * * @return The bytes for listId. */ public com.google.protobuf.ByteString getListIdBytes() { java.lang.Object ref = listId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); listId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Required for `add-to-list` and `remove-from-list` events. The id or name of
     * the list that the item is being added to or removed from. Other event types
     * should not set this field.
     * 
* * string list_id = 4; * * @param value The listId to set. * @return This builder for chaining. */ public Builder setListId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } listId_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Required for `add-to-list` and `remove-from-list` events. The id or name of
     * the list that the item is being added to or removed from. Other event types
     * should not set this field.
     * 
* * string list_id = 4; * * @return This builder for chaining. */ public Builder clearListId() { listId_ = getDefaultInstance().getListId(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** * * *
     * Required for `add-to-list` and `remove-from-list` events. The id or name of
     * the list that the item is being added to or removed from. Other event types
     * should not set this field.
     * 
* * string list_id = 4; * * @param value The bytes for listId to set. * @return This builder for chaining. */ public Builder setListIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); listId_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object cartId_ = ""; /** * * *
     * Optional. The id or name of the associated shopping cart. This id is used
     * to associate multiple items added or present in the cart before purchase.
     *
     * This can only be set for `add-to-cart`, `remove-from-cart`,
     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
     * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The cartId. */ public java.lang.String getCartId() { java.lang.Object ref = cartId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); cartId_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Optional. The id or name of the associated shopping cart. This id is used
     * to associate multiple items added or present in the cart before purchase.
     *
     * This can only be set for `add-to-cart`, `remove-from-cart`,
     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
     * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for cartId. */ public com.google.protobuf.ByteString getCartIdBytes() { java.lang.Object ref = cartId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); cartId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Optional. The id or name of the associated shopping cart. This id is used
     * to associate multiple items added or present in the cart before purchase.
     *
     * This can only be set for `add-to-cart`, `remove-from-cart`,
     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
     * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The cartId to set. * @return This builder for chaining. */ public Builder setCartId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } cartId_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * Optional. The id or name of the associated shopping cart. This id is used
     * to associate multiple items added or present in the cart before purchase.
     *
     * This can only be set for `add-to-cart`, `remove-from-cart`,
     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
     * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearCartId() { cartId_ = getDefaultInstance().getCartId(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * * *
     * Optional. The id or name of the associated shopping cart. This id is used
     * to associate multiple items added or present in the cart before purchase.
     *
     * This can only be set for `add-to-cart`, `remove-from-cart`,
     * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
     * 
* * string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for cartId to set. * @return This builder for chaining. */ public Builder setCartIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); cartId_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } private com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchaseTransaction_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder> purchaseTransactionBuilder_; /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the purchaseTransaction field is set. */ public boolean hasPurchaseTransaction() { return ((bitField0_ & 0x00000020) != 0); } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The purchaseTransaction. */ public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction getPurchaseTransaction() { if (purchaseTransactionBuilder_ == null) { return purchaseTransaction_ == null ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() : purchaseTransaction_; } else { return purchaseTransactionBuilder_.getMessage(); } } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setPurchaseTransaction( com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction value) { if (purchaseTransactionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } purchaseTransaction_ = value; } else { purchaseTransactionBuilder_.setMessage(value); } bitField0_ |= 0x00000020; onChanged(); return this; } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setPurchaseTransaction( com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder builderForValue) { if (purchaseTransactionBuilder_ == null) { purchaseTransaction_ = builderForValue.build(); } else { purchaseTransactionBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000020; onChanged(); return this; } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder mergePurchaseTransaction( com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction value) { if (purchaseTransactionBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0) && purchaseTransaction_ != null && purchaseTransaction_ != com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction .getDefaultInstance()) { getPurchaseTransactionBuilder().mergeFrom(value); } else { purchaseTransaction_ = value; } } else { purchaseTransactionBuilder_.mergeFrom(value); } if (purchaseTransaction_ != null) { bitField0_ |= 0x00000020; onChanged(); } return this; } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearPurchaseTransaction() { bitField0_ = (bitField0_ & ~0x00000020); purchaseTransaction_ = null; if (purchaseTransactionBuilder_ != null) { purchaseTransactionBuilder_.dispose(); purchaseTransactionBuilder_ = null; } onChanged(); return this; } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder getPurchaseTransactionBuilder() { bitField0_ |= 0x00000020; onChanged(); return getPurchaseTransactionFieldBuilder().getBuilder(); } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder getPurchaseTransactionOrBuilder() { if (purchaseTransactionBuilder_ != null) { return purchaseTransactionBuilder_.getMessageOrBuilder(); } else { return purchaseTransaction_ == null ? com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.getDefaultInstance() : purchaseTransaction_; } } /** * * *
     * Optional. A transaction represents the entire purchase transaction.
     * Required for `purchase-complete` events. Optional for `checkout-start`
     * events. Other event types should not set this field.
     * 
* * * .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder> getPurchaseTransactionFieldBuilder() { if (purchaseTransactionBuilder_ == null) { purchaseTransactionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction, com.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.Builder, com.google.cloud.recommendationengine.v1beta1.PurchaseTransactionOrBuilder>( getPurchaseTransaction(), getParentForChildren(), isClean()); purchaseTransaction_ = null; } return purchaseTransactionBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.ProductEventDetail) } // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.ProductEventDetail) private static final com.google.cloud.recommendationengine.v1beta1.ProductEventDetail DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.ProductEventDetail(); } public static com.google.cloud.recommendationengine.v1beta1.ProductEventDetail getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public ProductEventDetail parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.ProductEventDetail getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy