algolia 3.0.0.alpha.15 → 3.0.0.alpha.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +10 -167
  3. data/CHANGELOG.md +14 -0
  4. data/Gemfile.lock +1 -1
  5. data/lib/algolia/api/analytics_client.rb +76 -76
  6. data/lib/algolia/api/ingestion_client.rb +267 -196
  7. data/lib/algolia/api/monitoring_client.rb +49 -49
  8. data/lib/algolia/api/query_suggestions_client.rb +14 -14
  9. data/lib/algolia/api/recommend_client.rb +22 -22
  10. data/lib/algolia/api/search_client.rb +8 -8
  11. data/lib/algolia/api/usage_client.rb +329 -0
  12. data/lib/algolia/models/analytics/get_status_response.rb +1 -1
  13. data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
  14. data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
  15. data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
  16. data/lib/algolia/models/ingestion/auth_algolia_partial.rb +3 -2
  17. data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
  18. data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
  19. data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
  20. data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
  21. data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
  22. data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
  23. data/lib/algolia/models/ingestion/auth_input.rb +1 -0
  24. data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
  25. data/lib/algolia/models/ingestion/auth_o_auth.rb +18 -8
  26. data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
  27. data/lib/algolia/models/ingestion/authentication.rb +5 -5
  28. data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
  29. data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
  30. data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
  31. data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
  32. data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
  33. data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
  34. data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
  35. data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
  36. data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
  37. data/lib/algolia/models/ingestion/delete_response.rb +1 -1
  38. data/lib/algolia/models/ingestion/destination.rb +6 -6
  39. data/lib/algolia/models/ingestion/destination_create.rb +3 -3
  40. data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
  41. data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
  42. data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
  43. data/lib/algolia/models/ingestion/destination_search.rb +1 -1
  44. data/lib/algolia/models/ingestion/destination_type.rb +1 -2
  45. data/lib/algolia/models/ingestion/destination_update.rb +3 -3
  46. data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
  47. data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
  48. data/lib/algolia/models/ingestion/event.rb +3 -3
  49. data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
  50. data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
  51. data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
  52. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
  53. data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
  54. data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
  55. data/lib/algolia/models/ingestion/pagination.rb +65 -0
  56. data/lib/algolia/models/ingestion/platform.rb +2 -1
  57. data/lib/algolia/models/ingestion/run.rb +7 -7
  58. data/lib/algolia/models/ingestion/run_response.rb +3 -3
  59. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
  60. data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
  61. data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
  62. data/lib/algolia/models/ingestion/source.rb +4 -4
  63. data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
  64. data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
  65. data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
  66. data/lib/algolia/models/ingestion/source_create.rb +2 -1
  67. data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
  68. data/lib/algolia/models/ingestion/source_csv.rb +3 -3
  69. data/lib/algolia/models/ingestion/source_docker.rb +3 -3
  70. data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
  71. data/lib/algolia/models/ingestion/source_json.rb +2 -2
  72. data/lib/algolia/models/ingestion/source_type.rb +5 -3
  73. data/lib/algolia/models/ingestion/source_update.rb +2 -1
  74. data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
  75. data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
  76. data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
  77. data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
  78. data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
  79. data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
  80. data/lib/algolia/models/ingestion/task.rb +7 -7
  81. data/lib/algolia/models/ingestion/task_create.rb +5 -5
  82. data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
  83. data/lib/algolia/models/ingestion/task_input.rb +1 -0
  84. data/lib/algolia/models/ingestion/task_update.rb +4 -4
  85. data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
  86. data/lib/algolia/models/ingestion/trigger.rb +1 -0
  87. data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
  88. data/lib/algolia/models/ingestion/window.rb +3 -3
  89. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
  90. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  91. data/lib/algolia/models/insights/clicked_filters.rb +1 -1
  92. data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
  93. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  94. data/lib/algolia/models/insights/converted_filters.rb +1 -1
  95. data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
  96. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  97. data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
  98. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
  99. data/lib/algolia/models/insights/viewed_filters.rb +1 -1
  100. data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
  101. data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
  102. data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
  103. data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
  104. data/lib/algolia/models/monitoring/server.rb +2 -2
  105. data/lib/algolia/models/monitoring/time_inner.rb +1 -1
  106. data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
  107. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
  108. data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
  109. data/lib/algolia/models/query-suggestions/languages.rb +1 -1
  110. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
  111. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
  112. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
  113. data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
  114. data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
  115. data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
  116. data/lib/algolia/models/recommend/base_search_params.rb +1 -1
  117. data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
  118. data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
  119. data/lib/algolia/models/recommend/condition.rb +12 -62
  120. data/lib/algolia/models/recommend/consequence.rb +32 -54
  121. data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
  122. data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +9 -12
  123. data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
  124. data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
  125. data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
  126. data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
  127. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +5 -5
  128. data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
  129. data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
  130. data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
  131. data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
  132. data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
  133. data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
  134. data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
  135. data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
  136. data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
  137. data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
  138. data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
  139. data/lib/algolia/models/recommend/recommended_for_you_query.rb +35 -15
  140. data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
  141. data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
  142. data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +39 -19
  143. data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
  144. data/lib/algolia/models/recommend/search_params_object.rb +6 -6
  145. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
  146. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
  147. data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
  148. data/lib/algolia/models/recommend/trending_facets.rb +243 -0
  149. data/lib/algolia/models/recommend/trending_facets_query.rb +50 -10
  150. data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
  151. data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
  152. data/lib/algolia/models/search/add_api_key_response.rb +1 -1
  153. data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
  154. data/lib/algolia/models/search/base_index_settings.rb +4 -4
  155. data/lib/algolia/models/search/base_search_params.rb +1 -1
  156. data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
  157. data/lib/algolia/models/search/browse_params_object.rb +6 -6
  158. data/lib/algolia/models/search/consequence_params.rb +6 -6
  159. data/lib/algolia/models/search/created_at_response.rb +1 -1
  160. data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
  161. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  162. data/lib/algolia/models/search/delete_source_response.rb +1 -1
  163. data/lib/algolia/models/search/deleted_at_response.rb +1 -1
  164. data/lib/algolia/models/search/fetched_index.rb +1 -1
  165. data/lib/algolia/models/search/get_api_key_response.rb +1 -1
  166. data/lib/algolia/models/search/index_settings.rb +9 -9
  167. data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
  168. data/lib/algolia/models/search/log.rb +1 -1
  169. data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
  170. data/lib/algolia/models/search/replace_source_response.rb +1 -1
  171. data/lib/algolia/models/search/save_object_response.rb +1 -1
  172. data/lib/algolia/models/search/save_synonym_response.rb +1 -1
  173. data/lib/algolia/models/search/search_for_facets.rb +6 -6
  174. data/lib/algolia/models/search/search_for_hits.rb +6 -6
  175. data/lib/algolia/models/search/search_params_object.rb +6 -6
  176. data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
  177. data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
  178. data/lib/algolia/models/search/update_api_key_response.rb +1 -1
  179. data/lib/algolia/models/search/updated_at_response.rb +1 -1
  180. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
  181. data/lib/algolia/models/search/updated_rule_response.rb +1 -1
  182. data/lib/algolia/models/search/user_hit.rb +1 -1
  183. data/lib/algolia/models/search/user_id.rb +1 -1
  184. data/lib/algolia/models/usage/error_base.rb +205 -0
  185. data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
  186. data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
  187. data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
  188. data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
  189. data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
  190. data/lib/algolia/models/usage/granularity.rb +33 -0
  191. data/lib/algolia/models/usage/statistic.rb +116 -0
  192. data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
  193. data/lib/algolia/version.rb +1 -1
  194. metadata +37 -26
  195. data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
  196. data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
  197. data/lib/algolia/models/recommend/consequence_query.rb +0 -97
  198. data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -5,7 +5,7 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Monitoring
