algolia 3.0.0.alpha.2 → 3.0.0.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +27 -0
  3. data/.gitignore +39 -0
  4. data/.openapi-generator/FILES +164 -0
  5. data/.openapi-generator/VERSION +1 -0
  6. data/.openapi-generator-ignore +23 -0
  7. data/.rubocop.yml +99 -0
  8. data/CHANGELOG.md +16 -0
  9. data/Gemfile.lock +1 -1
  10. data/algolia.gemspec +1 -1
  11. data/lib/algolia/api/insights_client.rb +52 -0
  12. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +81 -31
  13. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +81 -31
  14. data/lib/algolia/models/insights/clicked_filters.rb +41 -18
  15. data/lib/algolia/models/insights/clicked_object_ids.rb +39 -6
  16. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +43 -20
  17. data/lib/algolia/models/insights/converted_filters.rb +41 -18
  18. data/lib/algolia/models/insights/converted_object_ids.rb +42 -19
  19. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +42 -19
  20. data/lib/algolia/models/insights/discount.rb +1 -1
  21. data/lib/algolia/models/insights/insights_events.rb +1 -1
  22. data/lib/algolia/models/insights/object_data.rb +1 -1
  23. data/lib/algolia/models/insights/object_data_after_search.rb +25 -2
  24. data/lib/algolia/models/insights/price.rb +1 -1
  25. data/lib/algolia/models/insights/purchased_object_ids.rb +81 -31
  26. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +81 -66
  27. data/lib/algolia/models/insights/value.rb +97 -0
  28. data/lib/algolia/models/insights/viewed_filters.rb +41 -18
  29. data/lib/algolia/models/insights/viewed_object_ids.rb +42 -19
  30. data/lib/algolia/version.rb +1 -1
  31. metadata +10 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69039252ebbc3b88f6ad76a5283d0eeaa9c8c7fd6722dd3602dc45e93fa0c90d
4
- data.tar.gz: 109a6b0f329218b6a82da539cf03259eba52292035ff832f099ce1ef1d722f00
3
+ metadata.gz: 967cf7b65e49c051c330af87355ad196db3c02ae9b2f7484fb2de373a3898778
4
+ data.tar.gz: 07a58cca43fcf74604a25a2188000bf5df557483564aeb6c5d35d0f1b07e7365
5
5
  SHA512:
