algolia 3.0.0.alpha.12 → 3.0.0.alpha.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Gemfile.lock +4 -4
  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/source_ga4_big_query_export.rb +223 -0
  17. data/lib/algolia/models/ingestion/source_input.rb +1 -0
  18. data/lib/algolia/models/ingestion/source_type.rb +2 -1
  19. data/lib/algolia/models/ingestion/source_update_input.rb +1 -0
  20. data/lib/algolia/models/ingestion/streaming_trigger.rb +221 -0
  21. data/lib/algolia/models/ingestion/streaming_trigger_type.rb +32 -0
  22. data/lib/algolia/models/ingestion/streaming_utils_input.rb +199 -0
  23. data/lib/algolia/models/ingestion/task_create_trigger.rb +1 -0
  24. data/lib/algolia/models/ingestion/task_input.rb +2 -1
  25. data/lib/algolia/models/ingestion/trigger.rb +1 -0
  26. data/lib/algolia/models/ingestion/trigger_type.rb +2 -1
  27. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +6 -6
  28. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +6 -6
  29. data/lib/algolia/models/insights/clicked_filters.rb +6 -6
  30. data/lib/algolia/models/insights/clicked_object_ids.rb +6 -6
  31. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -7
  32. data/lib/algolia/models/insights/converted_filters.rb +6 -6
  33. data/lib/algolia/models/insights/converted_object_ids.rb +6 -6
  34. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +6 -6
  35. data/lib/algolia/models/insights/discount.rb +1 -1
  36. data/lib/algolia/models/insights/insights_events.rb +1 -1
  37. data/lib/algolia/models/insights/object_data.rb +1 -1
  38. data/lib/algolia/models/insights/object_data_after_search.rb +1 -1
  39. data/lib/algolia/models/insights/price.rb +1 -1
  40. data/lib/algolia/models/insights/purchased_object_ids.rb +6 -6
  41. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +6 -6
  42. data/lib/algolia/models/insights/viewed_filters.rb +6 -6
  43. data/lib/algolia/models/insights/viewed_object_ids.rb +6 -6
  44. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  45. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +3 -0
  46. data/lib/algolia/models/recommend/around_radius.rb +1 -1
  47. data/lib/algolia/models/recommend/automatic_facet_filter.rb +4 -4
  48. data/lib/algolia/models/recommend/automatic_facet_filters.rb +1 -1
  49. data/lib/algolia/models/recommend/base_recommend_request.rb +1 -1
  50. data/lib/algolia/models/recommend/base_recommendations_query.rb +1 -1
  51. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +1 -1
  52. data/lib/algolia/models/recommend/base_search_params.rb +58 -38
  53. data/lib/algolia/models/recommend/base_search_params_without_query.rb +57 -37
  54. data/lib/algolia/models/recommend/base_search_response.rb +20 -6
  55. data/lib/algolia/models/recommend/condition.rb +32 -7
  56. data/lib/algolia/models/recommend/consequence.rb +33 -5
  57. data/lib/algolia/models/recommend/consequence_hide.rb +2 -2
  58. data/lib/algolia/models/recommend/consequence_params.rb +101 -79
  59. data/lib/algolia/models/recommend/consequence_query.rb +1 -1
  60. data/lib/algolia/models/recommend/consequence_query_object.rb +2 -2
  61. data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
  62. data/lib/algolia/models/recommend/distinct.rb +1 -1
  63. data/lib/algolia/models/recommend/edit.rb +1 -1
  64. data/lib/algolia/models/recommend/facet_filters.rb +1 -1
  65. data/lib/algolia/models/recommend/facet_ordering.rb +2 -2
  66. data/lib/algolia/models/recommend/facets.rb +2 -2
  67. data/lib/algolia/models/recommend/highlight_result_option.rb +3 -3
  68. data/lib/algolia/models/recommend/ignore_plurals.rb +1 -1
  69. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +46 -44
  70. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  71. data/lib/algolia/models/recommend/optional_filters.rb +1 -1
  72. data/lib/algolia/models/recommend/params.rb +1 -1
  73. data/lib/algolia/models/recommend/promote_object_id.rb +2 -2
  74. data/lib/algolia/models/recommend/promote_object_ids.rb +16 -2
  75. data/lib/algolia/models/recommend/ranking_info.rb +120 -7
  76. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  77. data/lib/algolia/models/recommend/recommend_hit.rb +3 -3
  78. data/lib/algolia/models/recommend/recommendations_hits.rb +1 -1
  79. data/lib/algolia/models/recommend/recommendations_query.rb +2 -2
  80. data/lib/algolia/models/recommend/recommendations_results.rb +21 -7
  81. data/lib/algolia/models/recommend/recommended_for_you_query.rb +1 -1
  82. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +102 -80
  83. data/lib/algolia/models/recommend/remove_stop_words.rb +1 -1
  84. data/lib/algolia/models/recommend/rendering_content.rb +1 -1
  85. data/lib/algolia/models/recommend/search_params_object.rb +102 -80
  86. data/lib/algolia/models/recommend/search_params_query.rb +1 -1
  87. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +2 -2
  88. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +17 -3
  89. data/lib/algolia/models/recommend/semantic_search.rb +2 -2
  90. data/lib/algolia/models/recommend/snippet_result_option.rb +2 -2
  91. data/lib/algolia/models/recommend/tag_filters.rb +1 -1
  92. data/lib/algolia/models/recommend/trending_facets_query.rb +1 -1
  93. data/lib/algolia/models/recommend/trending_items_query.rb +1 -1
  94. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  95. data/lib/algolia/models/recommend/value.rb +1 -1
  96. data/lib/algolia/models/search/add_api_key_response.rb +1 -1
  97. data/lib/algolia/models/search/api_key.rb +8 -8
  98. data/lib/algolia/models/search/around_precision.rb +1 -1
  99. data/lib/algolia/models/search/around_precision_from_value_inner.rb +3 -0
  100. data/lib/algolia/models/search/around_radius.rb +1 -1
  101. data/lib/algolia/models/search/automatic_facet_filter.rb +4 -4
  102. data/lib/algolia/models/search/automatic_facet_filters.rb +1 -1
  103. data/lib/algolia/models/search/base_index_settings.rb +44 -18
  104. data/lib/algolia/models/search/base_search_params.rb +58 -38
  105. data/lib/algolia/models/search/base_search_params_without_query.rb +57 -37
  106. data/lib/algolia/models/search/base_search_response.rb +20 -6
  107. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +3 -3
  108. data/lib/algolia/models/search/batch_response.rb +2 -2
  109. data/lib/algolia/models/search/browse_params_object.rb +103 -81
  110. data/lib/algolia/models/search/browse_response.rb +23 -8
  111. data/lib/algolia/models/search/built_in_operation.rb +2 -2
  112. data/lib/algolia/models/search/condition.rb +32 -7
  113. data/lib/algolia/models/search/consequence.rb +33 -5
  114. data/lib/algolia/models/search/consequence_hide.rb +2 -2
  115. data/lib/algolia/models/search/consequence_params.rb +101 -79
  116. data/lib/algolia/models/search/consequence_query.rb +1 -1
  117. data/lib/algolia/models/search/consequence_query_object.rb +2 -2
  118. data/lib/algolia/models/search/created_at_response.rb +1 -1
  119. data/lib/algolia/models/search/cursor.rb +1 -1
  120. data/lib/algolia/models/search/delete_by_params.rb +4 -4
  121. data/lib/algolia/models/search/deleted_at_response.rb +1 -1
  122. data/lib/algolia/models/search/dictionary_entry.rb +5 -5
  123. data/lib/algolia/models/search/dictionary_language.rb +2 -2
  124. data/lib/algolia/models/search/dictionary_settings_params.rb +1 -1
  125. data/lib/algolia/models/search/distinct.rb +1 -1
  126. data/lib/algolia/models/search/edit.rb +1 -1
  127. data/lib/algolia/models/search/facet_filters.rb +1 -1
  128. data/lib/algolia/models/search/facet_hits.rb +2 -2
  129. data/lib/algolia/models/search/facet_ordering.rb +2 -2
  130. data/lib/algolia/models/search/facets.rb +2 -2
  131. data/lib/algolia/models/search/get_api_key_response.rb +8 -8
  132. data/lib/algolia/models/search/get_objects_request.rb +3 -3
  133. data/lib/algolia/models/search/get_objects_response.rb +1 -1
  134. data/lib/algolia/models/search/has_pending_mappings_response.rb +1 -1
  135. data/lib/algolia/models/search/highlight_result_option.rb +3 -3
  136. data/lib/algolia/models/search/hit.rb +4 -4
  137. data/lib/algolia/models/search/ignore_plurals.rb +1 -1
  138. data/lib/algolia/models/search/index_settings.rb +89 -61
  139. data/lib/algolia/models/search/index_settings_as_search_params.rb +46 -44
  140. data/lib/algolia/models/search/log.rb +39 -11
  141. data/lib/algolia/models/search/log_query.rb +1 -1
  142. data/lib/algolia/models/search/multiple_batch_response.rb +2 -2
  143. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  144. data/lib/algolia/models/search/operation_index_params.rb +2 -2
  145. data/lib/algolia/models/search/optional_filters.rb +1 -1
  146. data/lib/algolia/models/search/params.rb +1 -1
  147. data/lib/algolia/models/search/promote_object_id.rb +2 -2
  148. data/lib/algolia/models/search/promote_object_ids.rb +16 -2
  149. data/lib/algolia/models/search/ranking_info.rb +120 -7
  150. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  151. data/lib/algolia/models/search/remove_stop_words.rb +1 -1
  152. data/lib/algolia/models/search/rendering_content.rb +1 -1
  153. data/lib/algolia/models/search/rule.rb +23 -5
  154. data/lib/algolia/models/search/save_object_response.rb +3 -3
  155. data/lib/algolia/models/search/save_synonym_response.rb +1 -1
  156. data/lib/algolia/models/search/search_dictionary_entries_params.rb +18 -4
  157. data/lib/algolia/models/search/search_dictionary_entries_response.rb +251 -0
  158. data/lib/algolia/models/search/search_for_facet_values_request.rb +1 -1
  159. data/lib/algolia/models/search/search_for_facet_values_response.rb +1 -0
  160. data/lib/algolia/models/search/search_for_facets.rb +103 -81
  161. data/lib/algolia/models/search/search_for_facets_options.rb +2 -2
  162. data/lib/algolia/models/search/search_for_hits.rb +103 -81
  163. data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
  164. data/lib/algolia/models/search/search_hits.rb +2 -1
  165. data/lib/algolia/models/search/search_params_object.rb +102 -80
  166. data/lib/algolia/models/search/search_params_query.rb +1 -1
  167. data/lib/algolia/models/search/search_response.rb +22 -7
  168. data/lib/algolia/models/search/search_rules_params.rb +8 -20
  169. data/lib/algolia/models/search/search_rules_response.rb +2 -2
  170. data/lib/algolia/models/search/search_synonyms_params.rb +16 -2
  171. data/lib/algolia/models/search/search_synonyms_response.rb +2 -2
  172. data/lib/algolia/models/search/search_user_ids_params.rb +15 -1
  173. data/lib/algolia/models/search/search_user_ids_response.rb +16 -2
  174. data/lib/algolia/models/search/secured_api_key_restrictions.rb +5 -5
  175. data/lib/algolia/models/search/semantic_search.rb +2 -2
  176. data/lib/algolia/models/search/snippet_result_option.rb +2 -2
  177. data/lib/algolia/models/search/tag_filters.rb +1 -1
  178. data/lib/algolia/models/search/time_range.rb +2 -2
  179. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  180. data/lib/algolia/models/search/updated_at_response.rb +1 -1
  181. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +2 -2
  182. data/lib/algolia/models/search/updated_rule_response.rb +2 -2
  183. data/lib/algolia/models/search/user_hit.rb +1 -1
  184. data/lib/algolia/models/search/user_id.rb +1 -1
  185. data/lib/algolia/models/search/value.rb +1 -1
  186. data/lib/algolia/version.rb +1 -1
  187. metadata +7 -2
