Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalogAttribute

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

Overview

Catalog level attribute config for an attribute. For example, if customers want to enable/disable facet for a specific attribute.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2alphaCatalogAttribute

Returns a new instance of GoogleCloudRetailV2alphaCatalogAttribute.



2016
2017
2018
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2016

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

Instance Attribute Details

#dynamic_facetable_optionString

If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if CatalogAttribute.indexable_option is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. Must be specified, otherwise throws INVALID_FORMAT error. Corresponds to the JSON property dynamicFacetableOption

Returns:

  • (String)


1934
1935
1936
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1934

def dynamic_facetable_option
  @dynamic_facetable_option
end

#exact_searchable_optionString

If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. This property only applies to textual custom attributes and requires indexable set to enabled to enable exact-searchable. If unset, the server behavior defaults to EXACT_SEARCHABLE_DISABLED. Corresponds to the JSON property exactSearchableOption

Returns:

  • (String)


1942
1943
1944
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1942

def exact_searchable_option
  @exact_searchable_option
end

#facet_configGoogle::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCatalogAttributeFacetConfig

Possible options for the facet that corresponds to the current attribute config. Corresponds to the JSON property facetConfig



1948
1949
1950
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1948

def facet_config
  @facet_config
end

#in_useBoolean Also known as: in_use?

Output only. Indicates whether this attribute has been used by any products. True if at least one Product is using this attribute in Product.attributes. Otherwise, this field is False. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute or CatalogService.UpdateAttributesConfig APIs. This field is False for pre-loaded CatalogAttributes. Only pre-loaded catalog attributes that are neither in use by products nor predefined can be deleted. Catalog attributes that are either in use by products or are predefined attributes cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update. Corresponds to the JSON property inUse

Returns:

  • (Boolean)


1962
1963
1964
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1962

def in_use
  @in_use
end

#indexable_optionString

When AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values are indexed so that it can be filtered, faceted, or boosted in SearchService.Search. Must be specified when AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. Corresponds to the JSON property indexableOption

Returns:

  • (String)


1972
1973
1974
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1972

def indexable_option
  @indexable_option
end

#keyString

Required. Attribute name. For example: color, brands, attributes. custom_attribute, such as attributes.xyz. To be indexable, the attribute name can contain only alpha-numeric characters and underscores. For example, an attribute named attributes.abc_xyz can be indexed, but an attribute named attributes.abc-xyz cannot be indexed. If the attribute key starts with attributes., then the attribute is a custom attribute. Attributes such as brands, patterns, and title are built-in and called system attributes. Corresponds to the JSON property key

Returns:

  • (String)


1983
1984
1985
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1983

def key
  @key
end

#recommendations_filtering_optionString

When AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if RECOMMENDATIONS_FILTERING_ENABLED, attribute values are filterable for recommendations. This option works for categorical features only, does not work for numerical features, inventory filtering. Corresponds to the JSON property recommendationsFilteringOption

Returns:

  • (String)


1991
1992
1993
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1991

def recommendations_filtering_option
  @recommendations_filtering_option
end

#retrievable_optionString

If RETRIEVABLE_ENABLED, attribute values are retrievable in the search results. If unset, the server behavior defaults to RETRIEVABLE_DISABLED. Corresponds to the JSON property retrievableOption

Returns:

  • (String)


1997
1998
1999
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1997

def retrievable_option
  @retrievable_option
end

#searchable_optionString

When AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values are searchable by text queries in SearchService.Search. If SEARCHABLE_ENABLED but attribute type is numerical, attribute values will not be searchable by text queries in SearchService. Search, as there are no text values associated to numerical attributes. Must be specified, when AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. Corresponds to the JSON property searchableOption

Returns:

  • (String)


2008
2009
2010
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2008

def searchable_option
  @searchable_option
end

#typeString

Output only. The type of this attribute. This is derived from the attribute in Product.attributes. Corresponds to the JSON property type

Returns:

  • (String)


2014
2015
2016
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2014

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2021

def update!(**args)
  @dynamic_facetable_option = args[:dynamic_facetable_option] if args.key?(:dynamic_facetable_option)
  @exact_searchable_option = args[:exact_searchable_option] if args.key?(:exact_searchable_option)
  @facet_config = args[:facet_config] if args.key?(:facet_config)
  @in_use = args[:in_use] if args.key?(:in_use)
  @indexable_option = args[:indexable_option] if args.key?(:indexable_option)
  @key = args[:key] if args.key?(:key)
  @recommendations_filtering_option = args[:recommendations_filtering_option] if args.key?(:recommendations_filtering_option)
  @retrievable_option = args[:retrievable_option] if args.key?(:retrievable_option)
  @searchable_option = args[:searchable_option] if args.key?(:searchable_option)
  @type = args[:type] if args.key?(:type)
end