6
- metadata.gz: 1ae2f7ed837224d0a459be1568bdce840ab52df0e51edfdb08499ae8ecff4b9af7505be0a1d586b158f0d2ee2263ba3bd70edba91fb5b3cf154ce2b0e4568dbc
7
- data.tar.gz: d6d7fc15a74dd6dc548429e2934ba540799a11174a05d6786a8804e5ff1a9f872e53a80231e43c0317eda828ed184d075d0aa2657f7eec094e885917f939451e
6
+ metadata.gz: b7efe62c28c64dd1d2d4efef50015e12b0880d547841c7011a311f373f1e9dd00a3624c99d495353d22935a764d2bfe8f2c68e8f5aa56ba8e98dfb52d747b661
7
+ data.tar.gz: 20ac8eb5d08ee24bb143ce81b08f875c5abec190e44eb5abfa52d812a03b671b6b5d4a41df4c74556fb1fc601001c5e52b8030093877bbc3d19e53b3a53df783
@@ -0,0 +1,27 @@
1
+ name: Release
2
+
3
+ # This file is registered in https://rubygems.org/gems/algolia/trusted_publishers to be able to publish new versions of the gem.
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - next
9
+
10
+ jobs:
11
+ release:
12
+ name: Publish
13
+ runs-on: ubuntu-22.04
14
+ if: "startsWith(github.event.head_commit.message, 'chore: release')"
15
+ permissions:
16
+ id-token: write
17
+ contents: write
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: 3.2.2
25
+ bundler-cache: true
26
+
27
+ - uses: rubygems/release-gem@v1
data/.gitignore ADDED
@@ -0,0 +1,39 @@
1
+ # Generated by: https://openapi-generator.tech
2
+ #
3
+
4
+ *.gem
5
+ *.rbc
6
+ /.config
7
+ /coverage/
8
+ /InstalledFiles
9
+ /pkg/
10
+ /spec/reports/
11
+ /spec/examples.txt
12
+ /test/tmp/
13
+ /test/version_tmp/
14
+ /tmp/
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+
21
+ ## Documentation cache and generated files:
22
+ /.yardoc/
23
+ /_yardoc/
24
+ /doc/
25
+ /rdoc/
26
+
27
+ ## Environment normalization:
28
+ /.bundle/
29
+ /vendor/bundle
30
+ /lib/bundler/man/
31
+
32
+ # for a library or gem, you might want to ignore these files since the code is
33
+ # intended to run in multiple environments; otherwise, check them in:
34
+ # Gemfile.lock
35
+ # .ruby-version
36
+ # .ruby-gemset
37
+
38
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
39
+ .rvmrc
@@ -0,0 +1,164 @@
1
+ lib/algolia/api/search_client.rb
2
+ lib/algolia/models/search/acl.rb
3
+ lib/algolia/models/search/action.rb
4
+ lib/algolia/models/search/add_api_key_response.rb
5
+ lib/algolia/models/search/advanced_syntax_features.rb
6
+ lib/algolia/models/search/alternatives_as_exact.rb
7
+ lib/algolia/models/search/anchoring.rb
8
+ lib/algolia/models/search/api_key.rb
9
+ lib/algolia/models/search/around_precision.rb
10
+ lib/algolia/models/search/around_precision_from_value_inner.rb
11
+ lib/algolia/models/search/around_radius.rb
12
+ lib/algolia/models/search/around_radius_all.rb
13
+ lib/algolia/models/search/assign_user_id_params.rb
14
+ lib/algolia/models/search/attribute_to_update.rb
15
+ lib/algolia/models/search/automatic_facet_filter.rb
16
+ lib/algolia/models/search/automatic_facet_filters.rb
17
+ lib/algolia/models/search/base_get_api_key_response.rb
18
+ lib/algolia/models/search/base_index_settings.rb
19
+ lib/algolia/models/search/base_search_params.rb
20
+ lib/algolia/models/search/base_search_params_without_query.rb
21
+ lib/algolia/models/search/base_search_response.rb
22
+ lib/algolia/models/search/batch_assign_user_ids_params.rb
23
+ lib/algolia/models/search/batch_dictionary_entries_params.rb
24
+ lib/algolia/models/search/batch_dictionary_entries_request.rb
25
+ lib/algolia/models/search/batch_params.rb
26
+ lib/algolia/models/search/batch_request.rb
27
+ lib/algolia/models/search/batch_response.rb
28
+ lib/algolia/models/search/batch_write_params.rb
29
+ lib/algolia/models/search/browse_params.rb
30
+ lib/algolia/models/search/browse_params_object.rb
31
+ lib/algolia/models/search/browse_response.rb
32
+ lib/algolia/models/search/built_in_operation.rb
33
+ lib/algolia/models/search/built_in_operation_type.rb
34
+ lib/algolia/models/search/condition.rb
35
+ lib/algolia/models/search/consequence.rb
36
+ lib/algolia/models/search/consequence_hide.rb
37
+ lib/algolia/models/search/consequence_params.rb
38
+ lib/algolia/models/search/consequence_query.rb
39
+ lib/algolia/models/search/consequence_query_object.rb
40
+ lib/algolia/models/search/created_at_response.rb
41
+ lib/algolia/models/search/cursor.rb
42
+ lib/algolia/models/search/delete_api_key_response.rb
43
+ lib/algolia/models/search/delete_by_params.rb
44
+ lib/algolia/models/search/delete_source_response.rb
45
+ lib/algolia/models/search/deleted_at_response.rb
46
+ lib/algolia/models/search/dictionary_action.rb
47
+ lib/algolia/models/search/dictionary_entry.rb
48
+ lib/algolia/models/search/dictionary_entry_state.rb
49
+ lib/algolia/models/search/dictionary_language.rb
50
+ lib/algolia/models/search/dictionary_settings_params.rb
51
+ lib/algolia/models/search/dictionary_type.rb
52
+ lib/algolia/models/search/distinct.rb
53
+ lib/algolia/models/search/edit.rb
54
+ lib/algolia/models/search/edit_type.rb
55
+ lib/algolia/models/search/error_base.rb
56
+ lib/algolia/models/search/exact_on_single_word_query.rb
57
+ lib/algolia/models/search/exhaustive.rb
58
+ lib/algolia/models/search/facet_filters.rb
59
+ lib/algolia/models/search/facet_hits.rb
60
+ lib/algolia/models/search/facet_ordering.rb
61
+ lib/algolia/models/search/facets.rb
62
+ lib/algolia/models/search/facets_stats.rb
63
+ lib/algolia/models/search/fetched_index.rb
64
+ lib/algolia/models/search/get_api_key_response.rb
65
+ lib/algolia/models/search/get_dictionary_settings_response.rb
66
+ lib/algolia/models/search/get_logs_response.rb
67
+ lib/algolia/models/search/get_objects_params.rb
68
+ lib/algolia/models/search/get_objects_request.rb
69
+ lib/algolia/models/search/get_objects_response.rb
70
+ lib/algolia/models/search/get_task_response.rb
71
+ lib/algolia/models/search/get_top_user_ids_response.rb
72
+ lib/algolia/models/search/has_pending_mappings_response.rb
73
+ lib/algolia/models/search/highlight_result.rb
74
+ lib/algolia/models/search/highlight_result_option.rb
75
+ lib/algolia/models/search/hit.rb
76
+ lib/algolia/models/search/ignore_plurals.rb
77
+ lib/algolia/models/search/index_settings.rb
78
+ lib/algolia/models/search/index_settings_as_search_params.rb
79
+ lib/algolia/models/search/languages.rb
80
+ lib/algolia/models/search/list_api_keys_response.rb
81
+ lib/algolia/models/search/list_clusters_response.rb
82
+ lib/algolia/models/search/list_indices_response.rb
83
+ lib/algolia/models/search/list_user_ids_response.rb
84
+ lib/algolia/models/search/log.rb
85
+ lib/algolia/models/search/log_query.rb
86
+ lib/algolia/models/search/log_type.rb
87
+ lib/algolia/models/search/match_level.rb
88
+ lib/algolia/models/search/matched_geo_location.rb
89
+ lib/algolia/models/search/mixed_search_filters.rb
90
+ lib/algolia/models/search/mode.rb
91
+ lib/algolia/models/search/multiple_batch_request.rb
92
+ lib/algolia/models/search/multiple_batch_response.rb
93
+ lib/algolia/models/search/numeric_filters.rb
94
+ lib/algolia/models/search/operation_index_params.rb
95
+ lib/algolia/models/search/operation_type.rb
96
+ lib/algolia/models/search/optional_filters.rb
97
+ lib/algolia/models/search/params.rb
98
+ lib/algolia/models/search/personalization.rb
99
+ lib/algolia/models/search/promote.rb
100
+ lib/algolia/models/search/promote_object_id.rb
101
+ lib/algolia/models/search/promote_object_ids.rb
102
+ lib/algolia/models/search/query_type.rb
103
+ lib/algolia/models/search/ranking_info.rb
104
+ lib/algolia/models/search/re_ranking_apply_filter.rb
105
+ lib/algolia/models/search/redirect.rb
106
+ lib/algolia/models/search/redirect_rule_index_metadata.rb
107
+ lib/algolia/models/search/redirect_rule_index_metadata_data.rb
108
+ lib/algolia/models/search/remove_stop_words.rb
109
+ lib/algolia/models/search/remove_user_id_response.rb
110
+ lib/algolia/models/search/remove_words_if_no_results.rb
111
+ lib/algolia/models/search/rendering_content.rb
112
+ lib/algolia/models/search/replace_source_response.rb
113
+ lib/algolia/models/search/rule.rb
114
+ lib/algolia/models/search/save_object_response.rb
115
+ lib/algolia/models/search/save_synonym_response.rb
116
+ lib/algolia/models/search/scope_type.rb
117
+ lib/algolia/models/search/search_dictionary_entries_params.rb
118
+ lib/algolia/models/search/search_for_facet_values_request.rb
119
+ lib/algolia/models/search/search_for_facet_values_response.rb
120
+ lib/algolia/models/search/search_for_facets.rb
121
+ lib/algolia/models/search/search_for_facets_options.rb
122
+ lib/algolia/models/search/search_for_hits.rb
123
+ lib/algolia/models/search/search_for_hits_options.rb
124
+ lib/algolia/models/search/search_hits.rb
125
+ lib/algolia/models/search/search_method_params.rb
126
+ lib/algolia/models/search/search_params.rb
127
+ lib/algolia/models/search/search_params_object.rb
128
+ lib/algolia/models/search/search_params_query.rb
129
+ lib/algolia/models/search/search_params_string.rb
130
+ lib/algolia/models/search/search_query.rb
131
+ lib/algolia/models/search/search_response.rb
132
+ lib/algolia/models/search/search_responses.rb
133
+ lib/algolia/models/search/search_result.rb
134
+ lib/algolia/models/search/search_rules_params.rb
135
+ lib/algolia/models/search/search_rules_response.rb
136
+ lib/algolia/models/search/search_strategy.rb
137
+ lib/algolia/models/search/search_synonyms_params.rb
138
+ lib/algolia/models/search/search_synonyms_response.rb
139
+ lib/algolia/models/search/search_type_default.rb
140
+ lib/algolia/models/search/search_type_facet.rb
141
+ lib/algolia/models/search/search_user_ids_params.rb
142
+ lib/algolia/models/search/search_user_ids_response.rb
143
+ lib/algolia/models/search/semantic_search.rb
144
+ lib/algolia/models/search/snippet_result.rb
145
+ lib/algolia/models/search/snippet_result_option.rb
146
+ lib/algolia/models/search/sort_remaining_by.rb
147
+ lib/algolia/models/search/source.rb
148
+ lib/algolia/models/search/standard_entries.rb
149
+ lib/algolia/models/search/synonym_hit.rb
150
+ lib/algolia/models/search/synonym_type.rb
151
+ lib/algolia/models/search/tag_filters.rb
152
+ lib/algolia/models/search/task_status.rb
153
+ lib/algolia/models/search/time_range.rb
154
+ lib/algolia/models/search/typo_tolerance.rb
155
+ lib/algolia/models/search/typo_tolerance_enum.rb
156
+ lib/algolia/models/search/update_api_key_response.rb
157
+ lib/algolia/models/search/updated_at_response.rb
158
+ lib/algolia/models/search/updated_at_with_object_id_response.rb
159
+ lib/algolia/models/search/updated_rule_response.rb
160
+ lib/algolia/models/search/user_highlight_result.rb
161
+ lib/algolia/models/search/user_hit.rb
162
+ lib/algolia/models/search/user_id.rb
163
+ lib/algolia/models/search/value.rb
164
+ lib/algolia/version.rb
@@ -0,0 +1 @@
1
+ 7.2.0
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
data/.rubocop.yml ADDED
@@ -0,0 +1,99 @@
1
+ AllCops:
2
+ DisabledByDefault: false
3
+ NewCops: enable
4
+
5
+ Style/HashSyntax:
6
+ Enabled: false
7
+
8
+ Style/FrozenStringLiteralComment:
9
+ Enabled: false
10
+ EnforcedStyle: always
11
+
12
+ Style/WordArray:
13
+ Enabled: false
14
+
15
+ Style/SymbolArray:
16
+ Enabled: false
17
+
18
+ Style/Documentation:
19
+ Enabled: false
20
+
21
+ Layout/LineLength:
22
+ Max: 180
23
+
24
+ Metrics/PerceivedComplexity:
25
+ Enabled: false
26
+
27
+ Metrics/CyclomaticComplexity:
28
+ Enabled: false
29
+
30
+ Metrics/AbcSize:
31
+ Enabled: false
32
+
33
+ Metrics/MethodLength:
34
+ Enabled: false
35
+
36
+ Metrics/ClassLength:
37
+ Enabled: false
38
+
39
+ Gemspec/DevelopmentDependencies:
40
+ Exclude:
41
+ - 'algolia.gemspec'
42
+
43
+ Gemspec/RequiredRubyVersion:
44
+ Exclude:
45
+ - 'algolia.gemspec'
46
+
47
+ Lint/DuplicateMethods:
48
+ Enabled: false
49
+
50
+ Lint/SymbolConversion:
51
+ Enabled: false
52
+
53
+ Lint/UnderscorePrefixedVariableName:
54
+ Enabled: false
55
+
56
+ Naming/PredicateName:
57
+ Enabled: false
58
+
59
+ Style/AccessorGrouping:
60
+ Enabled: false
61
+
62
+ Style/ClassVars:
63
+ Enabled: false
64
+
65
+ Style/ConditionalAssignment:
66
+ Enabled: false
67
+
68
+ Style/GuardClause:
69
+ Enabled: false
70
+
71
+ Style/HashTransformValues:
72
+ Enabled: false
73
+
74
+ Style/IfUnlessModifier:
75
+ Enabled: false
76
+
77
+ Style/NumericPredicate:
78
+ Enabled: false
79
+
80
+ Style/RescueStandardError:
81
+ Enabled: false
82
+
83
+ Style/SoleNestedConditional:
84
+ Enabled: false
85
+
86
+ Style/StringLiterals:
87
+ Enabled: false
88
+
89
+ Lint/SuppressedException:
90
+ Enabled: false
91
+
92
+ Metrics/BlockNesting:
93
+ Max: 4
94
+
95
+ Metrics/ParameterLists:
96
+ Max: 7
97
+
98
+ Security/CompoundHash:
99
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [3.0.0.alpha.5](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.4...3.0.0.alpha.5)
2
+
3
+ - [7c5ba3288](https://github.com/algolia/api-clients-automation/commit/7c5ba3288) feat(specs): update Insights API spec ([#2376](https://github.com/algolia/api-clients-automation/pull/2376)) by [@kai687](https://github.com/kai687/)
4
+ - [297baa987](https://github.com/algolia/api-clients-automation/commit/297baa987) chore(clients): provide snippets for all languages ([#2518](https://github.com/algolia/api-clients-automation/pull/2518)) by [@shortcuts](https://github.com/shortcuts/)
5
+ - [857f3632e](https://github.com/algolia/api-clients-automation/commit/857f3632e) feat(clients): generate code snippets from cts ([#2511](https://github.com/algolia/api-clients-automation/pull/2511)) by [@shortcuts](https://github.com/shortcuts/)
6
+ - [7085d099e](https://github.com/algolia/api-clients-automation/commit/7085d099e) fix(ruby): exclude vendor from bundled gem ([#2512](https://github.com/algolia/api-clients-automation/pull/2512)) by [@millotp](https://github.com/millotp/)
7
+
8
+ ## [3.0.0.alpha.4](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.3...3.0.0.alpha.4)
9
+
10
+ - [b4ca09335](https://github.com/algolia/api-clients-automation/commit/b4ca09335) fix(ruby): release using Trusted Publishing ([#2504](https://github.com/algolia/api-clients-automation/pull/2504)) by [@millotp](https://github.com/millotp/)
11
+
12
+ ## [3.0.0.alpha.3](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.2...3.0.0.alpha.3)
13
+
14
+ - [ae20258c6](https://github.com/algolia/api-clients-automation/commit/ae20258c6) feat(clients): deserialize in e2e and SFFV response ([#2500](https://github.com/algolia/api-clients-automation/pull/2500)) by [@shortcuts](https://github.com/shortcuts/)
15
+ - [4dc28da98](https://github.com/algolia/api-clients-automation/commit/4dc28da98) chore(clients): add more e2e ([#2497](https://github.com/algolia/api-clients-automation/pull/2497)) by [@shortcuts](https://github.com/shortcuts/)
16
+
1
17
  ## [3.0.0.alpha.2](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.1...3.0.0.alpha.2)
2
18
 
3
19
  - [ae6adfbf7](https://github.com/algolia/api-clients-automation/commit/ae6adfbf7) fix(specs): port recommend changes ([#2476](https://github.com/algolia/api-clients-automation/pull/2476)) by [@shortcuts](https://github.com/shortcuts/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.0.0.alpha.2)
4
+ algolia (3.0.0.alpha.5)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-net_http_persistent (>= 0.15, < 3)
7
7
  net-http-persistent
data/algolia.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  'rubygems_mfa_required' => 'true'
21
21
  }
22
22
 
23
- s.files = `find *`.split("\n").uniq.sort.reject(&:empty?)
23
+ s.files = `git ls-files`.split($/)
24
24
  s.executables = []
25
25
  s.require_paths = ['lib']
26
26
 
@@ -209,6 +209,58 @@ module Algolia
209
209
  deserialize(response.body, request_options[:debug_return_type] || 'Object')
210
210
  end
211
211
 
212
+ # Delete user token.
213
+ # Delete all events related to a certain user token from events metrics and analytics. To delete a personalization user profile, see [Delete a user profile](https://www.algolia.com/doc/rest-api/personalization/#delete-a-user-profile).
214
+ # @param user_token [String] The user token for which to delete all associated events. (required)
215
+ # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
216
+ # @return [Http::Response] the response
217
+ def delete_user_token_with_http_info(user_token, request_options = {})
218
+ # verify the required parameter 'user_token' is set
219
+ if @api_client.config.client_side_validation && user_token.nil?
220
+ raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_token`."
221
+ end
222
+ if @api_client.config.client_side_validation && user_token.to_s.length > 129
223
+ raise ArgumentError, 'invalid value for "user_token" when calling InsightsClient.delete_user_token, the character length must be smaller than or equal to 129.'
224
+ end
225
+
226
+ if @api_client.config.client_side_validation && user_token.to_s.length < 1
227
+ raise ArgumentError, 'invalid value for "user_token" when calling InsightsClient.delete_user_token, the character length must be great than or equal to 1.'
228
+ end
229
+
230
+ pattern = %r{[a-zA-Z0-9_=/+]{1,129}}
231
+ if @api_client.config.client_side_validation && user_token !~ pattern
232
+ raise ArgumentError, "invalid value for 'user_token' when calling InsightsClient.delete_user_token, must conform to the pattern #{pattern}."
233
+ end
234
+
235
+ path = '/1/usertokens/{userToken}'.sub('{' + 'userToken' + '}', @api_client.encode_uri(user_token.to_s))
236
+ query_params = {}
237
+ query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
238
+ header_params = {}
239
+ header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
240
+
241
+ post_body = request_options[:debug_body]
242
+
243
+ new_options = request_options.merge(
244
+ :operation => :'InsightsClient.delete_user_token',
245
+ :header_params => header_params,
246
+ :query_params => query_params,
247
+ :body => post_body,
248
+ :use_read_transporter => false
249
+ )
250
+
251
+ @api_client.call_api(:DELETE, path, new_options)
252
+ end
253
+
254
+ # Delete user token.
255
+ # Delete all events related to a certain user token from events metrics and analytics. To delete a personalization user profile, see [Delete a user profile](https://www.algolia.com/doc/rest-api/personalization/#delete-a-user-profile).
256
+ # @param user_token [String] The user token for which to delete all associated events. (required)
257
+ # @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)
258
+ # @return [nil]
259
+ def delete_user_token(user_token, request_options = {})
260
+ delete_user_token_with_http_info(user_token, request_options)
261
+ nil
262
+ end
263
+
212
264
  # Send events.
213
265
  # Send a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2&amp;nbsp;MB.
214
266
  # @param insights_events [InsightsEvents] (required)
@@ -7,33 +7,35 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don't use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
9
9
  class AddedToCartObjectIDs
10
- # Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
10
+ # The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
15
  attr_accessor :event_subtype
16
16
 
17
- # Name of the Algolia index.
17
+ # The name of an Algolia index.
18
18
  attr_accessor :index
19
19
 
20
- # List of object identifiers for items of an Algolia index.
20
+ # The object IDs of the records that are part of the event.
21
21
  attr_accessor :object_ids
22
22
 
23
- # Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
24
- attr_accessor :object_data
23
+ # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
24
+ attr_accessor :user_token
25
+
26
+ # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
27
+ attr_accessor :authenticated_user_token
25
28
 
26
- # If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
29
+ # Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
27
30
  attr_accessor :currency
28
31
 
29
- # Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
30
- attr_accessor :user_token
32
+ # Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
33
+ attr_accessor :object_data
31
34
 
32
- # Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
35
+ # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
33
36
  attr_accessor :timestamp
34
37
 
35
- # User token for authenticated users.
36
- attr_accessor :authenticated_user_token
38
+ attr_accessor :value
37
39
 
38
40
  class EnumAttributeValidator
39
41
  attr_reader :datatype
@@ -65,11 +67,12 @@ module Algolia
65
67
  :event_subtype => :eventSubtype,
66
68
  :index => :index,
67
69
  :object_ids => :objectIDs,
68
- :object_data => :objectData,
69
- :currency => :currency,
70
70
  :user_token => :userToken,
71
+ :authenticated_user_token => :authenticatedUserToken,
72
+ :currency => :currency,
73
+ :object_data => :objectData,
71
74
  :timestamp => :timestamp,
72
- :authenticated_user_token => :authenticatedUserToken
75
+ :value => :value
73
76
  }
74
77
  end
75
78
 
@@ -86,11 +89,12 @@ module Algolia
86
89
  :event_subtype => :AddToCartEvent,
87
90
  :index => :String,
88
91
  :object_ids => :'Array<String>',
89
- :object_data => :'Array<ObjectData>',
90
- :currency => :String,
91
92
  :user_token => :String,
93
+ :authenticated_user_token => :String,
94
+ :currency => :String,
95
+ :object_data => :'Array<ObjectData>',
92
96
  :timestamp => :Integer,
93
- :authenticated_user_token => :String
97
+ :value => :Value
94
98
  }
95
99
  end
96
100
 
@@ -148,28 +152,32 @@ module Algolia
148
152
  self.object_ids = nil
149
153
  end
150
154
 
151
- if attributes.key?(:object_data)
152
- if (value = attributes[:object_data]).is_a?(Array)
153
- self.object_data = value
154
- end
155
+ if attributes.key?(:user_token)
156
+ self.user_token = attributes[:user_token]
157
+ else
158
+ self.user_token = nil
159
+ end
160
+
161
+ if attributes.key?(:authenticated_user_token)
162
+ self.authenticated_user_token = attributes[:authenticated_user_token]
155
163
  end
156
164
 
157
165
  if attributes.key?(:currency)
158
166
  self.currency = attributes[:currency]
159
167
  end
160
168
 
161
- if attributes.key?(:user_token)
162
- self.user_token = attributes[:user_token]
163
- else
164
- self.user_token = nil
169
+ if attributes.key?(:object_data)
170
+ if (value = attributes[:object_data]).is_a?(Array)
171
+ self.object_data = value
172
+ end
165
173
  end
166
174
 
167
175
  if attributes.key?(:timestamp)
168
176
  self.timestamp = attributes[:timestamp]
169
177
  end
170
178
 
171
- if attributes.key?(:authenticated_user_token)
172
- self.authenticated_user_token = attributes[:authenticated_user_token]
179
+ if attributes.key?(:value)
180
+ self.value = attributes[:value]
173
181
  end
174
182
  end
175
183
 
@@ -237,6 +245,47 @@ module Algolia
237
245
  @user_token = user_token
238
246
  end
239
247
 
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] authenticated_user_token Value to be assigned
250
+ def authenticated_user_token=(authenticated_user_token)
251
+ if authenticated_user_token.nil?
252
+ raise ArgumentError, 'authenticated_user_token cannot be nil'
253
+ end
254
+
255
+ if authenticated_user_token.to_s.length > 129
256
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be smaller than or equal to 129.'
257
+ end
258
+
259
+ if authenticated_user_token.to_s.length < 1
260
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be great than or equal to 1.'
261
+ end
262
+
263
+ pattern = %r{[a-zA-Z0-9_=/+-]{1,129}}
264
+ if authenticated_user_token !~ pattern
265
+ raise ArgumentError, "invalid value for \"authenticated_user_token\", must conform to the pattern #{pattern}."
266
+ end
267
+
268
+ @authenticated_user_token = authenticated_user_token
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] object_data Value to be assigned
273
+ def object_data=(object_data)
274
+ if object_data.nil?
275
+ raise ArgumentError, 'object_data cannot be nil'
276
+ end
277
+
278
+ if object_data.length > 20
279
+ raise ArgumentError, 'invalid value for "object_data", number of items must be less than or equal to 20.'
280
+ end
281
+
282
+ if object_data.length < 1
283
+ raise ArgumentError, 'invalid value for "object_data", number of items must be greater than or equal to 1.'
284
+ end
285
+
286
+ @object_data = object_data
287
+ end
288
+
240
289
  # Checks equality by comparing each attribute.
241
290
  # @param [Object] Object to be compared
242
291
  def ==(other)
@@ -248,11 +297,12 @@ module Algolia
248
297
  event_subtype == other.event_subtype &&
249
298
  index == other.index &&
250
299
  object_ids == other.object_ids &&
251
- object_data == other.object_data &&
252
- currency == other.currency &&
253
300
  user_token == other.user_token &&
301
+ authenticated_user_token == other.authenticated_user_token &&
302
+ currency == other.currency &&
303
+ object_data == other.object_data &&
254
304
  timestamp == other.timestamp &&
255
- authenticated_user_token == other.authenticated_user_token
305
+ value == other.value
256
306
  end
257
307
 
258
308
  # @see the `==` method
@@ -264,7 +314,7 @@ module Algolia
264
314
  # Calculates hash code according to all attributes.
265
315
  # @return [Integer] Hash code
266
316
  def hash
267
- [event_name, event_type, event_subtype, index, object_ids, object_data, currency, user_token, timestamp, authenticated_user_token].hash
317
+ [event_name, event_type, event_subtype, index, object_ids, user_token, authenticated_user_token, currency, object_data, timestamp, value].hash
268
318
  end
269
319
 
270
320
  # Builds the object from hash