8
- class GetInventory403Response
8
+ class GetServers403Response
9
9
  attr_accessor :reason
10
10
 
11
11
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -36,14 +36,14 @@ module Algolia
36
36
  # @param [Hash] attributes Model attributes in the form of hash
37
37
  def initialize(attributes = {})
38
38
  unless attributes.is_a?(Hash)
39
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::GetInventory403Response` initialize method"
39
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::GetServers403Response` initialize method"
40
40
  end
41
41
 
42
42
  # check to see if the attribute exists and convert string to symbol for hash key
43
43
  attributes = attributes.each_with_object({}) do |(k, v), h|
44
44
  unless self.class.attribute_map.key?(k.to_sym)
45
45
  raise ArgumentError,
46
- "`#{k}` is not a valid attribute in `Algolia::GetInventory403Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
+ "`#{k}` is not a valid attribute in `Algolia::GetServers403Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
47
47
  end
48
48
 
49
49
  h[k.to_sym] = v
@@ -6,7 +6,7 @@ require 'time'
6
6
  module Algolia
7
7
  module Monitoring
8
8
  class IncidentsInner
9
- # Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds.
9
+ # Timestamp, measured in milliseconds since the Unix epoch.
10
10
  attr_accessor :t
11
11
 
12
12
  attr_accessor :v
