algolia 3.0.0.alpha.17 → 3.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/Gemfile.lock +4 -4
  4. data/lib/algolia/api/abtesting_client.rb +20 -20
  5. data/lib/algolia/api/personalization_client.rb +12 -12
  6. data/lib/algolia/models/abtesting/ab_test.rb +41 -16
  7. data/lib/algolia/models/abtesting/ab_test_configuration.rb +217 -0
  8. data/lib/algolia/models/abtesting/ab_test_response.rb +2 -2
  9. data/lib/algolia/models/abtesting/ab_tests_variant.rb +21 -3
  10. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +21 -3
  11. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +1 -1
  12. data/lib/algolia/models/abtesting/custom_search_params.rb +1 -1
  13. data/lib/algolia/models/abtesting/effect.rb +35 -0
  14. data/lib/algolia/models/abtesting/empty_search.rb +198 -0
  15. data/lib/algolia/models/abtesting/list_ab_tests_response.rb +1 -1
  16. data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +247 -0
  17. data/lib/algolia/models/abtesting/outliers.rb +198 -0
  18. data/lib/algolia/models/abtesting/status.rb +35 -0
  19. data/lib/algolia/models/abtesting/variant.rb +31 -13
  20. data/lib/algolia/models/ingestion/destination_index_name.rb +1 -1
  21. data/lib/algolia/models/ingestion/shopify_input.rb +212 -0
  22. data/lib/algolia/models/ingestion/shopify_market.rb +227 -0
  23. data/lib/algolia/models/ingestion/shopify_metafield.rb +221 -0
  24. data/lib/algolia/models/ingestion/source_input.rb +2 -1
  25. data/lib/algolia/models/ingestion/source_shopify.rb +278 -0
  26. data/lib/algolia/models/ingestion/source_shopify_base.rb +199 -0
  27. data/lib/algolia/models/ingestion/source_update_input.rb +2 -1
  28. data/lib/algolia/models/ingestion/source_update_shopify.rb +258 -0
  29. data/lib/algolia/models/ingestion/task_input.rb +1 -0
  30. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
  31. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  32. data/lib/algolia/models/insights/clicked_filters.rb +1 -1
  33. data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
  34. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  35. data/lib/algolia/models/insights/converted_filters.rb +1 -1
  36. data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
  37. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  38. data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
  39. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +1 -1
  40. data/lib/algolia/models/insights/viewed_filters.rb +1 -1
  41. data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
  42. data/lib/algolia/models/personalization/delete_user_profile_response.rb +2 -2
  43. data/lib/algolia/models/personalization/event_scoring.rb +25 -4
  44. data/lib/algolia/models/personalization/event_type.rb +34 -0
  45. data/lib/algolia/models/personalization/facet_scoring.rb +2 -2
  46. data/lib/algolia/models/personalization/get_user_token_response.rb +3 -3
  47. data/lib/algolia/models/personalization/personalization_strategy_params.rb +21 -3
  48. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +1 -1
  49. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +1 -1
  50. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +1 -1
  51. data/lib/algolia/models/query-suggestions/source_index.rb +1 -1
  52. data/lib/algolia/models/recommend/base_recommend_request.rb +1 -1
  53. data/lib/algolia/models/recommend/base_search_params.rb +3 -3
  54. data/lib/algolia/models/recommend/base_search_params_without_query.rb +3 -3
  55. data/lib/algolia/models/recommend/bought_together_query.rb +1 -1
  56. data/lib/algolia/models/recommend/fallback_params.rb +9 -9
  57. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +6 -6
  58. data/lib/algolia/models/recommend/looking_similar_query.rb +1 -1
  59. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  60. data/lib/algolia/models/recommend/recommended_for_you_query.rb +1 -1
  61. data/lib/algolia/models/recommend/related_query.rb +1 -1
  62. data/lib/algolia/models/recommend/search_params.rb +9 -9
  63. data/lib/algolia/models/recommend/search_params_object.rb +10 -9
  64. data/lib/algolia/models/recommend/trending_facets_query.rb +1 -1
  65. data/lib/algolia/models/recommend/trending_items_query.rb +1 -1
  66. data/lib/algolia/models/search/base_index_settings.rb +9 -9
  67. data/lib/algolia/models/search/base_search_params.rb +3 -3
  68. data/lib/algolia/models/search/base_search_params_without_query.rb +3 -3
  69. data/lib/algolia/models/search/browse_params_object.rb +9 -9
  70. data/lib/algolia/models/search/consequence_params.rb +9 -9
  71. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  72. data/lib/algolia/models/search/index_settings.rb +15 -15
  73. data/lib/algolia/models/search/index_settings_as_search_params.rb +6 -6
  74. data/lib/algolia/models/search/multiple_batch_request.rb +1 -1
  75. data/lib/algolia/models/search/operation_index_params.rb +1 -1
  76. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  77. data/lib/algolia/models/search/search_for_facets.rb +10 -10
  78. data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
  79. data/lib/algolia/models/search/search_for_hits.rb +10 -10
  80. data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
  81. data/lib/algolia/models/search/search_params_object.rb +10 -9
  82. data/lib/algolia/version.rb +1 -1
  83. metadata +15 -2
