Skip to content

Commit d252625

Browse files
feat(specs): add CT Query predicate property (generated)
algolia/api-clients-automation#4654 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Morgan Leroi <[email protected]>
1 parent 1501756 commit d252625

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

lib/algolia/models/ingestion/source_commercetools.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class SourceCommercetools
2020
# Whether a fallback value is stored in the Algolia record if there's no inventory information about the product.
2121
attr_accessor :fallback_is_in_stock_value
2222

23+
# Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query).
24+
attr_accessor :product_query_predicate
25+
2326
attr_accessor :custom_fields
2427

2528
# Attribute mapping from ruby-style variable name to JSON key.
@@ -30,6 +33,7 @@ def self.attribute_map
3033
:url => :url,
3134
:project_key => :projectKey,
3235
:fallback_is_in_stock_value => :fallbackIsInStockValue,
36+
:product_query_predicate => :productQueryPredicate,
3337
:custom_fields => :customFields
3438
}
3539
end
@@ -49,6 +53,7 @@ def self.types_mapping
4953
:url => :"String",
5054
:project_key => :"String",
5155
:fallback_is_in_stock_value => :"Boolean",
56+
:product_query_predicate => :"String",
5257
:custom_fields => :"CommercetoolsCustomFields"
5358
}
5459
end
@@ -111,6 +116,10 @@ def initialize(attributes = {})
111116
self.fallback_is_in_stock_value = attributes[:fallback_is_in_stock_value]
112117
end
113118

119+
if attributes.key?(:product_query_predicate)
120+
self.product_query_predicate = attributes[:product_query_predicate]
121+
end
122+
114123
if attributes.key?(:custom_fields)
115124
self.custom_fields = attributes[:custom_fields]
116125
end
@@ -126,6 +135,7 @@ def ==(other)
126135
url == other.url &&
127136
project_key == other.project_key &&
128137
fallback_is_in_stock_value == other.fallback_is_in_stock_value &&
138+
product_query_predicate == other.product_query_predicate &&
129139
custom_fields == other.custom_fields
130140
end
131141

@@ -138,7 +148,7 @@ def eql?(other)
138148
# Calculates hash code according to all attributes.
139149
# @return [Integer] Hash code
140150
def hash
141-
[store_keys, locales, url, project_key, fallback_is_in_stock_value, custom_fields].hash
151+
[store_keys, locales, url, project_key, fallback_is_in_stock_value, product_query_predicate, custom_fields].hash
142152
end
143153

144154
# Builds the object from hash

lib/algolia/models/ingestion/source_update_commercetools.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class SourceUpdateCommercetools
1818
# Whether a fallback value is stored in the Algolia record if there's no inventory information about the product.
1919
attr_accessor :fallback_is_in_stock_value
2020

21+
# Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query).
22+
attr_accessor :product_query_predicate
23+
2124
attr_accessor :custom_fields
2225

2326
# Attribute mapping from ruby-style variable name to JSON key.
@@ -27,6 +30,7 @@ def self.attribute_map
2730
:locales => :locales,
2831
:url => :url,
2932
:fallback_is_in_stock_value => :fallbackIsInStockValue,
33+
:product_query_predicate => :productQueryPredicate,
3034
:custom_fields => :customFields
3135
}
3236
end
@@ -38,6 +42,7 @@ def self.types_mapping
3842
:locales => :"Array<String>",
3943
:url => :"String",
4044
:fallback_is_in_stock_value => :"Boolean",
45+
:product_query_predicate => :"String",
4146
:custom_fields => :"CommercetoolsCustomFields"
4247
}
4348
end
@@ -92,6 +97,10 @@ def initialize(attributes = {})
9297
self.fallback_is_in_stock_value = attributes[:fallback_is_in_stock_value]
9398
end
9499

100+
if attributes.key?(:product_query_predicate)
101+
self.product_query_predicate = attributes[:product_query_predicate]
102+
end
103+
95104
if attributes.key?(:custom_fields)
96105
self.custom_fields = attributes[:custom_fields]
97106
end
@@ -106,6 +115,7 @@ def ==(other)
106115
locales == other.locales &&
107116
url == other.url &&
108117
fallback_is_in_stock_value == other.fallback_is_in_stock_value &&
118+
product_query_predicate == other.product_query_predicate &&
109119
custom_fields == other.custom_fields
110120
end
111121

@@ -118,7 +128,7 @@ def eql?(other)
118128
# Calculates hash code according to all attributes.
119129
# @return [Integer] Hash code
120130
def hash
121-
[store_keys, locales, url, fallback_is_in_stock_value, custom_fields].hash
131+
[store_keys, locales, url, fallback_is_in_stock_value, product_query_predicate, custom_fields].hash
122132
end
123133

124134
# Builds the object from hash

0 commit comments

Comments
 (0)