@@ -12,7 +12,7 @@ module Algolia
12
12
  # Unique A/B test ID.
13
13
  attr_accessor :ab_test_id
14
14
 
15
- # Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the `task` operation and this `taskID`.
15
+ # Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
16
16
  attr_accessor :task_id
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -12,7 +12,7 @@ module Algolia
12
12
  # Number of occurrences.
13
13
  attr_accessor :count
14
14
 
15
- # Number of hits the search query matched.
15
+ # Number of results (hits).
16
16
  attr_accessor :nb_hits
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -12,7 +12,7 @@ module Algolia
12
12
  # Number of tracked _and_ untracked searches (where the `clickAnalytics` parameter isn't `true`).
13
13
  attr_accessor :count
14
14
 
15
- # Number of hits the search query matched.
15
+ # Number of results (hits).
16
16
  attr_accessor :nb_hits
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -30,7 +30,7 @@ module Algolia
30
30
  # Number of converted clicks.
31
31
  attr_accessor :conversion_count
32
32
 
33
- # Number of hits the search query matched.
33
+ # Number of results (hits).
34
34
  attr_accessor :nb_hits
35
35
 
36
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -9,9 +9,10 @@ module Algolia
9
9
  REPLACE = "replace".freeze
10
10
  SAVE = "save".freeze
