Class CustomAttribute (1.6.0)

CustomAttribute(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A custom attribute that is not explicitly modeled in Product.

Attributes

NameDescription
text Sequence[str]
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.
numbers Sequence[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.
searchable bool
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. This field is a member of `oneof`_ ``_searchable``.
indexable bool
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. This field is a member of `oneof`_ ``_indexable``.

Inheritance

builtins.object > proto.message.Message > CustomAttribute