@@ -6,7 +6,7 @@ require 'time'
6
6
  module Algolia
7
7
  module Monitoring
8
8
  class ProbesMetric
9
- # Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds.
9
+ # Timestamp, measured in milliseconds since the Unix epoch.
10
10
  attr_accessor :t
11
11
 
12
12
  # Value of the metric.
@@ -11,10 +11,10 @@ module Algolia
11
11
 
12
12
  attr_accessor :region
13
13
 
14
- # Included to support legacy applications. Do not rely on this attribute being present in the response. Use `is_replica` instead.
14
+ # Included to support legacy applications. Use `is_replica` instead.
15
15
  attr_accessor :is_slave
16
16
 
17
- # Indicates whether this server is a replica of another server.
17
+ # Whether this server is a replica of another server.
18
18
  attr_accessor :is_replica
19
19
 
20
20
  # Name of the cluster to which this server belongs.
@@ -6,7 +6,7 @@ require 'time'
6
6
  module Algolia
7
7
  module Monitoring
8
8
  class TimeInner
9
- # Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds.
9
+ # Timestamp, measured in milliseconds since the Unix epoch.
10
10
  attr_accessor :t
11
11
 
12
12
  # Time in ms.
@@ -0,0 +1,197 @@
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 QuerySuggestions
8
+ class AppID
9
+ # Algolia application ID to which this Query Suggestions configuration belongs.
10
+ attr_accessor :app_id
11
+
12
+ # Attribute mapping from ruby-style variable name to JSON key.
13
+ def self.attribute_map
14
+ {
15
+ :app_id => :appID
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
+ :app_id => :String
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::AppID` 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::AppID`. 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?(:app_id)
54
+ self.app_id = attributes[:app_id]
55
+ end
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] Object to be compared
60
+ def ==(other)
61
+ return true if equal?(other)
62
+
63
+ self.class == other.class &&
64
+ app_id == other.app_id
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(other)
70
+ self == other
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ def hash
76
+ [app_id].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def self.build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+
85
+ attributes = attributes.transform_keys(&:to_sym)
86
+ transformed_hash = {}
87
+ types_mapping.each_pair do |key, type|
88
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
89
+ transformed_hash[key.to_sym] = nil
90
+ elsif type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[attribute_map[key]].is_a?(Array)
94
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
95
+ end
96
+ elsif !attributes[attribute_map[key]].nil?
97
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
98
+ end
99
+ end
100
+ new(transformed_hash)
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def self._deserialize(type, value)
108
+ case type.to_sym
109
+ when :Time
110
+ Time.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :Boolean
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ # models (e.g. Pet) or oneOf
141
+ klass = Algolia::QuerySuggestions.const_get(type)
142
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ def to_json(*_args)
159
+ to_hash.to_json
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = send(attr)
168
+ if value.nil?
169
+ is_nullable = self.class.openapi_nullable.include?(attr)
170
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
171
+ end
172
+
173
+ hash[param] = _to_hash(value)
174
+ end
175
+ hash
176
+ end
177
+
178
+ # Outputs non-array value in the form of hash
179
+ # For object, use to_hash. Otherwise, just return the value
180
+ # @param [Object] value Any valid value
181
+ # @return [Hash] Returns the value in the form of hash
182
+ def _to_hash(value)
183
+ if value.is_a?(Array)
184
+ value.compact.map { |v| _to_hash(v) }
185
+ elsif value.is_a?(Hash)
186
+ {}.tap do |hash|
187
+ value.each { |k, v| hash[k] = _to_hash(v) }
188
+ end
189
+ elsif value.respond_to? :to_hash
190
+ value.to_hash
191
+ else
192
+ value
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
@@ -6,16 +6,16 @@ require 'time'
6
6
  module Algolia
7
7
  module QuerySuggestions
8
8
  class GetConfigStatus200Response
9
- # Query Suggestions index name.
9
+ # Name of the Query Suggestions index.
10
10
  attr_accessor :index_name
11
11
 
12
- # Indicates whether the creation or update of the Query Suggestions is in progress.
12
+ # Whether the creation or update of the Query Suggestions index is in progress.
13
13
  attr_accessor :is_running
14
14
 
