Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCustomAttribute
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCustomAttribute
- 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
A custom attribute that is not explicitly modeled in Product.
Instance Attribute Summary collapse
-
#indexable ⇒ Boolean
(also: #indexable?)
If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search.
-
#numbers ⇒ Array<Float>
The numerical values of this custom attribute.
-
#searchable ⇒ Boolean
(also: #searchable?)
If true, custom attribute values are searchable by text queries in SearchService.Search.
-
#text ⇒ Array<String>
The textual values of this custom attribute.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2alphaCustomAttribute
constructor
A new instance of GoogleCloudRetailV2alphaCustomAttribute.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2alphaCustomAttribute
Returns a new instance of GoogleCloudRetailV2alphaCustomAttribute.
1150 1151 1152 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1150 def initialize(**args) update!(**args) end |
Instance Attribute Details
#indexable ⇒ Boolean Also known as: indexable?
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
1121 1122 1123 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1121 def indexable @indexable end |
#numbers ⇒ Array<Float>
The numerical values of this custom attribute. For example, [2.3, 15.4] when
the key is "lengths_cm". At most 400 values are 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 numbers
1130 1131 1132 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1130 def numbers @numbers end |
#searchable ⇒ Boolean Also known as: searchable?
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
1137 1138 1139 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1137 def searchable @searchable end |
#text ⇒ Array<String>
The textual values of this custom attribute. For example, ["yellow", "green"]
when the key is "color". At most 400 values are allowed. Empty values are not
allowed. Each value must be a UTF-8 encoded string with a length limit of 256
characters. 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
1148 1149 1150 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1148 def text @text end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1155 1156 1157 1158 1159 1160 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 1155 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 |