algolia 3.0.0.alpha.16 → 3.0.0.alpha.18
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 +16 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/abtesting_client.rb +20 -20
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/personalization_client.rb +12 -12
- 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/abtesting/ab_test.rb +41 -16
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +217 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +2 -2
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +21 -3
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +21 -3
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +1 -1
- data/lib/algolia/models/abtesting/custom_search_params.rb +1 -1
- data/lib/algolia/models/abtesting/effect.rb +35 -0
- data/lib/algolia/models/abtesting/empty_search.rb +198 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +1 -1
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +247 -0
- data/lib/algolia/models/abtesting/outliers.rb +198 -0
- data/lib/algolia/models/abtesting/status.rb +35 -0
- data/lib/algolia/models/abtesting/variant.rb +31 -13
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- 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_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/destination_index_name.rb +1 -1
- data/lib/algolia/models/ingestion/shopify_input.rb +212 -0
- data/lib/algolia/models/ingestion/shopify_market.rb +227 -0
- data/lib/algolia/models/ingestion/shopify_metafield.rb +221 -0
- data/lib/algolia/models/ingestion/source_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_shopify.rb +278 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → ingestion/source_shopify_base.rb} +14 -14
- data/lib/algolia/models/ingestion/source_update_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_shopify.rb +258 -0
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +2 -2
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/clicked_filters.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/converted_filters.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/viewed_filters.rb +2 -2
- data/lib/algolia/models/insights/viewed_object_ids.rb +2 -2
- 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/time_inner.rb +1 -1
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +2 -2
- data/lib/algolia/models/personalization/event_scoring.rb +25 -4
- data/lib/algolia/models/personalization/event_type.rb +34 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +2 -2
- data/lib/algolia/models/personalization/get_user_token_response.rb +3 -3
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +21 -3
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +3 -3
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +1 -1
- data/lib/algolia/models/query-suggestions/source_index.rb +1 -1
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +37 -8
- data/lib/algolia/models/recommend/base_search_params.rb +4 -4
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +4 -4
- 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} +17 -20
- 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 +10 -10
- 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/re_ranking_apply_filter.rb +1 -1
- 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 +36 -16
- 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} +40 -20
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +33 -52
- data/lib/algolia/models/recommend/search_params_object.rb +15 -14
- 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 +51 -11
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +43 -17
- 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 +10 -10
- data/lib/algolia/models/search/base_search_params.rb +4 -4
- data/lib/algolia/models/search/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/search/browse_params_object.rb +14 -14
- data/lib/algolia/models/search/consequence_params.rb +14 -14
- 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 +2 -2
- 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 +20 -20
- data/lib/algolia/models/search/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/multiple_batch_request.rb +1 -1
- data/lib/algolia/models/search/operation_index_params.rb +1 -1
- data/lib/algolia/models/search/re_ranking_apply_filter.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 +15 -15
- data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +15 -15
- data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +15 -14
- 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/usage/get_usage400_response.rb +198 -0
- 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 +47 -25
- 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
@@ -0,0 +1,329 @@
|
|
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
|
+
module Algolia
|
4
|
+
class UsageClient
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(config = nil)
|
8
|
+
raise '`config` is missing.' if config.nil?
|
9
|
+
raise '`app_id` is missing.' if config.app_id.nil? || config.app_id == ''
|
10
|
+
raise '`api_key` is missing.' if config.api_key.nil? || config.api_key == ''
|
11
|
+
|
12
|
+
@api_client = Algolia::ApiClient.new(config)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.create(app_id, api_key, opts = {})
|
16
|
+
hosts = []
|
17
|
+
hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ)
|
18
|
+
hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE)
|
19
|
+
|
20
|
+
hosts += 1.upto(3).map do |i|
|
21
|
+
Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE)
|
22
|
+
end.shuffle
|
23
|
+
|
24
|
+
config = Algolia::Configuration.new(app_id, api_key, hosts, 'Usage', opts)
|
25
|
+
create_with_config(config)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.create_with_config(config)
|
29
|
+
new(config)
|
30
|
+
end
|
31
|
+
|
32
|
+
# This method allow you to send requests to the Algolia REST API.
|
33
|
+
|
34
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
35
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
36
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
37
|
+
# @return [Http::Response] the response
|
38
|
+
def custom_delete_with_http_info(path, parameters = nil, request_options = {})
|
39
|
+
# verify the required parameter 'path' is set
|
40
|
+
if @api_client.config.client_side_validation && path.nil?
|
41
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
|
42
|
+
end
|
43
|
+
|
44
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
45
|
+
query_params = {}
|
46
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
47
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
48
|
+
header_params = {}
|
49
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
50
|
+
|
51
|
+
post_body = request_options[:debug_body]
|
52
|
+
|
53
|
+
new_options = request_options.merge(
|
54
|
+
:operation => :'UsageClient.custom_delete',
|
55
|
+
:header_params => header_params,
|
56
|
+
:query_params => query_params,
|
57
|
+
:body => post_body,
|
58
|
+
:use_read_transporter => false
|
59
|
+
)
|
60
|
+
|
61
|
+
@api_client.call_api(:DELETE, path, new_options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# This method allow you to send requests to the Algolia REST API.
|
65
|
+
|
66
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
67
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
68
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
69
|
+
# @return [Object]
|
70
|
+
def custom_delete(path, parameters = nil, request_options = {})
|
71
|
+
response = custom_delete_with_http_info(path, parameters, request_options)
|
72
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
73
|
+
end
|
74
|
+
|
75
|
+
# This method allow you to send requests to the Algolia REST API.
|
76
|
+
|
77
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
78
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
79
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
80
|
+
# @return [Http::Response] the response
|
81
|
+
def custom_get_with_http_info(path, parameters = nil, request_options = {})
|
82
|
+
# verify the required parameter 'path' is set
|
83
|
+
if @api_client.config.client_side_validation && path.nil?
|
84
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
|
85
|
+
end
|
86
|
+
|
87
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
88
|
+
query_params = {}
|
89
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
90
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
91
|
+
header_params = {}
|
92
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
93
|
+
|
94
|
+
post_body = request_options[:debug_body]
|
95
|
+
|
96
|
+
new_options = request_options.merge(
|
97
|
+
:operation => :'UsageClient.custom_get',
|
98
|
+
:header_params => header_params,
|
99
|
+
:query_params => query_params,
|
100
|
+
:body => post_body,
|
101
|
+
:use_read_transporter => false
|
102
|
+
)
|
103
|
+
|
104
|
+
@api_client.call_api(:GET, path, new_options)
|
105
|
+
end
|
106
|
+
|
107
|
+
# This method allow you to send requests to the Algolia REST API.
|
108
|
+
|
109
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
110
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
111
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
112
|
+
# @return [Object]
|
113
|
+
def custom_get(path, parameters = nil, request_options = {})
|
114
|
+
response = custom_get_with_http_info(path, parameters, request_options)
|
115
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
116
|
+
end
|
117
|
+
|
118
|
+
# This method allow you to send requests to the Algolia REST API.
|
119
|
+
|
120
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
121
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
122
|
+
# @param body [Object] Parameters to send with the custom request.
|
123
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
124
|
+
# @return [Http::Response] the response
|
125
|
+
def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
126
|
+
# verify the required parameter 'path' is set
|
127
|
+
if @api_client.config.client_side_validation && path.nil?
|
128
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
|
129
|
+
end
|
130
|
+
|
131
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
132
|
+
query_params = {}
|
133
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
134
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
135
|
+
header_params = {}
|
136
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
137
|
+
|
138
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
139
|
+
|
140
|
+
new_options = request_options.merge(
|
141
|
+
:operation => :'UsageClient.custom_post',
|
142
|
+
:header_params => header_params,
|
143
|
+
:query_params => query_params,
|
144
|
+
:body => post_body,
|
145
|
+
:use_read_transporter => false
|
146
|
+
)
|
147
|
+
|
148
|
+
@api_client.call_api(:POST, path, new_options)
|
149
|
+
end
|
150
|
+
|
151
|
+
# This method allow you to send requests to the Algolia REST API.
|
152
|
+
|
153
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
154
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
155
|
+
# @param body [Object] Parameters to send with the custom request.
|
156
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
157
|
+
# @return [Object]
|
158
|
+
def custom_post(path, parameters = nil, body = nil, request_options = {})
|
159
|
+
response = custom_post_with_http_info(path, parameters, body, request_options)
|
160
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
161
|
+
end
|
162
|
+
|
163
|
+
# This method allow you to send requests to the Algolia REST API.
|
164
|
+
|
165
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
166
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
167
|
+
# @param body [Object] Parameters to send with the custom request.
|
168
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
169
|
+
# @return [Http::Response] the response
|
170
|
+
def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
171
|
+
# verify the required parameter 'path' is set
|
172
|
+
if @api_client.config.client_side_validation && path.nil?
|
173
|
+
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
|
174
|
+
end
|
175
|
+
|
176
|
+
path = '/{path}'.sub('{' + 'path' + '}', path.to_s)
|
177
|
+
query_params = {}
|
178
|
+
query_params = query_params.merge(parameters) unless parameters.nil?
|
179
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
180
|
+
header_params = {}
|
181
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
182
|
+
|
183
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
184
|
+
|
185
|
+
new_options = request_options.merge(
|
186
|
+
:operation => :'UsageClient.custom_put',
|
187
|
+
:header_params => header_params,
|
188
|
+
:query_params => query_params,
|
189
|
+
:body => post_body,
|
190
|
+
:use_read_transporter => false
|
191
|
+
)
|
192
|
+
|
193
|
+
@api_client.call_api(:PUT, path, new_options)
|
194
|
+
end
|
195
|
+
|
196
|
+
# This method allow you to send requests to the Algolia REST API.
|
197
|
+
|
198
|
+
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
199
|
+
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
200
|
+
# @param body [Object] Parameters to send with the custom request.
|
201
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
202
|
+
# @return [Object]
|
203
|
+
def custom_put(path, parameters = nil, body = nil, request_options = {})
|
204
|
+
response = custom_put_with_http_info(path, parameters, body, request_options)
|
205
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Object')
|
206
|
+
end
|
207
|
+
|
208
|
+
# Retrieves the selected usage statistics for one index.
|
209
|
+
|
210
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
211
|
+
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
212
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
213
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
214
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
215
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
216
|
+
# @return [Http::Response] the response
|
217
|
+
def get_index_usage_with_http_info(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
|
218
|
+
# verify the required parameter 'statistic' is set
|
219
|
+
if @api_client.config.client_side_validation && statistic.nil?
|
220
|
+
raise ArgumentError, "Parameter `statistic` is required when calling `get_index_usage`."
|
221
|
+
end
|
222
|
+
# verify the required parameter 'index_name' is set
|
223
|
+
if @api_client.config.client_side_validation && index_name.nil?
|
224
|
+
raise ArgumentError, "Parameter `index_name` is required when calling `get_index_usage`."
|
225
|
+
end
|
226
|
+
# verify the required parameter 'start_date' is set
|
227
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
228
|
+
raise ArgumentError, "Parameter `start_date` is required when calling `get_index_usage`."
|
229
|
+
end
|
230
|
+
# verify the required parameter 'end_date' is set
|
231
|
+
if @api_client.config.client_side_validation && end_date.nil?
|
232
|
+
raise ArgumentError, "Parameter `end_date` is required when calling `get_index_usage`."
|
233
|
+
end
|
234
|
+
|
235
|
+
path = '/1/usage/{statistic}/{indexName}'.sub('{' + 'statistic' + '}', Transport.encode_uri(statistic.to_s)).sub('{' + 'indexName' + '}',
|
236
|
+
Transport.encode_uri(index_name.to_s))
|
237
|
+
query_params = {}
|
238
|
+
query_params[:startDate] = start_date
|
239
|
+
query_params[:endDate] = end_date
|
240
|
+
query_params[:granularity] = granularity unless granularity.nil?
|
241
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
242
|
+
header_params = {}
|
243
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
244
|
+
|
245
|
+
post_body = request_options[:debug_body]
|
246
|
+
|
247
|
+
new_options = request_options.merge(
|
248
|
+
:operation => :'UsageClient.get_index_usage',
|
249
|
+
:header_params => header_params,
|
250
|
+
:query_params => query_params,
|
251
|
+
:body => post_body,
|
252
|
+
:use_read_transporter => false
|
253
|
+
)
|
254
|
+
|
255
|
+
@api_client.call_api(:GET, path, new_options)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Retrieves the selected usage statistics for one index.
|
259
|
+
|
260
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
261
|
+
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
262
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
263
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
264
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
265
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
266
|
+
# @return [GetUsage200Response]
|
267
|
+
def get_index_usage(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
|
268
|
+
response = get_index_usage_with_http_info(statistic, index_name, start_date, end_date, granularity, request_options)
|
269
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Usage::GetUsage200Response')
|
270
|
+
end
|
271
|
+
|
272
|
+
# Retrieves usage statistics evaluated over a specified period.
|
273
|
+
|
274
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
275
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
276
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
277
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
278
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
279
|
+
# @return [Http::Response] the response
|
280
|
+
def get_usage_with_http_info(statistic, start_date, end_date, granularity = nil, request_options = {})
|
281
|
+
# verify the required parameter 'statistic' is set
|
282
|
+
if @api_client.config.client_side_validation && statistic.nil?
|
283
|
+
raise ArgumentError, "Parameter `statistic` is required when calling `get_usage`."
|
284
|
+
end
|
285
|
+
# verify the required parameter 'start_date' is set
|
286
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
287
|
+
raise ArgumentError, "Parameter `start_date` is required when calling `get_usage`."
|
288
|
+
end
|
289
|
+
# verify the required parameter 'end_date' is set
|
290
|
+
if @api_client.config.client_side_validation && end_date.nil?
|
291
|
+
raise ArgumentError, "Parameter `end_date` is required when calling `get_usage`."
|
292
|
+
end
|
293
|
+
|
294
|
+
path = '/1/usage/{statistic}'.sub('{' + 'statistic' + '}', Transport.encode_uri(statistic.to_s))
|
295
|
+
query_params = {}
|
296
|
+
query_params[:startDate] = start_date
|
297
|
+
query_params[:endDate] = end_date
|
298
|
+
query_params[:granularity] = granularity unless granularity.nil?
|
299
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
300
|
+
header_params = {}
|
301
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
302
|
+
|
303
|
+
post_body = request_options[:debug_body]
|
304
|
+
|
305
|
+
new_options = request_options.merge(
|
306
|
+
:operation => :'UsageClient.get_usage',
|
307
|
+
:header_params => header_params,
|
308
|
+
:query_params => query_params,
|
309
|
+
:body => post_body,
|
310
|
+
:use_read_transporter => false
|
311
|
+
)
|
312
|
+
|
313
|
+
@api_client.call_api(:GET, path, new_options)
|
314
|
+
end
|
315
|
+
|
316
|
+
# Retrieves usage statistics evaluated over a specified period.
|
317
|
+
|
318
|
+
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
319
|
+
# @param start_date [String] Start date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
320
|
+
# @param end_date [String] End date of the period to analyze, in `YYYY-MM-DD` format. (required)
|
321
|
+
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
322
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
323
|
+
# @return [GetUsage200Response]
|
324
|
+
def get_usage(statistic, start_date, end_date, granularity = nil, request_options = {})
|
325
|
+
response = get_usage_with_http_info(statistic, start_date, end_date, granularity, request_options)
|
326
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Usage::GetUsage200Response')
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
@@ -6,42 +6,60 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Abtesting
|
8
8
|
class ABTest
|
9
|
-
# Unique A/B test
|
9
|
+
# Unique A/B test identifier.
|
10
10
|
attr_accessor :ab_test_id
|
11
11
|
|
12
|
-
# [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on click data. A value of 0.95 or over is considered to be _significant_.
|
13
12
|
attr_accessor :click_significance
|
14
13
|
|
15
|
-
# [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on conversion. A value of 0.95 or over is considered to be _significant_.
|
16
14
|
attr_accessor :conversion_significance
|
17
15
|
|
18
|
-
# [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on add-to-cart data. A value of 0.95 or over is considered to be _significant_.
|
19
16
|
attr_accessor :add_to_cart_significance
|
20
17
|
|
21
|
-
# [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on purchase data. A value of 0.95 or over is considered to be _significant_.
|
22
18
|
attr_accessor :purchase_significance
|
23
19
|
|
24
|
-
# [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on revenue data. A value of 0.95 or over is considered to be _significant_.
|
25
20
|
attr_accessor :revenue_significance
|
26
21
|
|
27
|
-
#
|
22
|
+
# Date and time when the A/B test was last updated, in RFC 3339 format.
|
28
23
|
attr_accessor :updated_at
|
29
24
|
|
30
|
-
#
|
25
|
+
# Date and time when the A/B test was created, in RFC 3339 format.
|
31
26
|
attr_accessor :created_at
|
32
27
|
|
33
|
-
# End date
|
28
|
+
# End date and time of the A/B test, in RFC 3339 format.
|
34
29
|
attr_accessor :end_at
|
35
30
|
|
36
31
|
# A/B test name.
|
37
32
|
attr_accessor :name
|
38
33
|
|
39
|
-
# A/B test status.
|
40
34
|
attr_accessor :status
|
41
35
|
|
42
|
-
# A/B test variants.
|
36
|
+
# A/B test variants. The first variant is your _control_ index, typically your production index. The second variant is an index with changed settings that you want to test against the control.
|
43
37
|
attr_accessor :variants
|
44
38
|
|
39
|
+
attr_accessor :configuration
|
40
|
+
|
41
|
+
class EnumAttributeValidator
|
42
|
+
attr_reader :datatype
|
43
|
+
attr_reader :allowable_values
|
44
|
+
|
45
|
+
def initialize(datatype, allowable_values)
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
47
|
+
case datatype.to_s
|
48
|
+
when /Integer/i
|
49
|
+
value.to_i
|
50
|
+
when /Float/i
|
51
|
+
value.to_f
|
52
|
+
else
|
53
|
+
value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def valid?(value)
|
59
|
+
!value || allowable_values.include?(value)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
45
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
46
64
|
def self.attribute_map
|
47
65
|
{
|
@@ -56,7 +74,8 @@ module Algolia
|
|
56
74
|
:end_at => :endAt,
|
57
75
|
:name => :name,
|
58
76
|
:status => :status,
|
59
|
-
:variants => :variants
|
77
|
+
:variants => :variants,
|
78
|
+
:configuration => :configuration
|
60
79
|
}
|
61
80
|
end
|
62
81
|
|
@@ -78,8 +97,9 @@ module Algolia
|
|
78
97
|
:created_at => :String,
|
79
98
|
:end_at => :String,
|
80
99
|
:name => :String,
|
81
|
-
:status => :
|
82
|
-
:variants => :'Array<Variant>'
|
100
|
+
:status => :Status,
|
101
|
+
:variants => :'Array<Variant>',
|
102
|
+
:configuration => :ABTestConfiguration
|
83
103
|
}
|
84
104
|
end
|
85
105
|
|
@@ -186,6 +206,10 @@ module Algolia
|
|
186
206
|
else
|
187
207
|
self.variants = nil
|
188
208
|
end
|
209
|
+
|
210
|
+
if attributes.key?(:configuration)
|
211
|
+
self.configuration = attributes[:configuration]
|
212
|
+
end
|
189
213
|
end
|
190
214
|
|
191
215
|
# Checks equality by comparing each attribute.
|
@@ -205,7 +229,8 @@ module Algolia
|
|
205
229
|
end_at == other.end_at &&
|
206
230
|
name == other.name &&
|
207
231
|
status == other.status &&
|
208
|
-
variants == other.variants
|
232
|
+
variants == other.variants &&
|
233
|
+
configuration == other.configuration
|
209
234
|
end
|
210
235
|
|
211
236
|
# @see the `==` method
|
@@ -218,7 +243,7 @@ module Algolia
|
|
218
243
|
# @return [Integer] Hash code
|
219
244
|
def hash
|
220
245
|
[ab_test_id, click_significance, conversion_significance, add_to_cart_significance, purchase_significance, revenue_significance, updated_at, created_at, end_at, name,
|
221
|
-
status, variants].hash
|
246
|
+
status, variants, configuration].hash
|
222
247
|
end
|
223
248
|
|
224
249
|
# Builds the object from hash
|