@@ -0,0 +1,227 @@
1
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ require 'date'
4
+ require 'time'
5
+
6
+ module Algolia
7
+ module Ingestion
8
+ # Represents a market in Shopify.
9
+ class ShopifyMarket
10
+ attr_accessor :countries
11
+
12
+ attr_accessor :currencies
13
+
14
+ attr_accessor :locales
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :countries => :countries,
20
+ :currencies => :currencies,
21
+ :locales => :locales
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.types_mapping
32
+ {
33
+ :countries => :'Array<String>',
34
+ :currencies => :'Array<String>',
35
+ :locales => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ unless attributes.is_a?(Hash)
48
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::ShopifyMarket` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) do |(k, v), h|
53
+ unless self.class.attribute_map.key?(k.to_sym)
54
+ raise ArgumentError,
55
+ "`#{k}` is not a valid attribute in `Algolia::ShopifyMarket`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+
58
+ h[k.to_sym] = v
59
+ end
60
+
61
+ if attributes.key?(:countries)
62
+ if (value = attributes[:countries]).is_a?(Array)
63
+ self.countries = value
64
+ end
65
+ else
66
+ self.countries = nil
67
+ end
68
+
69
+ if attributes.key?(:currencies)
70
+ if (value = attributes[:currencies]).is_a?(Array)
71
+ self.currencies = value
72
+ end
73
+ else
74
+ self.currencies = nil
75
+ end
76
+
77
+ if attributes.key?(:locales)
78
+ if (value = attributes[:locales]).is_a?(Array)
79
+ self.locales = value
80
+ end
81
+ else
82
+ self.locales = nil
83
+ end
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(other)
89
+ return true if equal?(other)
90
+
91
+ self.class == other.class &&
92
+ countries == other.countries &&
93
+ currencies == other.currencies &&
94
+ locales == other.locales
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(other)
100
+ self == other
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [countries, currencies, locales].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+
115
+ attributes = attributes.transform_keys(&:to_sym)
116
+ transformed_hash = {}
117
+ types_mapping.each_pair do |key, type|
118
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
119
+ transformed_hash[key.to_sym] = nil
120
+ elsif type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[attribute_map[key]].is_a?(Array)
124
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
125
+ end
126
+ elsif !attributes[attribute_map[key]].nil?
127
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
128
+ end
129
+ end
130
+ new(transformed_hash)
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def self._deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = Algolia::Ingestion.const_get(type)
172
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ def to_json(*_args)
189
+ to_hash.to_json
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+ end
226
+ end
227
+ end
@@ -0,0 +1,221 @@
1
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ require 'date'
4
+ require 'time'
5
+
6
+ module Algolia
7
+ module Ingestion
8
+ # Represents a metafield in Shopify.
9
+ class ShopifyMetafield
10
+ attr_accessor :namespace
11
+
12
+ attr_accessor :key
13
+
14
+ attr_accessor :value
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :namespace => :namespace,
20
+ :key => :key,
21
+ :value => :value
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.types_mapping
32
+ {
33
+ :namespace => :String,
34
+ :key => :String,
35
+ :value => :String
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ unless attributes.is_a?(Hash)
48
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::ShopifyMetafield` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) do |(k, v), h|
53
+ unless self.class.attribute_map.key?(k.to_sym)
54
+ raise ArgumentError,
55
+ "`#{k}` is not a valid attribute in `Algolia::ShopifyMetafield`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+
58
+ h[k.to_sym] = v
59
+ end
60
+
61
+ if attributes.key?(:namespace)
62
+ self.namespace = attributes[:namespace]
63
+ else
64
+ self.namespace = nil
65
+ end
66
+
67
+ if attributes.key?(:key)
68
+ self.key = attributes[:key]
69
+ else
70
+ self.key = nil
71
+ end
72
+
73
+ if attributes.key?(:value)
74
+ self.value = attributes[:value]
75
+ else
76
+ self.value = nil
77
+ end
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(other)
83
+ return true if equal?(other)
84
+
85
+ self.class == other.class &&
86
+ namespace == other.namespace &&
87
+ key == other.key &&
88
+ value == other.value
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(other)
94
+ self == other
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [namespace, key, value].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+
109
+ attributes = attributes.transform_keys(&:to_sym)
110
+ transformed_hash = {}
111
+ types_mapping.each_pair do |key, type|
112
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
113
+ transformed_hash[key.to_sym] = nil
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[attribute_map[key]].is_a?(Array)
118
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
119
+ end
120
+ elsif !attributes[attribute_map[key]].nil?
121
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
122
+ end
123
+ end
124
+ new(transformed_hash)
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def self._deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = Algolia::Ingestion.const_get(type)
166
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ def to_json(*_args)
183
+ to_hash.to_json
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end
@@ -16,7 +16,8 @@ module Algolia
16
16
  :SourceCommercetools,
17
17
  :SourceDocker,
18
18
  :SourceGA4BigQueryExport,
19
- :SourceJSON
19
+ :SourceJSON,
20
+ :SourceShopify
20
21
  ]
21
22
  end
22
23