lib/algolia/api/analytics_client.rb in algolia-3.0.0.alpha.12 vs lib/algolia/api/analytics_client.rb in algolia-3.0.0.alpha.13
- old
+ new
@@ -212,32 +212,22 @@
# Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_average_click_position_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_average_click_position`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_average_click_position, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_average_click_position, must conform to the pattern #{pattern}."
- end
-
path = '/2/clicks/averageClickPosition'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -261,13 +251,13 @@
# Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetAverageClickPositionResponse]
def get_average_click_position(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_average_click_position_with_http_info(index, start_date, end_date, tags, request_options)
@@ -276,32 +266,22 @@
# Show the number of clicks events and their associated position in the search results. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_click_positions_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_click_positions`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_click_positions, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_click_positions, must conform to the pattern #{pattern}."
- end
-
path = '/2/clicks/positions'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -325,13 +305,13 @@
# Show the number of clicks events and their associated position in the search results. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetClickPositionsResponse]
def get_click_positions(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_click_positions_with_http_info(index, start_date, end_date, tags, request_options)
@@ -340,32 +320,22 @@
# Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_click_through_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_click_through_rate`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_click_through_rate, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_click_through_rate, must conform to the pattern #{pattern}."
- end
-
path = '/2/clicks/clickThroughRate'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -389,13 +359,13 @@
# Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetClickThroughRateResponse]
def get_click_through_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_click_through_rate_with_http_info(index, start_date, end_date, tags, request_options)
@@ -404,32 +374,22 @@
# Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_conversation_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_conversation_rate`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_conversation_rate, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_conversation_rate, must conform to the pattern #{pattern}."
- end
-
path = '/2/conversions/conversionRate'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -453,13 +413,13 @@
# Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetConversationRateResponse]
def get_conversation_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_conversation_rate_with_http_info(index, start_date, end_date, tags, request_options)
@@ -468,32 +428,22 @@
# Returns the rate at which searches don't lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_no_click_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_no_click_rate`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_no_click_rate, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_no_click_rate, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches/noClickRate'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -517,13 +467,13 @@
# Returns the rate at which searches don't lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetNoClickRateResponse]
def get_no_click_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_no_click_rate_with_http_info(index, start_date, end_date, tags, request_options)
@@ -532,32 +482,22 @@
# Returns the rate at which searches didn't return any results.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_no_results_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_no_results_rate`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_no_results_rate, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_no_results_rate, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches/noResultRate'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -581,13 +521,13 @@
# Returns the rate at which searches didn't return any results.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetNoResultsRateResponse]
def get_no_results_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_no_results_rate_with_http_info(index, start_date, end_date, tags, request_options)
@@ -596,32 +536,22 @@
# Returns the number of searches within a time range.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_searches_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_searches_count`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_searches_count, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_searches_count, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches/count'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -645,13 +575,13 @@
# Returns the number of searches within a time range.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetSearchesCountResponse]
def get_searches_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_searches_count_with_http_info(index, start_date, end_date, tags, request_options)
@@ -660,34 +590,27 @@
# Return the most popular of the last 1,000 searches that didn't lead to any clicks.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_searches_no_clicks_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_clicks`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_searches_no_clicks, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_searches_no_clicks, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_searches_no_clicks, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches/noClicks'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -713,15 +636,15 @@
# Return the most popular of the last 1,000 searches that didn't lead to any clicks.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetSearchesNoClicksResponse]
def get_searches_no_clicks(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_searches_no_clicks_with_http_info(index, start_date, end_date, limit, offset, tags, request_options)
@@ -730,34 +653,27 @@
# Returns the most popular of the latest 1,000 searches that didn't return any results.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_searches_no_results_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_results`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_searches_no_results, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_searches_no_results, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_searches_no_results, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches/noResults'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -783,15 +699,15 @@
# Returns the most popular of the latest 1,000 searches that didn't return any results.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetSearchesNoResultsResponse]
def get_searches_no_results(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_searches_no_results_with_http_info(index, start_date, end_date, limit, offset, tags, request_options)
@@ -800,11 +716,11 @@
# Return the latest update time of the Analytics API for an index. If the index has been recently created or no search has been performed yet, `updatedAt` will be `null`. > **Note**: The Analytics API is updated every 5&nbsp;minutes.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @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)
# @return [Http::Response] the response
def get_status_with_http_info(index, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
@@ -833,11 +749,11 @@
# Return the latest update time of the Analytics API for an index. If the index has been recently created or no search has been performed yet, `updatedAt` will be `null`. > **Note**: The Analytics API is updated every 5 minutes.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @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)
# @return [GetStatusResponse]
def get_status(index, request_options = {})
response = get_status_with_http_info(index, request_options)
@api_client.deserialize(response.body, request_options[:debug_return_type] || 'Analytics::GetStatusResponse')
@@ -845,34 +761,27 @@
# Returns top countries. Limited to the 1,000 most frequent ones.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_countries_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_countries`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_countries, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_countries, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_countries, must conform to the pattern #{pattern}."
- end
-
path = '/2/countries'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -898,15 +807,15 @@
# Returns top countries. Limited to the 1,000 most frequent ones.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopCountriesResponse]
def get_top_countries(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_top_countries_with_http_info(index, start_date, end_date, limit, offset, tags, request_options)
@@ -915,35 +824,28 @@
# Return the most popular [filterable attributes](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) in the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_filter_attributes_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_attributes`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_filter_attributes, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_filter_attributes, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_filter_attributes, must conform to the pattern #{pattern}."
- end
-
path = '/2/filters'
query_params = {}
query_params[:index] = index
query_params[:search] = search unless search.nil?
query_params[:startDate] = start_date unless start_date.nil?
@@ -970,16 +872,16 @@
# Return the most popular [filterable attributes](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) in the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopFilterAttributesResponse]
def get_top_filter_attributes(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_top_filter_attributes_with_http_info(index, search, start_date, end_date, limit, offset, tags, request_options)
@@ -989,16 +891,16 @@
# Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
# @param attribute [String] Attribute name. (required)
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_filter_for_attribute_with_http_info(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'attribute' is set
@@ -1007,21 +909,14 @@
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_for_attribute`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_filter_for_attribute, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_filter_for_attribute, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_filter_for_attribute, must conform to the pattern #{pattern}."
- end
-
path = '/2/filters/{attribute}'.sub('{' + 'attribute' + '}', Transport.encode_uri(attribute.to_s))
query_params = {}
query_params[:index] = index
query_params[:search] = search unless search.nil?
query_params[:startDate] = start_date unless start_date.nil?
@@ -1049,16 +944,16 @@
# Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
# @param attribute [String] Attribute name. (required)
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopFilterForAttributeResponse]
def get_top_filter_for_attribute(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_top_filter_for_attribute_with_http_info(attribute, index, search, start_date, end_date, limit, offset, tags, request_options)
@@ -1067,35 +962,28 @@
# Returns top filters for filter-enabled searches that don't return results. Limited to the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_filters_no_results_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_filters_no_results`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_filters_no_results, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_filters_no_results, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_filters_no_results, must conform to the pattern #{pattern}."
- end
-
path = '/2/filters/noResults'
query_params = {}
query_params[:index] = index
query_params[:search] = search unless search.nil?
query_params[:startDate] = start_date unless start_date.nil?
@@ -1122,16 +1010,16 @@
# Returns top filters for filter-enabled searches that don't return results. Limited to the 1,000 most recently used filters.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopFiltersNoResultsResponse]
def get_top_filters_no_results(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_top_filters_no_results_with_http_info(index, search, start_date, end_date, limit, offset, tags, request_options)
@@ -1140,36 +1028,29 @@
# Return the most popular clicked results in the last 1,000 searches.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
# @param click_analytics [Boolean] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. (default to false)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_hits_with_http_info(index, search = nil, click_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_hits`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_hits, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_hits, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_hits, must conform to the pattern #{pattern}."
- end
-
path = '/2/hits'
query_params = {}
query_params[:index] = index
query_params[:search] = search unless search.nil?
query_params[:clickAnalytics] = click_analytics unless click_analytics.nil?
@@ -1197,17 +1078,17 @@
# Return the most popular clicked results in the last 1,000 searches.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param search [String] User query.
# @param click_analytics [Boolean] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. (default to false)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopHitsResponse]
def get_top_hits(index, search = nil, click_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {})
response = get_top_hits_with_http_info(index, search, click_analytics, start_date, end_date, limit, offset, tags, request_options)
@@ -1216,38 +1097,31 @@
# Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param click_analytics [Boolean] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. (default to false)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param order_by [OrderBy] Reorder the results. (default to 'searchCount')
# @param direction [Direction] Sorting direction of the results: ascending or descending. (default to 'asc')
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_top_searches_with_http_info(index, click_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil,
request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_top_searches`."
end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_top_searches, must conform to the pattern #{pattern}."
+ if @api_client.config.client_side_validation && !offset.nil? && offset < 0
+ raise ArgumentError, 'invalid value for ""offset"" when calling AnalyticsClient.get_top_searches, must be greater than or equal to 0.'
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_top_searches, must conform to the pattern #{pattern}."
- end
-
path = '/2/searches'
query_params = {}
query_params[:index] = index
query_params[:clickAnalytics] = click_analytics unless click_analytics.nil?
query_params[:startDate] = start_date unless start_date.nil?
@@ -1276,18 +1150,18 @@
# Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
+ # @param index [String] Index name. (required)
# @param click_analytics [Boolean] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. (default to false)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param order_by [OrderBy] Reorder the results. (default to 'searchCount')
# @param direction [Direction] Sorting direction of the results: ascending or descending. (default to 'asc')
- # @param limit [Integer] Number of records to return (page size). (default to 10)
- # @param offset [Integer] Position of the starting record. Used for paging. 0 is the first record. (default to 0)
+ # @param limit [Integer] Number of items to return. (default to 10)
+ # @param offset [Integer] Position of the first item to return. (default to 0)
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetTopSearchesResponse]
def get_top_searches(index, click_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil,
request_options = {})
@@ -1297,32 +1171,22 @@
# Return the count of unique users.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [Http::Response] the response
def get_users_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
raise ArgumentError, "Parameter `index` is required when calling `get_users_count`."
end
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !start_date.nil? && start_date !~ pattern
- raise ArgumentError, "invalid value for '\"start_date\"' when calling AnalyticsClient.get_users_count, must conform to the pattern #{pattern}."
- end
-
- pattern = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
- if @api_client.config.client_side_validation && !end_date.nil? && end_date !~ pattern
- raise ArgumentError, "invalid value for '\"end_date\"' when calling AnalyticsClient.get_users_count, must conform to the pattern #{pattern}."
- end
-
path = '/2/users/count'
query_params = {}
query_params[:index] = index
query_params[:startDate] = start_date unless start_date.nil?
query_params[:endDate] = end_date unless end_date.nil?
@@ -1346,12 +1210,12 @@
# Return the count of unique users.
#
# Required API Key ACLs:
# - analytics
- # @param index [String] Index name to target. (required)
- # @param start_date [String] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
- # @param end_date [String] End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
+ # @param index [String] Index name. (required)
+ # @param start_date [String] Start date (`YYYY-MM-DD`) of the period to analyze.
+ # @param end_date [String] End date (`YYYY-MM-DD`) of the period to analyze.
# @param tags [String] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
# @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)
# @return [GetUsersCountResponse]
def get_users_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {})
response = get_users_count_with_http_info(index, start_date, end_date, tags, request_options)