Class: Google::Apis::RetailV2::GoogleCloudRetailV2CatalogAttribute

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/retail_v2/classes.rb,
lib/google/apis/retail_v2/representations.rb,
lib/google/apis/retail_v2/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) ⇒ GoogleCloudRetailV2CatalogAttribute

Returns a new instance of GoogleCloudRetailV2CatalogAttribute.



708
709
710
# File 'lib/google/apis/retail_v2/classes.rb', line 708

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

Returns:

  • (String)


660
661
662
# File 'lib/google/apis/retail_v2/classes.rb', line 660

def dynamic_facetable_option
  @dynamic_facetable_option
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, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is False for pre- loaded CatalogAttributes. Only pre-loaded CatalogAttributes that are neither in use by products nor predefined can be deleted. CatalogAttributes that are either in use by products or are predefined 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)


674
675
676
# File 'lib/google/apis/retail_v2/classes.rb', line 674

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

Returns:

  • (String)


682
683
684
# File 'lib/google/apis/retail_v2/classes.rb', line 682

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

Returns:

  • (String)


691
692
693
# File 'lib/google/apis/retail_v2/classes.rb', line 691

def key
  @key
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. Corresponds to the JSON property searchableOption

Returns:

  • (String)


700
701
702
# File 'lib/google/apis/retail_v2/classes.rb', line 700

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)


706
707
708
# File 'lib/google/apis/retail_v2/classes.rb', line 706

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



713
714
715
716
717
718
719
720
# File 'lib/google/apis/retail_v2/classes.rb', line 713

def update!(**args)
  @dynamic_facetable_option = args[:dynamic_facetable_option] if args.key?(:dynamic_facetable_option)
  @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)
  @searchable_option = args[:searchable_option] if args.key?(:searchable_option)
  @type = args[:type] if args.key?(:type)
end