algolia 3.0.0.alpha.11 → 3.0.0.alpha.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +1 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile.lock +5 -5
  5. data/lib/algolia/api/abtesting_client.rb +8 -4
  6. data/lib/algolia/api/analytics_client.rb +146 -282
  7. data/lib/algolia/api/ingestion_client.rb +4 -4
  8. data/lib/algolia/api/insights_client.rb +7 -7
  9. data/lib/algolia/api/recommend_client.rb +12 -12
  10. data/lib/algolia/api/search_client.rb +242 -242
  11. data/lib/algolia/models/abtesting/ab_test_response.rb +1 -1
  12. data/lib/algolia/models/analytics/search_no_result_event.rb +1 -1
  13. data/lib/algolia/models/analytics/top_search.rb +1 -1
  14. data/lib/algolia/models/analytics/top_search_with_analytics.rb +1 -1
  15. data/lib/algolia/models/ingestion/action_type.rb +2 -1
  16. data/lib/algolia/models/ingestion/mapping_field_directive.rb +214 -0
  17. data/lib/algolia/models/ingestion/mapping_input.rb +213 -0
  18. data/lib/algolia/models/ingestion/mapping_kit_action.rb +235 -0
  19. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +13 -4
  20. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +13 -4
  21. data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +223 -0
  22. data/lib/algolia/models/ingestion/source_input.rb +1 -0
  23. data/lib/algolia/models/ingestion/source_type.rb +2 -1
  24. data/lib/algolia/models/ingestion/source_update_input.rb +1 -0
  25. data/lib/algolia/models/ingestion/streaming_trigger.rb +221 -0
  26. data/lib/algolia/models/ingestion/streaming_trigger_type.rb +32 -0
  27. data/lib/algolia/models/ingestion/streaming_utils_input.rb +199 -0
  28. data/lib/algolia/models/ingestion/task_create_trigger.rb +1 -0
  29. data/lib/algolia/models/ingestion/task_input.rb +2 -1
  30. data/lib/algolia/models/ingestion/trigger.rb +1 -0
  31. data/lib/algolia/models/ingestion/trigger_type.rb +2 -1
  32. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +6 -6
  33. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +6 -6
  34. data/lib/algolia/models/insights/clicked_filters.rb +6 -6
  35. data/lib/algolia/models/insights/clicked_object_ids.rb +6 -6
  36. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -7
  37. data/lib/algolia/models/insights/converted_filters.rb +6 -6
  38. data/lib/algolia/models/insights/converted_object_ids.rb +6 -6
  39. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +6 -6
  40. data/lib/algolia/models/insights/discount.rb +1 -1
  41. data/lib/algolia/models/insights/insights_events.rb +1 -1
  42. data/lib/algolia/models/insights/object_data.rb +1 -1
  43. data/lib/algolia/models/insights/object_data_after_search.rb +1 -1
  44. data/lib/algolia/models/insights/price.rb +1 -1
  45. data/lib/algolia/models/insights/purchased_object_ids.rb +6 -6
  46. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +6 -6
  47. data/lib/algolia/models/insights/viewed_filters.rb +6 -6
  48. data/lib/algolia/models/insights/viewed_object_ids.rb +6 -6
  49. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  50. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +3 -0
  51. data/lib/algolia/models/recommend/around_radius.rb +1 -1
  52. data/lib/algolia/models/recommend/automatic_facet_filter.rb +4 -4
  53. data/lib/algolia/models/recommend/automatic_facet_filters.rb +1 -1
  54. data/lib/algolia/models/recommend/base_recommend_request.rb +1 -1
  55. data/lib/algolia/models/recommend/base_recommendations_query.rb +1 -1
  56. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +1 -1
  57. data/lib/algolia/models/recommend/base_search_params.rb +58 -38
  58. data/lib/algolia/models/recommend/base_search_params_without_query.rb +57 -37
  59. data/lib/algolia/models/recommend/base_search_response.rb +20 -6
  60. data/lib/algolia/models/recommend/condition.rb +32 -7
  61. data/lib/algolia/models/recommend/consequence.rb +33 -5
  62. data/lib/algolia/models/recommend/consequence_hide.rb +2 -2
  63. data/lib/algolia/models/recommend/consequence_params.rb +101 -79
  64. data/lib/algolia/models/recommend/consequence_query.rb +1 -1
  65. data/lib/algolia/models/recommend/consequence_query_object.rb +2 -2
  66. data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
  67. data/lib/algolia/models/recommend/distinct.rb +1 -1
  68. data/lib/algolia/models/recommend/edit.rb +1 -1
  69. data/lib/algolia/models/recommend/facet_filters.rb +1 -1
  70. data/lib/algolia/models/recommend/facet_ordering.rb +2 -2
  71. data/lib/algolia/models/recommend/facets.rb +2 -2
  72. data/lib/algolia/models/recommend/highlight_result_option.rb +3 -3
  73. data/lib/algolia/models/recommend/ignore_plurals.rb +1 -1
  74. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +46 -44
  75. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  76. data/lib/algolia/models/recommend/optional_filters.rb +1 -1
  77. data/lib/algolia/models/recommend/params.rb +1 -1
  78. data/lib/algolia/models/recommend/promote_object_id.rb +2 -2
  79. data/lib/algolia/models/recommend/promote_object_ids.rb +16 -2
  80. data/lib/algolia/models/recommend/ranking_info.rb +120 -7
  81. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  82. data/lib/algolia/models/recommend/recommend_hit.rb +3 -3
  83. data/lib/algolia/models/recommend/recommendations_hits.rb +1 -1
  84. data/lib/algolia/models/recommend/recommendations_query.rb +2 -2
  85. data/lib/algolia/models/recommend/recommendations_results.rb +21 -7
  86. data/lib/algolia/models/recommend/recommended_for_you_query.rb +1 -1
  87. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +102 -80
  88. data/lib/algolia/models/recommend/remove_stop_words.rb +1 -1
  89. data/lib/algolia/models/recommend/rendering_content.rb +1 -1
  90. data/lib/algolia/models/recommend/search_params_object.rb +102 -80
  91. data/lib/algolia/models/recommend/search_params_query.rb +1 -1
  92. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +2 -2
  93. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +17 -3
  94. data/lib/algolia/models/recommend/semantic_search.rb +2 -2
  95. data/lib/algolia/models/recommend/snippet_result_option.rb +2 -2
  96. data/lib/algolia/models/recommend/tag_filters.rb +1 -1
  97. data/lib/algolia/models/recommend/trending_facets_query.rb +1 -1
  98. data/lib/algolia/models/recommend/trending_items_query.rb +1 -1
  99. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  100. data/lib/algolia/models/recommend/value.rb +1 -1
  101. data/lib/algolia/models/search/add_api_key_response.rb +1 -1
  102. data/lib/algolia/models/search/api_key.rb +8 -8
  103. data/lib/algolia/models/search/around_precision.rb +1 -1
  104. data/lib/algolia/models/search/around_precision_from_value_inner.rb +3 -0
  105. data/lib/algolia/models/search/around_radius.rb +1 -1
  106. data/lib/algolia/models/search/automatic_facet_filter.rb +4 -4
  107. data/lib/algolia/models/search/automatic_facet_filters.rb +1 -1
  108. data/lib/algolia/models/search/base_index_settings.rb +44 -18
  109. data/lib/algolia/models/search/base_search_params.rb +58 -38
  110. data/lib/algolia/models/search/base_search_params_without_query.rb +57 -37
  111. data/lib/algolia/models/search/base_search_response.rb +20 -6
  112. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +3 -3
  113. data/lib/algolia/models/search/batch_response.rb +2 -2
  114. data/lib/algolia/models/search/browse_params_object.rb +103 -81
  115. data/lib/algolia/models/search/browse_response.rb +23 -8
  116. data/lib/algolia/models/search/built_in_operation.rb +2 -2
  117. data/lib/algolia/models/search/condition.rb +32 -7
  118. data/lib/algolia/models/search/consequence.rb +33 -5
  119. data/lib/algolia/models/search/consequence_hide.rb +2 -2
  120. data/lib/algolia/models/search/consequence_params.rb +101 -79
  121. data/lib/algolia/models/search/consequence_query.rb +1 -1
  122. data/lib/algolia/models/search/consequence_query_object.rb +2 -2
  123. data/lib/algolia/models/search/created_at_response.rb +1 -1
  124. data/lib/algolia/models/search/cursor.rb +1 -1
  125. data/lib/algolia/models/search/delete_by_params.rb +4 -4
  126. data/lib/algolia/models/search/deleted_at_response.rb +1 -1
  127. data/lib/algolia/models/search/dictionary_entry.rb +5 -5
  128. data/lib/algolia/models/search/dictionary_language.rb +2 -2
  129. data/lib/algolia/models/search/dictionary_settings_params.rb +1 -1
  130. data/lib/algolia/models/search/distinct.rb +1 -1
  131. data/lib/algolia/models/search/edit.rb +1 -1
  132. data/lib/algolia/models/search/facet_filters.rb +1 -1
  133. data/lib/algolia/models/search/facet_hits.rb +2 -2
  134. data/lib/algolia/models/search/facet_ordering.rb +2 -2
  135. data/lib/algolia/models/search/facets.rb +2 -2
  136. data/lib/algolia/models/search/get_api_key_response.rb +8 -8
  137. data/lib/algolia/models/search/get_objects_request.rb +3 -3
  138. data/lib/algolia/models/search/get_objects_response.rb +1 -1
  139. data/lib/algolia/models/search/has_pending_mappings_response.rb +1 -1
  140. data/lib/algolia/models/search/highlight_result_option.rb +3 -3
  141. data/lib/algolia/models/search/hit.rb +4 -4
  142. data/lib/algolia/models/search/ignore_plurals.rb +1 -1
  143. data/lib/algolia/models/search/index_settings.rb +89 -61
  144. data/lib/algolia/models/search/index_settings_as_search_params.rb +46 -44
  145. data/lib/algolia/models/search/log.rb +39 -11
  146. data/lib/algolia/models/search/log_query.rb +1 -1
  147. data/lib/algolia/models/search/multiple_batch_response.rb +2 -2
  148. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  149. data/lib/algolia/models/search/operation_index_params.rb +2 -2
  150. data/lib/algolia/models/search/optional_filters.rb +1 -1
  151. data/lib/algolia/models/search/params.rb +1 -1
  152. data/lib/algolia/models/search/promote_object_id.rb +2 -2
  153. data/lib/algolia/models/search/promote_object_ids.rb +16 -2
  154. data/lib/algolia/models/search/ranking_info.rb +120 -7
  155. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  156. data/lib/algolia/models/search/remove_stop_words.rb +1 -1
  157. data/lib/algolia/models/search/rendering_content.rb +1 -1
  158. data/lib/algolia/models/search/rule.rb +23 -5
  159. data/lib/algolia/models/search/save_object_response.rb +3 -3
  160. data/lib/algolia/models/search/save_synonym_response.rb +1 -1
  161. data/lib/algolia/models/search/search_dictionary_entries_params.rb +18 -4
  162. data/lib/algolia/models/search/search_dictionary_entries_response.rb +251 -0
  163. data/lib/algolia/models/search/search_for_facet_values_request.rb +1 -1
  164. data/lib/algolia/models/search/search_for_facet_values_response.rb +1 -0
  165. data/lib/algolia/models/search/search_for_facets.rb +103 -81
  166. data/lib/algolia/models/search/search_for_facets_options.rb +2 -2
  167. data/lib/algolia/models/search/search_for_hits.rb +103 -81
  168. data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
  169. data/lib/algolia/models/search/search_hits.rb +2 -1
  170. data/lib/algolia/models/search/search_params_object.rb +102 -80
  171. data/lib/algolia/models/search/search_params_query.rb +1 -1
  172. data/lib/algolia/models/search/search_response.rb +22 -7
  173. data/lib/algolia/models/search/search_rules_params.rb +8 -20
  174. data/lib/algolia/models/search/search_rules_response.rb +2 -2
  175. data/lib/algolia/models/search/search_synonyms_params.rb +16 -2
  176. data/lib/algolia/models/search/search_synonyms_response.rb +2 -2
  177. data/lib/algolia/models/search/search_user_ids_params.rb +15 -1
  178. data/lib/algolia/models/search/search_user_ids_response.rb +16 -2
  179. data/lib/algolia/models/search/secured_api_key_restrictions.rb +5 -5
  180. data/lib/algolia/models/search/semantic_search.rb +2 -2
  181. data/lib/algolia/models/search/snippet_result_option.rb +2 -2
  182. data/lib/algolia/models/search/tag_filters.rb +1 -1
  183. data/lib/algolia/models/search/time_range.rb +2 -2
  184. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  185. data/lib/algolia/models/search/updated_at_response.rb +1 -1
  186. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +2 -2
  187. data/lib/algolia/models/search/updated_rule_response.rb +2 -2
  188. data/lib/algolia/models/search/user_hit.rb +1 -1
  189. data/lib/algolia/models/search/user_id.rb +1 -1
  190. data/lib/algolia/models/search/value.rb +1 -1
  191. data/lib/algolia/version.rb +1 -1
  192. metadata +10 -2