11
11
  PARTIAL = "partial".freeze
12
+ APPEND = "append".freeze
12
13
 
13
14
  def self.all_vars
14
- @all_vars ||= [REPLACE, SAVE, PARTIAL].freeze
15
+ @all_vars ||= [REPLACE, SAVE, PARTIAL, APPEND].freeze
15
16
  end
16
17
 
17
18
  # Builds the enum from string
@@ -0,0 +1,223 @@
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 SourceGA4BigQueryExport
9
+ # GCP project ID that the BigQuery Export writes to.
10
+ attr_accessor :project_id
11
+
12
+ # BigQuery dataset ID that the BigQuery Export writes to.
13
+ attr_accessor :dataset_id
14
+
15
+ # Prefix of the tables that the BigQuery Export writes to (i.e. events_intraday_ for streaming, events_ for daily).
16
+ attr_accessor :table_prefix
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :project_id => :projectID,
22
+ :dataset_id => :datasetID,
23
+ :table_prefix => :tablePrefix
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.types_mapping
34
+ {
35
+ :project_id => :String,
36
+ :dataset_id => :String,
37
+ :table_prefix => :String
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ unless attributes.is_a?(Hash)
50
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::SourceGA4BigQueryExport` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) do |(k, v), h|
55
+ unless self.class.attribute_map.key?(k.to_sym)
56
+ raise ArgumentError,
57
+ "`#{k}` is not a valid attribute in `Algolia::SourceGA4BigQueryExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+
60
+ h[k.to_sym] = v
61
+ end
62
+
63
+ if attributes.key?(:project_id)
64
+ self.project_id = attributes[:project_id]
65
+ else
66
+ self.project_id = nil
67
+ end
68
+
69
+ if attributes.key?(:dataset_id)
70
+ self.dataset_id = attributes[:dataset_id]
71
+ else
72
+ self.dataset_id = nil
73
+ end
74
+
75
+ if attributes.key?(:table_prefix)
76
+ self.table_prefix = attributes[:table_prefix]
77
+ else
78
+ self.table_prefix = 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
+ project_id == other.project_id &&
89
+ dataset_id == other.dataset_id &&
90
+ table_prefix == other.table_prefix
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(other)
96
+ self == other
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [project_id, dataset_id, table_prefix].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ types_mapping.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash[key.to_sym] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def self._deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = Algolia::Ingestion.const_get(type)
168
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ def to_json(*_args)
185
+ to_hash.to_json
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
@@ -15,6 +15,7 @@ module Algolia
15
15
  :SourceCSV,
16
16
  :SourceCommercetools,
17
17
  :SourceDocker,
18
+ :SourceGA4BigQueryExport,
18
19
  :SourceJSON
19
20
  ]
20
21
  end
@@ -12,9 +12,10 @@ module Algolia
12
12
  CSV = "csv".freeze
13
13
  BIGQUERY = "bigquery".freeze
14
14
  DOCKER = "docker".freeze
15
+ GA4_BIGQUERY_EXPORT = "ga4BigqueryExport".freeze
15
16
 
16
17
  def self.all_vars
17
- @all_vars ||= [BIGCOMMERCE, COMMERCETOOLS, JSON, CSV, BIGQUERY, DOCKER].freeze
18
+ @all_vars ||= [BIGCOMMERCE, COMMERCETOOLS, JSON, CSV, BIGQUERY, DOCKER, GA4_BIGQUERY_EXPORT].freeze
18
19
  end
19
20
 
20
21
  # Builds the enum from string
@@ -12,6 +12,7 @@ module Algolia
12
12
  [
13
13
  :SourceBigQuery,
14
14
  :SourceCSV,
15
+ :SourceGA4BigQueryExport,
15
16
  :SourceJSON,
16
17
  :SourceUpdateCommercetools,
17
18
  :SourceUpdateDocker
@@ -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