algolia 3.42.3 → 3.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/do-not-edit-this-repository.yml +1 -1
- data/.github/workflows/issue.yml +1 -1
- data/.github/workflows/release.yml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/analytics_client.rb +221 -0
- data/lib/algolia/models/abtesting-v3/ab_test.rb +14 -4
- data/lib/algolia/models/abtesting-v3/decision.rb +219 -0
- data/lib/algolia/models/analytics/bin_edge.rb +109 -0
- data/lib/algolia/models/analytics/catalog.rb +208 -0
- data/lib/algolia/models/analytics/catalog_entry.rb +249 -0
- data/lib/algolia/models/analytics/distribution_definition.rb +243 -0
- data/lib/algolia/models/analytics/distribution_payload.rb +247 -0
- data/lib/algolia/models/analytics/domain_catalog.rb +253 -0
- data/lib/algolia/models/analytics/field_reference.rb +219 -0
- data/lib/algolia/models/analytics/filter_definition.rb +238 -0
- data/lib/algolia/models/analytics/order_definition.rb +230 -0
- data/lib/algolia/models/analytics/order_direction.rb +34 -0
- data/lib/algolia/models/analytics/parameter_definition.rb +230 -0
- data/lib/algolia/models/analytics/parameter_reference.rb +219 -0
- data/lib/algolia/models/analytics/parameter_value.rb +111 -0
- data/lib/algolia/models/analytics/scalar_payload.rb +247 -0
- data/lib/algolia/models/analytics/series.rb +234 -0
- data/lib/algolia/models/analytics/series_date.rb +223 -0
- data/lib/algolia/models/analytics/table_payload.rb +292 -0
- data/lib/algolia/models/analytics/table_response.rb +211 -0
- data/lib/algolia/models/analytics/timeseries_payload.rb +279 -0
- data/lib/algolia/models/analytics/timeseries_response.rb +213 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/events_items.rb +1 -0
- data/lib/algolia/models/insights/instantsearch.rb +269 -0
- data/lib/algolia/models/insights/instantsearch_event.rb +33 -0
- data/lib/algolia/version.rb +1 -1
- metadata +25 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 26e15a7a80471a7a68cf607c70e21c52f1a0f5d12b3a93888d3865f5bc02a257
|
|
4
|
+
data.tar.gz: 0c45427919aef09a76d67b2320ad80908268fb5e9d96a6e9f1510c25b8fab6bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f2f198904f5afb8bc656d3d6f4eadfb37330db685656144c978443b0614aa5faf64718124200fcde6d19234b18e48aa960b173ab9e5222cb04ccc7d1dd2fed7
|
|
7
|
+
data.tar.gz: a4971f5c0ffc4fbddba53281df8763082e659a39f67cb53ffc1b5f76898b8269f4e544575727742d8e048ae4dea79d1b2cfc60639550a38d74203d94572099b9
|
data/.github/workflows/issue.yml
CHANGED
|
@@ -16,14 +16,14 @@ jobs:
|
|
|
16
16
|
id-token: write
|
|
17
17
|
contents: write
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@v7
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
20
|
|
|
21
21
|
- name: Install Ruby
|
|
22
|
-
uses: ruby/setup-ruby@v1
|
|
22
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
23
23
|
with:
|
|
24
|
-
ruby-version: 4.0.
|
|
24
|
+
ruby-version: 4.0.6
|
|
25
25
|
bundler-cache: true
|
|
26
26
|
|
|
27
|
-
- uses: rubygems/release-gem@
|
|
27
|
+
- uses: rubygems/release-gem@052cc82692552de3ef2b81fd670e41d13cba8092 # v1.4.0
|
|
28
28
|
with:
|
|
29
29
|
await-release: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [3.43.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.3...3.43.0)
|
|
2
|
+
|
|
3
|
+
- [3bee6d1dee](https://github.com/algolia/api-clients-automation/commit/3bee6d1dee) chore(ci): pin all GitHub Action refs to commit SHAs (API-475) ([#6819](https://github.com/algolia/api-clients-automation/pull/6819)) by [@MarioAlexandruDan](https://github.com/MarioAlexandruDan/)
|
|
4
|
+
- [22af756864](https://github.com/algolia/api-clients-automation/commit/22af756864) chore(deps): dependencies 2026-07-20 ([#6733](https://github.com/algolia/api-clients-automation/pull/6733)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
|
|
5
|
+
- [1f389d1f7f](https://github.com/algolia/api-clients-automation/commit/1f389d1f7f) feat(specs): add agentic analytics support to insights spec ([#6876](https://github.com/algolia/api-clients-automation/pull/6876)) by [@sirockin](https://github.com/sirockin/)
|
|
6
|
+
- [65cc642811](https://github.com/algolia/api-clients-automation/commit/65cc642811) feat(specs): add decision (declared winner) to abtesting-v3 ABTest ([#6732](https://github.com/algolia/api-clients-automation/pull/6732)) by [@cdhawke](https://github.com/cdhawke/)
|
|
7
|
+
- [637defc23a](https://github.com/algolia/api-clients-automation/commit/637defc23a) feat(specs): add analytics v3 pattern endpoints ([#6795](https://github.com/algolia/api-clients-automation/pull/6795)) by [@Niamsy](https://github.com/Niamsy/)
|
|
8
|
+
- [bed536e149](https://github.com/algolia/api-clients-automation/commit/bed536e149) chore(deps): dependencies 2026-08-10 ([#6835](https://github.com/algolia/api-clients-automation/pull/6835)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
|
|
9
|
+
|
|
1
10
|
## [3.42.3](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.2...3.42.3)
|
|
2
11
|
|
|
3
12
|
- [772f7055cc](https://github.com/algolia/api-clients-automation/commit/772f7055cc) fix(clients): add warning in replace_all_objects for empty objects ([#6610](https://github.com/algolia/api-clients-automation/pull/6610)) by [@eric-zaharia](https://github.com/eric-zaharia/)
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
algolia (3.
|
|
4
|
+
algolia (3.43.0)
|
|
5
5
|
base64 (>= 0.2.0, < 1)
|
|
6
6
|
faraday (>= 1.0.1, < 3.0)
|
|
7
7
|
faraday-net_http_persistent (>= 0.15, < 3)
|
|
@@ -21,7 +21,7 @@ GEM
|
|
|
21
21
|
faraday-net_http_persistent (2.3.1)
|
|
22
22
|
faraday (~> 2.5)
|
|
23
23
|
net-http-persistent (>= 4.0.4, < 5)
|
|
24
|
-
json (2.
|
|
24
|
+
json (2.21.2)
|
|
25
25
|
logger (1.7.0)
|
|
26
26
|
net-http (0.9.1)
|
|
27
27
|
uri (>= 0.11.1)
|
|
@@ -691,6 +691,39 @@ module Algolia
|
|
|
691
691
|
)
|
|
692
692
|
end
|
|
693
693
|
|
|
694
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns the static catalog of analytics fields, grouped by domain and usage (metrics, filters, groups, distributions). No authentication is required. Use it to discover valid `(domain, kind)` pairs before building the other `/3/patterns/*` queries; two fields are combinable in one query only when their `roots` intersect. Each entry's `requires` lists the ACLs needed when that field is actually used in a query.
|
|
695
|
+
|
|
696
|
+
# @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)
|
|
697
|
+
# @return [Http::Response] the response
|
|
698
|
+
def get_patterns_fields_with_http_info(request_options = {})
|
|
699
|
+
path = "/3/patterns/fields"
|
|
700
|
+
query_params = {}
|
|
701
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
|
702
|
+
header_params = {}
|
|
703
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
|
704
|
+
|
|
705
|
+
post_body = request_options[:debug_body]
|
|
706
|
+
|
|
707
|
+
new_options = request_options.merge(
|
|
708
|
+
:operation => :"AnalyticsClient.get_patterns_fields",
|
|
709
|
+
:header_params => header_params,
|
|
710
|
+
:query_params => query_params,
|
|
711
|
+
:body => post_body,
|
|
712
|
+
:use_read_transporter => false
|
|
713
|
+
)
|
|
714
|
+
|
|
715
|
+
@api_client.call_api(:GET, path, new_options)
|
|
716
|
+
end
|
|
717
|
+
|
|
718
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns the static catalog of analytics fields, grouped by domain and usage (metrics, filters, groups, distributions). No authentication is required. Use it to discover valid `(domain, kind)` pairs before building the other `/3/patterns/*` queries; two fields are combinable in one query only when their `roots` intersect. Each entry's `requires` lists the ACLs needed when that field is actually used in a query.
|
|
719
|
+
|
|
720
|
+
# @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)
|
|
721
|
+
# @return [Catalog]
|
|
722
|
+
def get_patterns_fields(request_options = {})
|
|
723
|
+
response = get_patterns_fields_with_http_info(request_options)
|
|
724
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::Catalog")
|
|
725
|
+
end
|
|
726
|
+
|
|
694
727
|
# Retrieves the purchase rate for all your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days, including the current day. The rate is purchase conversion events divided by tracked searches. A search is tracked if it returns a query ID (`clickAnalytics` is `true`). This differs from the response's `count`, which includes searches where `clickAnalytics` is `false`. **There's a difference between a 0 and null purchase rate when `clickAnalytics` is enabled:** - **Null** means there were no queries. Algolia didn't receive any events, so the purchase rate is null. - **0** means there were queries but no [purchase conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started) were received.
|
|
695
728
|
#
|
|
696
729
|
# Required API Key ACLs:
|
|
@@ -1765,5 +1798,193 @@ module Algolia
|
|
|
1765
1798
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::GetUsersCountResponse")
|
|
1766
1799
|
end
|
|
1767
1800
|
|
|
1801
|
+
# **Beta**: this endpoint is under active development and may change without notice. Buckets one or more numeric fields into histograms and returns an object keyed by `histogram<Field>`, each mapping a bin label to a count. `distributions` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1802
|
+
#
|
|
1803
|
+
# Required API Key ACLs:
|
|
1804
|
+
# - analytics
|
|
1805
|
+
# @param distribution_payload [DistributionPayload] (required)
|
|
1806
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1807
|
+
# @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)
|
|
1808
|
+
# @return [Http::Response] the response
|
|
1809
|
+
def query_patterns_distribution_with_http_info(distribution_payload, index = nil, request_options = {})
|
|
1810
|
+
# verify the required parameter 'distribution_payload' is set
|
|
1811
|
+
if @api_client.config.client_side_validation && distribution_payload.nil?
|
|
1812
|
+
raise ArgumentError, "Parameter `distribution_payload` is required when calling `query_patterns_distribution`."
|
|
1813
|
+
end
|
|
1814
|
+
|
|
1815
|
+
path = "/3/patterns/distribution"
|
|
1816
|
+
query_params = {}
|
|
1817
|
+
query_params[:index] = index unless index.nil?
|
|
1818
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
|
1819
|
+
header_params = {}
|
|
1820
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
|
1821
|
+
|
|
1822
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(distribution_payload)
|
|
1823
|
+
|
|
1824
|
+
new_options = request_options.merge(
|
|
1825
|
+
:operation => :"AnalyticsClient.query_patterns_distribution",
|
|
1826
|
+
:header_params => header_params,
|
|
1827
|
+
:query_params => query_params,
|
|
1828
|
+
:body => post_body,
|
|
1829
|
+
:use_read_transporter => false
|
|
1830
|
+
)
|
|
1831
|
+
|
|
1832
|
+
@api_client.call_api(:POST, path, new_options)
|
|
1833
|
+
end
|
|
1834
|
+
|
|
1835
|
+
# **Beta**: this endpoint is under active development and may change without notice. Buckets one or more numeric fields into histograms and returns an object keyed by `histogram<Field>`, each mapping a bin label to a count. `distributions` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1836
|
+
#
|
|
1837
|
+
# Required API Key ACLs:
|
|
1838
|
+
# - analytics
|
|
1839
|
+
# @param distribution_payload [DistributionPayload] (required)
|
|
1840
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1841
|
+
# @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)
|
|
1842
|
+
# @return [Hash<String, Object>]
|
|
1843
|
+
def query_patterns_distribution(distribution_payload, index = nil, request_options = {})
|
|
1844
|
+
response = query_patterns_distribution_with_http_info(distribution_payload, index, request_options)
|
|
1845
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
|
|
1846
|
+
end
|
|
1847
|
+
|
|
1848
|
+
# **Beta**: this endpoint is under active development and may change without notice. Aggregates the requested `metrics` over the whole period and returns a single object keyed by metric kind. `metrics` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1849
|
+
#
|
|
1850
|
+
# Required API Key ACLs:
|
|
1851
|
+
# - analytics
|
|
1852
|
+
# @param scalar_payload [ScalarPayload] (required)
|
|
1853
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1854
|
+
# @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)
|
|
1855
|
+
# @return [Http::Response] the response
|
|
1856
|
+
def query_patterns_scalar_with_http_info(scalar_payload, index = nil, request_options = {})
|
|
1857
|
+
# verify the required parameter 'scalar_payload' is set
|
|
1858
|
+
if @api_client.config.client_side_validation && scalar_payload.nil?
|
|
1859
|
+
raise ArgumentError, "Parameter `scalar_payload` is required when calling `query_patterns_scalar`."
|
|
1860
|
+
end
|
|
1861
|
+
|
|
1862
|
+
path = "/3/patterns/scalar"
|
|
1863
|
+
query_params = {}
|
|
1864
|
+
query_params[:index] = index unless index.nil?
|
|
1865
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
|
1866
|
+
header_params = {}
|
|
1867
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
|
1868
|
+
|
|
1869
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(scalar_payload)
|
|
1870
|
+
|
|
1871
|
+
new_options = request_options.merge(
|
|
1872
|
+
:operation => :"AnalyticsClient.query_patterns_scalar",
|
|
1873
|
+
:header_params => header_params,
|
|
1874
|
+
:query_params => query_params,
|
|
1875
|
+
:body => post_body,
|
|
1876
|
+
:use_read_transporter => false
|
|
1877
|
+
)
|
|
1878
|
+
|
|
1879
|
+
@api_client.call_api(:POST, path, new_options)
|
|
1880
|
+
end
|
|
1881
|
+
|
|
1882
|
+
# **Beta**: this endpoint is under active development and may change without notice. Aggregates the requested `metrics` over the whole period and returns a single object keyed by metric kind. `metrics` and `parameters` are required; `filters` is optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1883
|
+
#
|
|
1884
|
+
# Required API Key ACLs:
|
|
1885
|
+
# - analytics
|
|
1886
|
+
# @param scalar_payload [ScalarPayload] (required)
|
|
1887
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1888
|
+
# @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)
|
|
1889
|
+
# @return [Hash<String, Object>]
|
|
1890
|
+
def query_patterns_scalar(scalar_payload, index = nil, request_options = {})
|
|
1891
|
+
response = query_patterns_scalar_with_http_info(scalar_payload, index, request_options)
|
|
1892
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Object>")
|
|
1893
|
+
end
|
|
1894
|
+
|
|
1895
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns `rows`, each a flat object of the requested fields. `metrics` and `parameters` are required; `groupBy`, `filters`, and `orderBy` are optional, though `orderBy` is required when `groupBy` is set. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1896
|
+
#
|
|
1897
|
+
# Required API Key ACLs:
|
|
1898
|
+
# - analytics
|
|
1899
|
+
# @param table_payload [TablePayload] (required)
|
|
1900
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1901
|
+
# @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)
|
|
1902
|
+
# @return [Http::Response] the response
|
|
1903
|
+
def query_patterns_table_with_http_info(table_payload, index = nil, request_options = {})
|
|
1904
|
+
# verify the required parameter 'table_payload' is set
|
|
1905
|
+
if @api_client.config.client_side_validation && table_payload.nil?
|
|
1906
|
+
raise ArgumentError, "Parameter `table_payload` is required when calling `query_patterns_table`."
|
|
1907
|
+
end
|
|
1908
|
+
|
|
1909
|
+
path = "/3/patterns/table"
|
|
1910
|
+
query_params = {}
|
|
1911
|
+
query_params[:index] = index unless index.nil?
|
|
1912
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
|
1913
|
+
header_params = {}
|
|
1914
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
|
1915
|
+
|
|
1916
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(table_payload)
|
|
1917
|
+
|
|
1918
|
+
new_options = request_options.merge(
|
|
1919
|
+
:operation => :"AnalyticsClient.query_patterns_table",
|
|
1920
|
+
:header_params => header_params,
|
|
1921
|
+
:query_params => query_params,
|
|
1922
|
+
:body => post_body,
|
|
1923
|
+
:use_read_transporter => false
|
|
1924
|
+
)
|
|
1925
|
+
|
|
1926
|
+
@api_client.call_api(:POST, path, new_options)
|
|
1927
|
+
end
|
|
1928
|
+
|
|
1929
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns `rows`, each a flat object of the requested fields. `metrics` and `parameters` are required; `groupBy`, `filters`, and `orderBy` are optional, though `orderBy` is required when `groupBy` is set. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1930
|
+
#
|
|
1931
|
+
# Required API Key ACLs:
|
|
1932
|
+
# - analytics
|
|
1933
|
+
# @param table_payload [TablePayload] (required)
|
|
1934
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1935
|
+
# @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)
|
|
1936
|
+
# @return [TableResponse]
|
|
1937
|
+
def query_patterns_table(table_payload, index = nil, request_options = {})
|
|
1938
|
+
response = query_patterns_table_with_http_info(table_payload, index, request_options)
|
|
1939
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::TableResponse")
|
|
1940
|
+
end
|
|
1941
|
+
|
|
1942
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns one time series per `groupBy` combination, each with period `totals` and a per-day metric breakdown. `metrics` and `parameters` are required; `groupBy` and `filters` are optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1943
|
+
#
|
|
1944
|
+
# Required API Key ACLs:
|
|
1945
|
+
# - analytics
|
|
1946
|
+
# @param timeseries_payload [TimeseriesPayload] (required)
|
|
1947
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1948
|
+
# @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)
|
|
1949
|
+
# @return [Http::Response] the response
|
|
1950
|
+
def query_patterns_timeseries_with_http_info(timeseries_payload, index = nil, request_options = {})
|
|
1951
|
+
# verify the required parameter 'timeseries_payload' is set
|
|
1952
|
+
if @api_client.config.client_side_validation && timeseries_payload.nil?
|
|
1953
|
+
raise ArgumentError, "Parameter `timeseries_payload` is required when calling `query_patterns_timeseries`."
|
|
1954
|
+
end
|
|
1955
|
+
|
|
1956
|
+
path = "/3/patterns/timeseries"
|
|
1957
|
+
query_params = {}
|
|
1958
|
+
query_params[:index] = index unless index.nil?
|
|
1959
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
|
1960
|
+
header_params = {}
|
|
1961
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
|
1962
|
+
|
|
1963
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(timeseries_payload)
|
|
1964
|
+
|
|
1965
|
+
new_options = request_options.merge(
|
|
1966
|
+
:operation => :"AnalyticsClient.query_patterns_timeseries",
|
|
1967
|
+
:header_params => header_params,
|
|
1968
|
+
:query_params => query_params,
|
|
1969
|
+
:body => post_body,
|
|
1970
|
+
:use_read_transporter => false
|
|
1971
|
+
)
|
|
1972
|
+
|
|
1973
|
+
@api_client.call_api(:POST, path, new_options)
|
|
1974
|
+
end
|
|
1975
|
+
|
|
1976
|
+
# **Beta**: this endpoint is under active development and may change without notice. Returns one time series per `groupBy` combination, each with period `totals` and a per-day metric breakdown. `metrics` and `parameters` are required; `groupBy` and `filters` are optional. Discover valid field kinds per domain with `/3/patterns/fields`.
|
|
1977
|
+
#
|
|
1978
|
+
# Required API Key ACLs:
|
|
1979
|
+
# - analytics
|
|
1980
|
+
# @param timeseries_payload [TimeseriesPayload] (required)
|
|
1981
|
+
# @param index [String] Comma-separated list of indices the request runs on, used for authorization. Required for index-restricted API keys and must match the indices supplied in the request body's `indices` parameter; optional for unrestricted keys.
|
|
1982
|
+
# @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)
|
|
1983
|
+
# @return [TimeseriesResponse]
|
|
1984
|
+
def query_patterns_timeseries(timeseries_payload, index = nil, request_options = {})
|
|
1985
|
+
response = query_patterns_timeseries_with_http_info(timeseries_payload, index, request_options)
|
|
1986
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Analytics::TimeseriesResponse")
|
|
1987
|
+
end
|
|
1988
|
+
|
|
1768
1989
|
end
|
|
1769
1990
|
end
|
|
@@ -36,6 +36,8 @@ module Algolia
|
|
|
36
36
|
# Unique migrated A/B test identifier.
|
|
37
37
|
attr_accessor :migrated_ab_test_id
|
|
38
38
|
|
|
39
|
+
attr_accessor :decision
|
|
40
|
+
|
|
39
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
42
|
def self.attribute_map
|
|
41
43
|
{
|
|
@@ -48,7 +50,8 @@ module Algolia
|
|
|
48
50
|
:status => :status,
|
|
49
51
|
:variants => :variants,
|
|
50
52
|
:configuration => :configuration,
|
|
51
|
-
:migrated_ab_test_id => :migratedAbTestID
|
|
53
|
+
:migrated_ab_test_id => :migratedAbTestID,
|
|
54
|
+
:decision => :decision
|
|
52
55
|
}
|
|
53
56
|
end
|
|
54
57
|
|
|
@@ -64,7 +67,8 @@ module Algolia
|
|
|
64
67
|
:status => :"Status",
|
|
65
68
|
:variants => :"Array<Variant>",
|
|
66
69
|
:configuration => :"ABTestConfiguration",
|
|
67
|
-
:migrated_ab_test_id => :"Integer"
|
|
70
|
+
:migrated_ab_test_id => :"Integer",
|
|
71
|
+
:decision => :"Decision"
|
|
68
72
|
}
|
|
69
73
|
end
|
|
70
74
|
|
|
@@ -152,6 +156,10 @@ module Algolia
|
|
|
152
156
|
if attributes.key?(:migrated_ab_test_id)
|
|
153
157
|
self.migrated_ab_test_id = attributes[:migrated_ab_test_id]
|
|
154
158
|
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:decision)
|
|
161
|
+
self.decision = attributes[:decision]
|
|
162
|
+
end
|
|
155
163
|
end
|
|
156
164
|
|
|
157
165
|
# Checks equality by comparing each attribute.
|
|
@@ -168,7 +176,8 @@ module Algolia
|
|
|
168
176
|
status == other.status &&
|
|
169
177
|
variants == other.variants &&
|
|
170
178
|
configuration == other.configuration &&
|
|
171
|
-
migrated_ab_test_id == other.migrated_ab_test_id
|
|
179
|
+
migrated_ab_test_id == other.migrated_ab_test_id &&
|
|
180
|
+
decision == other.decision
|
|
172
181
|
end
|
|
173
182
|
|
|
174
183
|
# @see the `==` method
|
|
@@ -190,7 +199,8 @@ module Algolia
|
|
|
190
199
|
status,
|
|
191
200
|
variants,
|
|
192
201
|
configuration,
|
|
193
|
-
migrated_ab_test_id
|
|
202
|
+
migrated_ab_test_id,
|
|
203
|
+
decision
|
|
194
204
|
].hash
|
|
195
205
|
end
|
|
196
206
|
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# 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.
|
|
4
|
+
|
|
5
|
+
require "date"
|
|
6
|
+
require "time"
|
|
7
|
+
|
|
8
|
+
module Algolia
|
|
9
|
+
module AbtestingV3
|
|
10
|
+
# Outcome of the A/B test once a winner has been declared. Only present when a winning variant has been declared, so its presence indicates the test has been decided.
|
|
11
|
+
class Decision
|
|
12
|
+
# Identifier of the declared winning variant. The control variant is 1.
|
|
13
|
+
attr_accessor :winner_variant_id
|
|
14
|
+
|
|
15
|
+
# Date and time when the winning variant was declared, in RFC 3339 format.
|
|
16
|
+
attr_accessor :declared_at
|
|
17
|
+
|
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
19
|
+
def self.attribute_map
|
|
20
|
+
{
|
|
21
|
+
:winner_variant_id => :winnerVariantId,
|
|
22
|
+
:declared_at => :declaredAt
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Attribute type mapping.
|
|
27
|
+
def self.types_mapping
|
|
28
|
+
{
|
|
29
|
+
:winner_variant_id => :"Integer",
|
|
30
|
+
:declared_at => :"String"
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# List of attributes with nullable: true
|
|
35
|
+
def self.openapi_nullable
|
|
36
|
+
Set.new(
|
|
37
|
+
[]
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Initializes the object
|
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
43
|
+
def initialize(attributes = {})
|
|
44
|
+
if (!attributes.is_a?(Hash))
|
|
45
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Decision` initialize method"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
51
|
+
raise(
|
|
52
|
+
ArgumentError,
|
|
53
|
+
"`#{k}` is not a valid attribute in `Algolia::Decision`. Please check the name to make sure it's valid. List of attributes: " +
|
|
54
|
+
self.class.attribute_map.keys.inspect
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:winner_variant_id)
|
|
62
|
+
self.winner_variant_id = attributes[:winner_variant_id]
|
|
63
|
+
else
|
|
64
|
+
self.winner_variant_id = nil
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:declared_at)
|
|
68
|
+
self.declared_at = attributes[:declared_at]
|
|
69
|
+
else
|
|
70
|
+
self.declared_at = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Checks equality by comparing each attribute.
|
|
75
|
+
# @param [Object] Object to be compared
|
|
76
|
+
def ==(other)
|
|
77
|
+
return true if self.equal?(other)
|
|
78
|
+
self.class == other.class &&
|
|
79
|
+
winner_variant_id == other.winner_variant_id &&
|
|
80
|
+
declared_at == other.declared_at
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# @see the `==` method
|
|
84
|
+
# @param [Object] Object to be compared
|
|
85
|
+
def eql?(other)
|
|
86
|
+
self == other
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Calculates hash code according to all attributes.
|
|
90
|
+
# @return [Integer] Hash code
|
|
91
|
+
def hash
|
|
92
|
+
[winner_variant_id, declared_at].hash
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Builds the object from hash
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
# @return [Object] Returns the model itself
|
|
98
|
+
def self.build_from_hash(attributes)
|
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
|
100
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
101
|
+
transformed_hash = {}
|
|
102
|
+
types_mapping.each_pair do |key, type|
|
|
103
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
104
|
+
transformed_hash[key.to_sym] = nil
|
|
105
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
106
|
+
# check to ensure the input is an array given that the attribute
|
|
107
|
+
# is documented as an array but the input is not
|
|
108
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
109
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
|
110
|
+
_deserialize(::Regexp.last_match(1), v)
|
|
111
|
+
}
|
|
112
|
+
end
|
|
113
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
114
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
new(transformed_hash)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Deserializes the data based on type
|
|
122
|
+
# @param string type Data type
|
|
123
|
+
# @param string value Value to be deserialized
|
|
124
|
+
# @return [Object] Deserialized data
|
|
125
|
+
def self._deserialize(type, value)
|
|
126
|
+
case type.to_sym
|
|
127
|
+
when :Time
|
|
128
|
+
Time.parse(value)
|
|
129
|
+
when :Date
|
|
130
|
+
Date.parse(value)
|
|
131
|
+
when :String
|
|
132
|
+
value.to_s
|
|
133
|
+
when :Integer
|
|
134
|
+
value.to_i
|
|
135
|
+
when :Float
|
|
136
|
+
value.to_f
|
|
137
|
+
when :Boolean
|
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
139
|
+
true
|
|
140
|
+
else
|
|
141
|
+
false
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
when :Object
|
|
145
|
+
# generic object (usually a Hash), return directly
|
|
146
|
+
value
|
|
147
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
148
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
149
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
150
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
151
|
+
k_type = Regexp.last_match[:k_type]
|
|
152
|
+
v_type = Regexp.last_match[:v_type]
|
|
153
|
+
{}.tap do |hash|
|
|
154
|
+
value.each do |k, v|
|
|
155
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
# model
|
|
159
|
+
else
|
|
160
|
+
# models (e.g. Pet) or oneOf
|
|
161
|
+
klass = Algolia::AbtestingV3.const_get(type)
|
|
162
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
|
163
|
+
.build_from_hash(value)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Returns the string representation of the object
|
|
168
|
+
# @return [String] String presentation of the object
|
|
169
|
+
def to_s
|
|
170
|
+
to_hash.to_s
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
|
175
|
+
def to_body
|
|
176
|
+
to_hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def to_json(*_args)
|
|
180
|
+
to_hash.to_json
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Outputs non-array value in the form of hash
|
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
202
|
+
# @param [Object] value Any valid value
|
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
|
204
|
+
def _to_hash(value)
|
|
205
|
+
if value.is_a?(Array)
|
|
206
|
+
value.map { |v| _to_hash(v) }
|
|
207
|
+
elsif value.is_a?(Hash)
|
|
208
|
+
{}.tap do |hash|
|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
210
|
+
end
|
|
211
|
+
elsif value.respond_to?(:to_hash)
|
|
212
|
+
value.to_hash
|
|
213
|
+
else
|
|
214
|
+
value
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|