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.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/ingestion_client.rb +267 -196
- data/lib/algolia/api/monitoring_client.rb +49 -49
- data/lib/algolia/api/query_suggestions_client.rb +14 -14
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +3 -2
- data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
- data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/auth_o_auth.rb +18 -8
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
- data/lib/algolia/models/ingestion/authentication.rb +5 -5
- data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
- data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
- data/lib/algolia/models/ingestion/delete_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +6 -6
- data/lib/algolia/models/ingestion/destination_create.rb +3 -3
- data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
- data/lib/algolia/models/ingestion/destination_search.rb +1 -1
- data/lib/algolia/models/ingestion/destination_type.rb +1 -2
- data/lib/algolia/models/ingestion/destination_update.rb +3 -3
- data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
- data/lib/algolia/models/ingestion/event.rb +3 -3
- data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
- data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
- data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
- data/lib/algolia/models/ingestion/pagination.rb +65 -0
- data/lib/algolia/models/ingestion/platform.rb +2 -1
- data/lib/algolia/models/ingestion/run.rb +7 -7
- data/lib/algolia/models/ingestion/run_response.rb +3 -3
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
- data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
- data/lib/algolia/models/ingestion/source.rb +4 -4
- data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
- data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
- data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
- data/lib/algolia/models/ingestion/source_create.rb +2 -1
- data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
- data/lib/algolia/models/ingestion/source_csv.rb +3 -3
- data/lib/algolia/models/ingestion/source_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
- data/lib/algolia/models/ingestion/source_json.rb +2 -2
- data/lib/algolia/models/ingestion/source_type.rb +5 -3
- data/lib/algolia/models/ingestion/source_update.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
- data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
- data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
- data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/task.rb +7 -7
- data/lib/algolia/models/ingestion/task_create.rb +5 -5
- data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/ingestion/task_update.rb +4 -4
- data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
- data/lib/algolia/models/ingestion/trigger.rb +1 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
- data/lib/algolia/models/ingestion/window.rb +3 -3
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_filters.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_filters.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
- data/lib/algolia/models/insights/viewed_filters.rb +1 -1
- data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
- data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/server.rb +2 -2
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
- data/lib/algolia/models/query-suggestions/languages.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
- data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
- data/lib/algolia/models/recommend/base_search_params.rb +1 -1
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +9 -12
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +35 -15
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +39 -19
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
- data/lib/algolia/models/recommend/search_params_object.rb +6 -6
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +50 -10
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +4 -4
- data/lib/algolia/models/search/base_search_params.rb +1 -1
- data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +6 -6
- data/lib/algolia/models/search/consequence_params.rb +6 -6
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +1 -1
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +9 -9
- data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +6 -6
- data/lib/algolia/models/search/search_for_hits.rb +6 -6
- data/lib/algolia/models/search/search_params_object.rb +6 -6
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +37 -26
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb}
RENAMED
@@ -5,7 +5,7 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
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::
|
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::
|
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
|
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
|
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.
|
14
|
+
# Included to support legacy applications. Use `is_replica` instead.
|
15
15
|
attr_accessor :is_slave
|
16
16
|
|
17
|
-
#
|
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.
|
@@ -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
|
9
|
+
# Name of the Query Suggestions index.
|
10
10
|
attr_accessor :index_name
|
11
11
|
|
12
|
-
#
|
12
|
+
# Whether the creation or update of the Query Suggestions index is in progress.
|
13
13
|
attr_accessor :is_running
|
14
14
|
|
15
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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.
|
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
|
-
#
|
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
|
-
#
|
17
|
+
# Whether to turn on personalized query suggestions.
|
19
18
|
attr_accessor :enable_personalization
|
20
19
|
|
21
|
-
#
|
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
|
-
#
|
10
|
-
attr_accessor :
|
10
|
+
# Algolia application ID to which this Query Suggestions configuration belongs.
|
11
|
+
attr_accessor :app_id
|
11
12
|
|
12
|
-
#
|
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
|
-
#
|
23
|
+
# Whether to turn on personalized query suggestions.
|
30
24
|
attr_accessor :enable_personalization
|
31
25
|
|
32
|
-
#
|
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
|
-
:
|
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
|
-
:
|
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
|
-
:
|
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?(:
|
103
|
-
self.
|
104
|
-
|
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
|
-
|
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
|
-
[
|
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
|
-
#
|
17
|
+
# Whether to turn on personalized query suggestions.
|
22
18
|
attr_accessor :enable_personalization
|
23
19
|
|
24
|
-
#
|
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
|
-
[
|
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
|
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`
|
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
|