Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaSearchResponseSearchResult

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

Overview

Represents the search results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2betaSearchResponseSearchResult

Returns a new instance of GoogleCloudRetailV2betaSearchResponseSearchResult.



7710
7711
7712
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7710

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

Instance Attribute Details

#idString

Product.id of the searched Product. Corresponds to the JSON property id

Returns:

  • (String)


7662
7663
7664
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7662

def id
  @id
end

#matching_variant_countFixnum

The count of matched variant Products. Corresponds to the JSON property matchingVariantCount

Returns:

  • (Fixnum)


7667
7668
7669
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7667

def matching_variant_count
  @matching_variant_count
end

#matching_variant_fieldsHash<String,String>

If a variant Product matches the search query, this map indicates which Product fields are matched. The key is the Product.name, the value is a field mask of the matched Product fields. If matched attributes cannot be determined, this map will be empty. For example, a key "sku1" with field mask "products. color_info" indicates there is a match between "sku1" ColorInfo and the query. Corresponds to the JSON property matchingVariantFields

Returns:

  • (Hash<String,String>)


7676
7677
7678
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7676

def matching_variant_fields
  @matching_variant_fields
end

#personal_labelsArray<String>

Specifies previous events related to this product for this user based on UserEvent with same SearchRequest.visitor_id or UserInfo.user_id. This is set only when SearchRequest.PersonalizationSpec.mode is SearchRequest. PersonalizationSpec.Mode.AUTO. Possible values: * purchased: Indicates that this product has been purchased before. Corresponds to the JSON property personalLabels

Returns:

  • (Array<String>)


7685
7686
7687
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7685

def personal_labels
  @personal_labels
end

#productGoogle::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct

Product captures all metadata information of items to be recommended or searched. Corresponds to the JSON property product



7691
7692
7693
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7691

def product
  @product
end

#variant_rollup_valuesHash<String,Object>

The rollup matching variant Product attributes. The key is one of the SearchRequest.variant_rollup_keys. The values are the merged and de-duplicated Product attributes. Notice that the rollup values are respect filter. For example, when filtering by "colorFamilies:ANY(\"red\")" and rollup " colorFamilies", only "red" is returned. For textual and numerical attributes, the rollup values is a list of string or double values with type google. protobuf.ListValue. For example, if there are two variants with colors "red" and "blue", the rollup values are key: "colorFamilies" value list_value values string_value: "red" values string_value: "blue" For FulfillmentInfo, the rollup values is a double value with type google.protobuf. Value. For example, key: "pickupInStore.store1" value ` number_value: 10 means a there are 10 variants in this product are available in the store " store1". Corresponds to the JSON propertyvariantRollupValues`

Returns:

  • (Hash<String,Object>)


7708
7709
7710
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7708

def variant_rollup_values
  @variant_rollup_values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7715
7716
7717
7718
7719
7720
7721
7722
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7715

def update!(**args)
  @id = args[:id] if args.key?(:id)
  @matching_variant_count = args[:matching_variant_count] if args.key?(:matching_variant_count)
  @matching_variant_fields = args[:matching_variant_fields] if args.key?(:matching_variant_fields)
  @personal_labels = args[:personal_labels] if args.key?(:personal_labels)
  @product = args[:product] if args.key?(:product)
  @variant_rollup_values = args[:variant_rollup_values] if args.key?(:variant_rollup_values)
end