@@ -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
+ # The trigger input for a task of type 'streaming'.
9
+ class StreamingTrigger
10
+ attr_accessor :type
11
+
12
+ class EnumAttributeValidator
13
+ attr_reader :datatype
14
+ attr_reader :allowable_values
15
+
16
+ def initialize(datatype, allowable_values)
17
+ @allowable_values = allowable_values.map do |value|
18
+ case datatype.to_s
19
+ when /Integer/i
20
+ value.to_i
21
+ when /Float/i
22
+ value.to_f
23
+ else
24
+ value
25
+ end
26
+ end
27
+ end
28
+
29
+ def valid?(value)
30
+ !value || allowable_values.include?(value)
31
+ end
32
+ end
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :type => :type
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.types_mapping
48
+ {
49
+ :type => :StreamingTriggerType
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ unless attributes.is_a?(Hash)
62
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::StreamingTrigger` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) do |(k, v), h|
67
+ unless self.class.attribute_map.key?(k.to_sym)
68
+ raise ArgumentError,
69
+ "`#{k}` is not a valid attribute in `Algolia::StreamingTrigger`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+
72
+ h[k.to_sym] = v
73
+ end
74
+
75
+ if attributes.key?(:type)
76
+ self.type = attributes[:type]
77
+ else
78
+ self.type = nil
79
+ end
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(other)
85
+ return true if equal?(other)
86
+
87
+ self.class == other.class &&
88
+ type == other.type
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
+ [type].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
@@ -0,0 +1,32 @@
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
+ class StreamingTriggerType
9
+ STREAMING = "streaming".freeze
10
+
11
+ def self.all_vars
12
+ @all_vars ||= [STREAMING].freeze
13
+ end
14
+
15
+ # Builds the enum from string
16
+ # @param [String] The enum value in the form of the string
17
+ # @return [String] The enum value
18
+ def self.build_from_hash(value)
19
+ new.build_from_hash(value)
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def build_from_hash(value)
26
+ return value if StreamingTriggerType.all_vars.include?(value)
27
+
28
+ raise "Invalid ENUM value #{value} for class #StreamingTriggerType"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,199 @@
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
+ # The input for a `streaming` task whose source is of type `ga4BigqueryExport` and for which extracted data is continuously streamed.
9
+ class StreamingUtilsInput
10
+ attr_accessor :mapping
11
+
12
+ # Attribute mapping from ruby-style variable name to JSON key.
13
+ def self.attribute_map
14
+ {
15
+ :mapping => :mapping
16
+ }
17
+ end
18
+
19
+ # Returns all the JSON keys this model knows about
20
+ def self.acceptable_attributes
21
+ attribute_map.values
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.types_mapping
26
+ {
27
+ :mapping => :MappingInput
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([])
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ unless attributes.is_a?(Hash)
40
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::StreamingUtilsInput` initialize method"
41
+ end
42
+
43
+ # check to see if the attribute exists and convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) do |(k, v), h|
45
+ unless self.class.attribute_map.key?(k.to_sym)
46
+ raise ArgumentError,
47
+ "`#{k}` is not a valid attribute in `Algolia::StreamingUtilsInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+
50
+ h[k.to_sym] = v
51
+ end
52
+
53
+ if attributes.key?(:mapping)
54
+ self.mapping = attributes[:mapping]
55
+ else
56
+ self.mapping = nil
57
+ end
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(other)
63
+ return true if equal?(other)
64
+
65
+ self.class == other.class &&
66
+ mapping == other.mapping
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(other)
72
+ self == other
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Integer] Hash code
77
+ def hash
78
+ [mapping].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def self.build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+
87
+ attributes = attributes.transform_keys(&:to_sym)
88
+ transformed_hash = {}
89
+ types_mapping.each_pair do |key, type|
90
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
91
+ transformed_hash[key.to_sym] = nil
92
+ elsif type =~ /\AArray<(.*)>/i
93
+ # check to ensure the input is an array given that the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[attribute_map[key]].is_a?(Array)
96
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
97
+ end
98
+ elsif !attributes[attribute_map[key]].nil?
99
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
100
+ end
101
+ end
102
+ new(transformed_hash)
103
+ end
104
+
105
+ # Deserializes the data based on type
106
+ # @param string type Data type
107
+ # @param string value Value to be deserialized
108
+ # @return [Object] Deserialized data
109
+ def self._deserialize(type, value)
110
+ case type.to_sym
111
+ when :Time
112
+ Time.parse(value)
113
+ when :Date
114
+ Date.parse(value)
115
+ when :String
116
+ value.to_s
117
+ when :Integer
118
+ value.to_i
119
+ when :Float
120
+ value.to_f
121
+ when :Boolean
122
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
+ true
124
+ else
125
+ false
126
+ end
127
+ when :Object
128
+ # generic object (usually a Hash), return directly
129
+ value
130
+ when /\AArray<(?<inner_type>.+)>\z/
131
+ inner_type = Regexp.last_match[:inner_type]
132
+ value.map { |v| _deserialize(inner_type, v) }
133
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
134
+ k_type = Regexp.last_match[:k_type]
135
+ v_type = Regexp.last_match[:v_type]
136
+ {}.tap do |hash|
137
+ value.each do |k, v|
138
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
139
+ end
140
+ end
141
+ else # model
142
+ # models (e.g. Pet) or oneOf
143
+ klass = Algolia::Ingestion.const_get(type)
144
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
145
+ end
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_hash (backward compatibility)
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_body
157
+ to_hash
158
+ end
159
+
160
+ def to_json(*_args)
161
+ to_hash.to_json
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = send(attr)
170
+ if value.nil?
171
+ is_nullable = self.class.openapi_nullable.include?(attr)
172
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
173
+ end
174
+
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map { |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
@@ -12,6 +12,7 @@ module Algolia
12
12
  [
13
13
  :OnDemandTriggerInput,
14
14
  :ScheduleTriggerInput,
15
+ :StreamingTrigger,
15
16
  :SubscriptionTrigger
16
17
  ]
17
18
  end
@@ -11,7 +11,8 @@ module Algolia
11
11
  def openapi_one_of
12
12
  [
13
13
  :OnDemandDateUtilsInput,
14
- :ScheduleDateUtilsInput
14
+ :ScheduleDateUtilsInput,
15
+ :StreamingUtilsInput
15
16
  ]
16
17
  end
17
18
 
@@ -12,6 +12,7 @@ module Algolia
12
12
  [
13
13
  :OnDemandTrigger,
14
14
  :ScheduleTrigger,
15
+ :StreamingTrigger,
15
16
  :SubscriptionTrigger
16
17
  ]
17
18
  end
@@ -9,9 +9,10 @@ module Algolia
9
9
  ON_DEMAND = "onDemand".freeze
10
10
  SCHEDULE = "schedule".freeze
11
11
  SUBSCRIPTION = "subscription".freeze
12
+ STREAMING = "streaming".freeze
12
13
 
13
14
  def self.all_vars
14
- @all_vars ||= [ON_DEMAND, SCHEDULE, SUBSCRIPTION].freeze
15
+ @all_vars ||= [ON_DEMAND, SCHEDULE, SUBSCRIPTION, STREAMING].freeze
15
16
  end
16
17
 
17
18
  # Builds the enum from string
@@ -7,23 +7,23 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don't use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
9
9
  class AddedToCartObjectIDs
10
- # The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
10
+ # Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
15
  attr_accessor :event_subtype
16
16
 
17
- # The name of an Algolia index.
17
+ # Index name to which the event's items belong.
18
18
  attr_accessor :index
19
19
 
20
- # The object IDs of the records that are part of the event.
20
+ # Object IDs of the records that are part of the event.
21
21
  attr_accessor :object_ids
22
22
 
23
- # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
23
+ # Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
24
24
  attr_accessor :user_token
25
25
 
26
- # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
26
+ # Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
27
27
  attr_accessor :authenticated_user_token
28
28
 
29
29
  # Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
@@ -32,7 +32,7 @@ module Algolia
32
32
  # Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
33
33
  attr_accessor :object_data
34
34
 
35
- # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
35
+ # Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
36
36
  attr_accessor :timestamp
37
37
 
38
38
  attr_accessor :value
@@ -7,26 +7,26 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users add items to their shopping cart after a previous Algolia request. If you're building your category pages with Algolia, you'll also use this event.
9
9
  class AddedToCartObjectIDsAfterSearch
10
- # The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
10
+ # Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
15
  attr_accessor :event_subtype
16
16
 
17
- # The name of an Algolia index.
17
+ # Index name to which the event's items belong.
18
18
  attr_accessor :index
19
19
 
20
20
  # Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
21
21
  attr_accessor :query_id
22
22
 
23
- # The object IDs of the records that are part of the event.
23
+ # Object IDs of the records that are part of the event.
24
24
  attr_accessor :object_ids
25
25
 
26
- # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
26
+ # Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
27
27
  attr_accessor :user_token
28
28
 
29
- # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
29
+ # Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
30
30
  attr_accessor :authenticated_user_token
31
31
 
32
32
  # Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
@@ -35,7 +35,7 @@ module Algolia
35
35
  # Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
36
36
  attr_accessor :object_data
37
37
 
38
- # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
38
+ # Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
39
39
  attr_accessor :timestamp
40
40
 
41
41
  attr_accessor :value
@@ -7,24 +7,24 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users click facet filters in your user interface.
9
9
  class ClickedFilters
10
- # The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
10
+ # Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
- # The name of an Algolia index.
15
+ # Index name to which the event's items belong.
16
16
  attr_accessor :index
17
17
 
18
- # Facet filters. Each facet filter string must be URL-encoded, such as, `discount:10%25`.
18
+ # Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
19
19
  attr_accessor :filters
20
20
 
21
- # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
21
+ # Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
22
22
  attr_accessor :user_token
23
23
 
24
- # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
24
+ # Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
25
25
  attr_accessor :authenticated_user_token
26
26
 
27
- # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
27
+ # Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
28
28
  attr_accessor :timestamp
29
29
 
30
30
  class EnumAttributeValidator
@@ -7,24 +7,24 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users click items unrelated to a previous Algolia request. For example, if you don't use Algolia to build your category pages, use this event. To track click events related to Algolia requests, use the \"Clicked object IDs after search\" event.
9
9
  class ClickedObjectIDs
10
- # The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
10
+ # Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
- # The name of an Algolia index.
15
+ # Index name to which the event's items belong.
16
16
  attr_accessor :index
17
17
 
18
- # The object IDs of the records that are part of the event.
18
+ # Object IDs of the records that are part of the event.
19
19
  attr_accessor :object_ids
20
20
 
21
- # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
21
+ # Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
22
22
  attr_accessor :user_token
23
23
 
24
- # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
24
+ # Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
25
25
  attr_accessor :authenticated_user_token
26
26
 
27
- # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
27
+ # Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
28
28
  attr_accessor :timestamp
29
29
 
30
30
  class EnumAttributeValidator