15
- # Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format when the Query Suggestions index was last built.
15
+ # Date and time when the Query Suggestions index was last built, in RFC 3339 format.
16
16
  attr_accessor :last_built_at
17
17
 
18
- # Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format when the Query Suggestions index was last updated successfully.
18
+ # Date and time when the Query Suggestions index was last updated successfully.
19
19
  attr_accessor :last_successful_built_at
20
20
 
21
21
  # Duration of the last successful build in seconds.
@@ -6,7 +6,7 @@ require 'time'
6
6
  module Algolia
7
7
  module QuerySuggestions
8
8
  class GetLogFile200Response
9
- # Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
9
+ # Date and time of the log entry, in RFC 3339 format.
10
10
  attr_accessor :timestamp
11
11
 
12
12
  attr_accessor :level
@@ -14,7 +14,7 @@ module Algolia
14
14
  # Details about this log entry.
15
15
  attr_accessor :message
16
16
 
17
- # Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
17
+ # Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
18
18
  attr_accessor :context_level
19
19
 
20
20
  class EnumAttributeValidator
@@ -5,7 +5,7 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module QuerySuggestions
8
- # Set the language for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
8
+ # Languages for deduplicating singular and plural suggestions. If specified, only the more popular form is included.
9
9
  module Languages
10
10
  class << self
11
11
  # List of class defined in oneOf (OpenAPI v3)
@@ -12,13 +12,12 @@ module Algolia
12
12
 
13
13
  attr_accessor :languages
14
14
 
15
- # Patterns to exclude from query suggestions.
16
15
  attr_accessor :exclude
17
16
 
18
- # Turn on personalized query suggestions.
17
+ # Whether to turn on personalized query suggestions.
19
18
  attr_accessor :enable_personalization
20
19
 
21
- # Allow suggestions with special characters.
20
+ # Whether to include suggestions with special characters.
22
21
  attr_accessor :allow_special_characters
23
22
 
24
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -5,17 +5,12 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module QuerySuggestions
8
+ # API response for retrieving Query Suggestions configurations.
8
9
  class QuerySuggestionsConfigurationResponse
9
- # API key used to read from your source index.
10
- attr_accessor :source_indices_api_key
10
+ # Algolia application ID to which this Query Suggestions configuration belongs.
11
+ attr_accessor :app_id
11
12
 
12
- # API key used to write and configure your Query Suggestions index.
13
- attr_accessor :suggestions_indices_api_key
14
-
15
- # API key used to read from external Algolia indices.
16
- attr_accessor :external_indices_api_key
17
-
18
- # Query Suggestions index name.
13
+ # Name of the Query Suggestions index.
19
14
  attr_accessor :index_name
20
15
 
21
16
  # Algolia indices from which to get the popular searches for query suggestions.
@@ -23,21 +18,18 @@ module Algolia
23
18
 
24
19
  attr_accessor :languages
25
20
 
26
- # Patterns to exclude from query suggestions.
27
21
  attr_accessor :exclude
28
22
 
29
- # Turn on personalized query suggestions.
23
+ # Whether to turn on personalized query suggestions.
30
24
  attr_accessor :enable_personalization
31
25
 
32
- # Allow suggestions with special characters.
26
+ # Whether to include suggestions with special characters.
33
27
  attr_accessor :allow_special_characters
34
28
 
35
29
  # Attribute mapping from ruby-style variable name to JSON key.
36
30
  def self.attribute_map
