Class: Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1ProductEventDetail

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/recommendationengine_v1beta1/classes.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb

Overview

ProductEventDetail captures user event information specific to retail products.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1ProductEventDetail

Returns a new instance of GoogleCloudRecommendationengineV1beta1ProductEventDetail.



1408
1409
1410
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1408

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cart_idString

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. Corresponds to the JSON property cartId

Returns:

  • (String)


1360
1361
1362
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1360

def cart_id
  @cart_id
end

#list_idString

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. Corresponds to the JSON property listId

Returns:

  • (String)


1367
1368
1369
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1367

def list_id
  @list_id
end

#page_categoriesArray<Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy>

Required for category-page-view events. At least one of search_query or page_categories is required for search 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"]. Corresponds to the JSON property pageCategories



1377
1378
1379
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1377

def page_categories
  @page_categories
end

#product_detailsArray<Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1ProductDetail>

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. * search (highly encouraged) In a search event, this field represents the products returned to the end user on the current page (the end user may have not finished broswing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a new SEARCH event with different product_details is desired. The end user may have not finished broswing the whole page yet. This field is not allowed for the following event types: * category-page-view * home-page-view Corresponds to the JSON property productDetails



1394
1395
1396
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1394

def product_details
  @product_details
end

#purchase_transactionGoogle::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1PurchaseTransaction

A transaction represents the entire purchase transaction. Corresponds to the JSON property purchaseTransaction



1399
1400
1401
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1399

def purchase_transaction
  @purchase_transaction
end

#search_queryString

At least one of search_query or page_categories is 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. Corresponds to the JSON property searchQuery

Returns:

  • (String)


1406
1407
1408
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1406

def search_query
  @search_query
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1413
1414
1415
1416
1417
1418
1419
1420
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1413

def update!(**args)
  @cart_id = args[:cart_id] if args.key?(:cart_id)
  @list_id = args[:list_id] if args.key?(:list_id)
  @page_categories = args[:page_categories] if args.key?(:page_categories)
  @product_details = args[:product_details] if args.key?(:product_details)
  @purchase_transaction = args[:purchase_transaction] if args.key?(:purchase_transaction)
  @search_query = args[:search_query] if args.key?(:search_query)
end