Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCustomAttribute

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

A custom attribute that is not explicitly modeled in Product.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2betaCustomAttribute

Returns a new instance of GoogleCloudRetailV2betaCustomAttribute.



1860
1861
1862
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1860

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

Instance Attribute Details

#indexableBoolean Also known as: indexable?

This field will only be used when AttributesConfig.attribute_config_level of the Catalog is 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest. filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details. Corresponds to the JSON property indexable

Returns:

  • (Boolean)


1832
1833
1834
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1832

def indexable
  @indexable
end

#numbersArray<Float>

The numerical values of this custom attribute. For example, [2.3, 15.4] when the key is "lengths_cm". Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property numbers

Returns:

  • (Array<Float>)


1840
1841
1842
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1840

def numbers
  @numbers
end

#searchableBoolean Also known as: searchable?

This field will only be used when AttributesConfig.attribute_config_level of the Catalog is 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned. Corresponds to the JSON property searchable

Returns:

  • (Boolean)


1849
1850
1851
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1849

def searchable
  @searchable
end

#textArray<String>

The textual values of this custom attribute. For example, ["yellow", "green"] when the key is "color". Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property text

Returns:

  • (Array<String>)


1858
1859
1860
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1858

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1865
1866
1867
1868
1869
1870
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1865

def update!(**args)
  @indexable = args[:indexable] if args.key?(:indexable)
  @numbers = args[:numbers] if args.key?(:numbers)
  @searchable = args[:searchable] if args.key?(:searchable)
  @text = args[:text] if args.key?(:text)
end