recombee_api_client 0.1.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.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +3 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +157 -0
  5. data/Rakefile +6 -0
  6. data/lib/recombee_api_client/api/add_bookmark.rb +70 -0
  7. data/lib/recombee_api_client/api/add_cart_addition.rb +70 -0
  8. data/lib/recombee_api_client/api/add_detail_view.rb +73 -0
  9. data/lib/recombee_api_client/api/add_group.rb +53 -0
  10. data/lib/recombee_api_client/api/add_item.rb +56 -0
  11. data/lib/recombee_api_client/api/add_item_property.rb +59 -0
  12. data/lib/recombee_api_client/api/add_purchase.rb +70 -0
  13. data/lib/recombee_api_client/api/add_rating.rb +73 -0
  14. data/lib/recombee_api_client/api/add_series.rb +53 -0
  15. data/lib/recombee_api_client/api/add_user.rb +54 -0
  16. data/lib/recombee_api_client/api/batch.rb +64 -0
  17. data/lib/recombee_api_client/api/delete_bookmark.rb +61 -0
  18. data/lib/recombee_api_client/api/delete_cart_addition.rb +61 -0
  19. data/lib/recombee_api_client/api/delete_detail_view.rb +61 -0
  20. data/lib/recombee_api_client/api/delete_group.rb +56 -0
  21. data/lib/recombee_api_client/api/delete_item.rb +58 -0
  22. data/lib/recombee_api_client/api/delete_item_property.rb +54 -0
  23. data/lib/recombee_api_client/api/delete_purchase.rb +61 -0
  24. data/lib/recombee_api_client/api/delete_rating.rb +61 -0
  25. data/lib/recombee_api_client/api/delete_series.rb +56 -0
  26. data/lib/recombee_api_client/api/delete_user.rb +56 -0
  27. data/lib/recombee_api_client/api/get_item_property_info.rb +54 -0
  28. data/lib/recombee_api_client/api/get_item_values.rb +55 -0
  29. data/lib/recombee_api_client/api/insert_to_group.rb +69 -0
  30. data/lib/recombee_api_client/api/insert_to_series.rb +72 -0
  31. data/lib/recombee_api_client/api/item_based_recommendation.rb +131 -0
  32. data/lib/recombee_api_client/api/list_group_items.rb +53 -0
  33. data/lib/recombee_api_client/api/list_groups.rb +50 -0
  34. data/lib/recombee_api_client/api/list_item_bookmarks.rb +54 -0
  35. data/lib/recombee_api_client/api/list_item_cart_additions.rb +54 -0
  36. data/lib/recombee_api_client/api/list_item_detail_views.rb +54 -0
  37. data/lib/recombee_api_client/api/list_item_properties.rb +51 -0
  38. data/lib/recombee_api_client/api/list_item_purchases.rb +54 -0
  39. data/lib/recombee_api_client/api/list_item_ratings.rb +54 -0
  40. data/lib/recombee_api_client/api/list_items.rb +63 -0
  41. data/lib/recombee_api_client/api/list_series.rb +50 -0
  42. data/lib/recombee_api_client/api/list_series_items.rb +53 -0
  43. data/lib/recombee_api_client/api/list_user_bookmarks.rb +53 -0
  44. data/lib/recombee_api_client/api/list_user_cart_additions.rb +53 -0
  45. data/lib/recombee_api_client/api/list_user_detail_views.rb +53 -0
  46. data/lib/recombee_api_client/api/list_user_purchases.rb +53 -0
  47. data/lib/recombee_api_client/api/list_user_ratings.rb +53 -0
  48. data/lib/recombee_api_client/api/list_users.rb +50 -0
  49. data/lib/recombee_api_client/api/merge_users.rb +72 -0
  50. data/lib/recombee_api_client/api/remove_from_group.rb +59 -0
  51. data/lib/recombee_api_client/api/remove_from_series.rb +62 -0
  52. data/lib/recombee_api_client/api/request.rb +7 -0
  53. data/lib/recombee_api_client/api/reset_database.rb +51 -0
  54. data/lib/recombee_api_client/api/set_item_values.rb +70 -0
  55. data/lib/recombee_api_client/api/user_based_recommendation.rb +116 -0
  56. data/lib/recombee_api_client/errors.rb +44 -0
  57. data/lib/recombee_api_client/version.rb +3 -0
  58. data/lib/recombee_api_client.rb +105 -0
  59. data/recombee_api_client.gemspec +26 -0
  60. metadata +173 -0
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #List all the items present in the given series, sorted according to their time index values.
11
+ class ListSeriesItems < ApiRequest
12
+ attr_reader :series_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +series_id+ -> ID of the series items of which are to be listed.
18
+ #
19
+ def initialize(series_id)
20
+ @series_id = series_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/series/#{@series_id}/items/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/series/#{@series_id}/items/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #List all the bookmarks ever made by a given user.
11
+ class ListUserBookmarks < ApiRequest
12
+ attr_reader :user_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +user_id+ -> ID of the user whose bookmarks are to be listed.
18
+ #
19
+ def initialize(user_id)
20
+ @user_id = user_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/users/#{@user_id}/bookmarks/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/users/#{@user_id}/bookmarks/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #List all the cart additions ever made by a given user.
11
+ class ListUserCartAdditions < ApiRequest
12
+ attr_reader :user_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +user_id+ -> ID of the user whose cart additions are to be listed.
18
+ #
19
+ def initialize(user_id)
20
+ @user_id = user_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/users/#{@user_id}/cartadditions/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/users/#{@user_id}/cartadditions/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #Lists all the detail views of different items ever made by a given user.
11
+ class ListUserDetailViews < ApiRequest
12
+ attr_reader :user_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +user_id+ -> ID of the user whose detail views are to be listed.
18
+ #
19
+ def initialize(user_id)
20
+ @user_id = user_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/users/#{@user_id}/detailviews/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/users/#{@user_id}/detailviews/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #List all the purchases ever made by a given user.
11
+ class ListUserPurchases < ApiRequest
12
+ attr_reader :user_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +user_id+ -> ID of the user whose purchases are to be listed.
18
+ #
19
+ def initialize(user_id)
20
+ @user_id = user_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/users/#{@user_id}/purchases/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/users/#{@user_id}/purchases/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #List all the ratings ever submitted by a given user.
11
+ class ListUserRatings < ApiRequest
12
+ attr_reader :user_id
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ # * *Required arguments*
17
+ # - +user_id+ -> ID of the user whose ratings are to be listed.
18
+ #
19
+ def initialize(user_id)
20
+ @user_id = user_id
21
+ @timeout = 1000
22
+ end
23
+
24
+ # HTTP method
25
+ def method
26
+ :get
27
+ end
28
+
29
+ # Values of body parameters as a Hash
30
+ def body_parameters
31
+ p = Hash.new
32
+ p
33
+ end
34
+
35
+ # Values of query path parameters as a Hash.
36
+ # name of parameter => value of the parameter
37
+ def query_parameters
38
+ params = {}
39
+ params
40
+ end
41
+
42
+ # Relative path to the endpoint
43
+ def basic_path
44
+ "/{databaseId}/users/#{@user_id}/ratings/"
45
+ end
46
+
47
+ # Relative path to the endpoint including query parameters
48
+ def path
49
+ p = "/{databaseId}/users/#{@user_id}/ratings/"
50
+ p
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,50 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #Gets a list of IDs of users currently present in the catalog.
11
+ class ListUsers < ApiRequest
12
+
13
+ attr_accessor :timeout
14
+
15
+ ##
16
+ #
17
+ def initialize()
18
+ @timeout = 1000
19
+ end
20
+
21
+ # HTTP method
22
+ def method
23
+ :get
24
+ end
25
+
26
+ # Values of body parameters as a Hash
27
+ def body_parameters
28
+ p = Hash.new
29
+ p
30
+ end
31
+
32
+ # Values of query path parameters as a Hash.
33
+ # name of parameter => value of the parameter
34
+ def query_parameters
35
+ params = {}
36
+ params
37
+ end
38
+
39
+ # Relative path to the endpoint
40
+ def basic_path
41
+ "/{databaseId}/users/list/"
42
+ end
43
+
44
+ # Relative path to the endpoint including query parameters
45
+ def path
46
+ p = "/{databaseId}/users/list/"
47
+ p
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,72 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ module RecombeeApiClient
6
+ require_relative 'request'
7
+ require_relative '../errors'
8
+
9
+ ##
10
+ #Merges purchases, ratings, bookmarks, and detail views of two different users under a single user ID. This is especially useful for online e-commerce applications working with anonymous users identified by unique tokens such as the session ID. In such applications, it may often happen that a user owns a persistent account, yet accesses the system anonymously while, e.g., putting items into a shopping cart. At some point in time, such as when the user wishes to confirm the purchase, (s)he logs into the system using his/her username and password. The interactions made under anonymous session ID then become connected with the persistent account, and merging these two together becomes desirable.
11
+ #
12
+ #
13
+ #Merging happens between two users referred to as the *source* and the *target*. After the merge, all the interactions of the source user are attributed to the target user, and the source user is **deleted** unless special parameter `keepSourceUser` is set `true`.
14
+ #
15
+ class MergeUsers < ApiRequest
16
+ attr_reader :target_user_id, :source_user_id, :keep_source_user
17
+ attr_accessor :timeout
18
+
19
+ ##
20
+ # * *Required arguments*
21
+ # - +target_user_id+ -> ID of the source user.
22
+ # - +source_user_id+ -> ID of the target user.
23
+ #
24
+ # * *Optional arguments (given as hash optional)*
25
+ # - +keepSourceUser+ -> If true, the source user will not be deleted, but also kept in the database..
26
+ #
27
+ def initialize(target_user_id, source_user_id, optional = {})
28
+ @target_user_id = target_user_id
29
+ @source_user_id = source_user_id
30
+ @keep_source_user = optional['keepSourceUser']
31
+ @optional = optional
32
+ @timeout = 1000
33
+ @optional.each do |par, _|
34
+ fail UnknownOptionalParameter.new(par) unless ["keepSourceUser"].include? par
35
+ end
36
+ end
37
+
38
+ # HTTP method
39
+ def method
40
+ :put
41
+ end
42
+
43
+ # Values of body parameters as a Hash
44
+ def body_parameters
45
+ p = Hash.new
46
+ p
47
+ end
48
+
49
+ # Values of query path parameters as a Hash.
50
+ # name of parameter => value of the parameter
51
+ def query_parameters
52
+ params = {}
53
+ params['keepSourceUser'] = @optional['keepSourceUser'] if @optional['keepSourceUser']
54
+ params
55
+ end
56
+
57
+ # Relative path to the endpoint
58
+ def basic_path
59
+ "/{databaseId}/users/#{@target_user_id}/merge/#{@source_user_id}"
60
+ end
61
+
62
+ # Relative path to the endpoint including query parameters
63
+ def path
64
+ p = "/{databaseId}/users/#{@target_user_id}/merge/#{@source_user_id}"
65
+ if @optional.include? 'keepSourceUser'
66
+ p += (p.include? '?') ? '&' : '?'
67
+ p += "keepSourceUser=#{@optional['keepSourceUser']}"
68
+ end
69
+ p
70
+ end
71
+ end
72
+ end