37
31
  {
38
- :source_indices_api_key => :sourceIndicesAPIKey,
39
- :suggestions_indices_api_key => :suggestionsIndicesAPIKey,
40
- :external_indices_api_key => :externalIndicesAPIKey,
32
+ :app_id => :appID,
41
33
  :index_name => :indexName,
42
34
  :source_indices => :sourceIndices,
43
35
  :languages => :languages,
@@ -55,9 +47,7 @@ module Algolia
55
47
  # Attribute type mapping.
56
48
  def self.types_mapping
57
49
  {
58
- :source_indices_api_key => :String,
59
- :suggestions_indices_api_key => :String,
60
- :external_indices_api_key => :String,
50
+ :app_id => :String,
61
51
  :index_name => :String,
62
52
  :source_indices => :'Array<SourceIndex>',
63
53
  :languages => :Languages,
@@ -77,7 +67,7 @@ module Algolia
77
67
  # List of class defined in allOf (OpenAPI v3)
78
68
  def self.openapi_all_of
79
69
  [
80
- :BaseQuerySuggestionsConfigurationResponse,
70
+ :AppID,
81
71
  :QuerySuggestionsConfigurationWithIndex
82
72
  ]
83
73
  end
@@ -99,16 +89,10 @@ module Algolia
99
89
  h[k.to_sym] = v
100
90
  end
101
91
 
102
- if attributes.key?(:source_indices_api_key)
103
- self.source_indices_api_key = attributes[:source_indices_api_key]
104
- end
105
-
106
- if attributes.key?(:suggestions_indices_api_key)
107
- self.suggestions_indices_api_key = attributes[:suggestions_indices_api_key]
108
- end
109
-
110
- if attributes.key?(:external_indices_api_key)
111
- self.external_indices_api_key = attributes[:external_indices_api_key]
92
+ if attributes.key?(:app_id)
93
+ self.app_id = attributes[:app_id]
94
+ else
95
+ self.app_id = nil
112
96
  end
113
97
 
114
98
  if attributes.key?(:index_name)
@@ -127,20 +111,28 @@ module Algolia
127
111
 
128
112
  if attributes.key?(:languages)
129
113
  self.languages = attributes[:languages]
114
+ else
115
+ self.languages = nil
130
116
  end
131
117
 
132
118
  if attributes.key?(:exclude)
133
119
  if (value = attributes[:exclude]).is_a?(Array)
134
120
  self.exclude = value
135
121
  end
122
+ else
123
+ self.exclude = nil
136
124
  end
137
125
 
138
126
  if attributes.key?(:enable_personalization)
139
127
  self.enable_personalization = attributes[:enable_personalization]
128
+ else
129
+ self.enable_personalization = nil
140
130
  end
141
131
 
142
132
  if attributes.key?(:allow_special_characters)
143
133
  self.allow_special_characters = attributes[:allow_special_characters]
134
+ else
135
+ self.allow_special_characters = nil
144
136
  end
145
137
  end
146
138
 
@@ -164,9 +156,7 @@ module Algolia
164
156
  return true if equal?(other)
165
157
 
166
158
  self.class == other.class &&
167
- source_indices_api_key == other.source_indices_api_key &&
168
- suggestions_indices_api_key == other.suggestions_indices_api_key &&
169
- external_indices_api_key == other.external_indices_api_key &&
159
+ app_id == other.app_id &&
170
160
  index_name == other.index_name &&
171
161
  source_indices == other.source_indices &&
172
162
  languages == other.languages &&
@@ -184,8 +174,7 @@ module Algolia
184
174
  # Calculates hash code according to all attributes.
185
175
  # @return [Integer] Hash code
186
176
  def hash
187
- [source_indices_api_key, suggestions_indices_api_key, external_indices_api_key, index_name, source_indices, languages, exclude, enable_personalization,
188
- allow_special_characters].hash
177
+ [app_id, index_name, source_indices, languages, exclude, enable_personalization, allow_special_characters].hash
189
178
  end
190
179
 
191
180
  # Builds the object from hash
@@ -7,32 +7,31 @@ module Algolia
7
7
  module QuerySuggestions
8
8
  # Query Suggestions configuration.
9
9
  class QuerySuggestionsConfigurationWithIndex
10
- # Query Suggestions index name.
11
- attr_accessor :index_name
12
-
13
10
  # Algolia indices from which to get the popular searches for query suggestions.
14
11
  attr_accessor :source_indices
15
12
 
16
13
  attr_accessor :languages
17
14
 
18
- # Patterns to exclude from query suggestions.
19
15
  attr_accessor :exclude
20
16
 
21
- # Turn on personalized query suggestions.
17
+ # Whether to turn on personalized query suggestions.
22
18
  attr_accessor :enable_personalization
23
19
 
24
- # Allow suggestions with special characters.
20
+ # Whether to include suggestions with special characters.
25
21
  attr_accessor :allow_special_characters
26
22
 
23
+ # Name of the Query Suggestions index.
24
+ attr_accessor :index_name
25
+
27
26
  # Attribute mapping from ruby-style variable name to JSON key.
28
27
  def self.attribute_map
29
28
  {
30
- :index_name => :indexName,
31
29
  :source_indices => :sourceIndices,
32
30
  :languages => :languages,
33
31
  :exclude => :exclude,
34
32
  :enable_personalization => :enablePersonalization,
35
- :allow_special_characters => :allowSpecialCharacters
33
+ :allow_special_characters => :allowSpecialCharacters,
34
+ :index_name => :indexName
36
35
  }
37
36
  end
38
37
 
@@ -44,12 +43,12 @@ module Algolia
44
43
  # Attribute type mapping.
45
44
  def self.types_mapping
46
45
  {
47
- :index_name => :String,
48
46
  :source_indices => :'Array<SourceIndex>',
49
47
  :languages => :Languages,
50
48
  :exclude => :'Array<String>',
51
49
  :enable_personalization => :Boolean,
52
- :allow_special_characters => :Boolean
50
+ :allow_special_characters => :Boolean,
51
+ :index_name => :String
53
52
  }
54
53
  end
55
54
 
@@ -63,7 +62,6 @@ module Algolia
63
62
  # List of class defined in allOf (OpenAPI v3)
64
63
  def self.openapi_all_of
65
64
  [
66
- :BaseQuerySuggestionsConfigurationWithIndex,
67
65
  :QuerySuggestionsConfiguration
68
66
  ]
69
67
  end
@@ -85,12 +83,6 @@ module Algolia
85
83
  h[k.to_sym] = v
86
84
  end
87
85
 
88
- if attributes.key?(:index_name)
89
- self.index_name = attributes[:index_name]
90
- else
91
- self.index_name = nil
92
- end
93
-
94
86
  if attributes.key?(:source_indices)
95
87
  if (value = attributes[:source_indices]).is_a?(Array)
96
88
  self.source_indices = value
@@ -116,6 +108,12 @@ module Algolia
116
108
  if attributes.key?(:allow_special_characters)
117
109
  self.allow_special_characters = attributes[:allow_special_characters]
118
110
  end
111
+
112
+ if attributes.key?(:index_name)
113
+ self.index_name = attributes[:index_name]
114
+ else
115
+ self.index_name = nil
116
+ end
119
117
  end
120
118
 
121
119
  # Custom attribute writer method with validation
@@ -138,12 +136,12 @@ module Algolia
138
136
  return true if equal?(other)
139
137
 
140
138
  self.class == other.class &&
141
- index_name == other.index_name &&
142
139
  source_indices == other.source_indices &&
143
140
  languages == other.languages &&
144
141
  exclude == other.exclude &&
145
142
  enable_personalization == other.enable_personalization &&
146
- allow_special_characters == other.allow_special_characters
143
+ allow_special_characters == other.allow_special_characters &&
144
+ index_name == other.index_name
147
145
  end
148
146
 
149
147
  # @see the `==` method
@@ -155,7 +153,7 @@ module Algolia
155
153
  # Calculates hash code according to all attributes.
156
154
  # @return [Integer] Hash code
157
155
  def hash
158
- [index_name, source_indices, languages, exclude, enable_personalization, allow_special_characters].hash
156
+ [source_indices, languages, exclude, enable_personalization, allow_special_characters, index_name].hash
159
157
  end
160
158
 
161
159
  # Builds the object from hash
@@ -10,16 +10,14 @@ module Algolia
10
10
  # Name of the Algolia index to use as source for query suggestions.
11
11
  attr_accessor :index_name
12
12
 
13
- # If true, Query Suggestions uses all replicas of the primary index to find popular searches. If false, only the primary index is used.
13
+ # If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index is used.
14
14
  attr_accessor :replicas
15
15
 
16
- # [Analytics tags](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) for filtering the popular searches.
17
16
  attr_accessor :analytics_tags
18
17
 
19
- # Facets to use as top categories with your suggestions. If provided, Query Suggestions adds the top facet values to each suggestion.
20
18
  attr_accessor :facets
21
19
 
22
- # Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` hits to be included in the Query Suggestions index.
20
+ # Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` search results to be included in the Query Suggestions index.
23
21
  attr_accessor :min_hits
24
22
 
25
23
  # Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to be included in the Query Suggestions index.
@@ -27,7 +25,6 @@ module Algolia
27
25
 
28
26
  attr_accessor :generate
29
27
 
30
- # Algolia indices with popular searches to use as query suggestions. Records of these indices must have these attributes: - `query`: search query which will be added as a suggestion - `count`: measure of popularity of that search query For example, you can export popular searches from an external analytics tool, such as Google Analytics or Adobe Analytics, and feed this data into an external Algolia index. You can use this external index to generate query suggestions until your Algolia analytics has collected enough data.
31
28
  attr_accessor :external
32
29
 
33
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -68,6 +65,7 @@ module Algolia
68
65
  Set.new([
69
66
  :analytics_tags,
70
67
  :facets,
68
+ :generate,
71
69
  :external
72
70
  ])
73
71
  end