recombee_api_client 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -4
  3. data/lib/recombee_api_client.rb +55 -36
  4. data/lib/recombee_api_client/api/add_bookmark.rb +2 -0
  5. data/lib/recombee_api_client/api/add_cart_addition.rb +2 -0
  6. data/lib/recombee_api_client/api/add_detail_view.rb +2 -0
  7. data/lib/recombee_api_client/api/add_group.rb +2 -0
  8. data/lib/recombee_api_client/api/add_item.rb +2 -0
  9. data/lib/recombee_api_client/api/add_item_property.rb +2 -0
  10. data/lib/recombee_api_client/api/add_purchase.rb +2 -0
  11. data/lib/recombee_api_client/api/add_rating.rb +2 -0
  12. data/lib/recombee_api_client/api/add_series.rb +2 -0
  13. data/lib/recombee_api_client/api/add_user.rb +2 -0
  14. data/lib/recombee_api_client/api/batch.rb +2 -0
  15. data/lib/recombee_api_client/api/delete_bookmark.rb +17 -5
  16. data/lib/recombee_api_client/api/delete_cart_addition.rb +17 -5
  17. data/lib/recombee_api_client/api/delete_detail_view.rb +17 -5
  18. data/lib/recombee_api_client/api/delete_group.rb +2 -0
  19. data/lib/recombee_api_client/api/delete_item.rb +2 -0
  20. data/lib/recombee_api_client/api/delete_item_property.rb +2 -0
  21. data/lib/recombee_api_client/api/delete_purchase.rb +17 -5
  22. data/lib/recombee_api_client/api/delete_rating.rb +17 -5
  23. data/lib/recombee_api_client/api/delete_series.rb +2 -0
  24. data/lib/recombee_api_client/api/delete_user.rb +2 -0
  25. data/lib/recombee_api_client/api/get_item_property_info.rb +2 -0
  26. data/lib/recombee_api_client/api/get_item_values.rb +2 -0
  27. data/lib/recombee_api_client/api/insert_to_group.rb +2 -0
  28. data/lib/recombee_api_client/api/insert_to_series.rb +2 -0
  29. data/lib/recombee_api_client/api/item_based_recommendation.rb +19 -3
  30. data/lib/recombee_api_client/api/list_group_items.rb +2 -0
  31. data/lib/recombee_api_client/api/list_groups.rb +2 -0
  32. data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -0
  33. data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -0
  34. data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -0
  35. data/lib/recombee_api_client/api/list_item_properties.rb +2 -0
  36. data/lib/recombee_api_client/api/list_item_purchases.rb +2 -0
  37. data/lib/recombee_api_client/api/list_item_ratings.rb +2 -0
  38. data/lib/recombee_api_client/api/list_items.rb +2 -0
  39. data/lib/recombee_api_client/api/list_series.rb +2 -0
  40. data/lib/recombee_api_client/api/list_series_items.rb +2 -0
  41. data/lib/recombee_api_client/api/list_user_bookmarks.rb +2 -0
  42. data/lib/recombee_api_client/api/list_user_cart_additions.rb +2 -0
  43. data/lib/recombee_api_client/api/list_user_detail_views.rb +2 -0
  44. data/lib/recombee_api_client/api/list_user_purchases.rb +2 -0
  45. data/lib/recombee_api_client/api/list_user_ratings.rb +2 -0
  46. data/lib/recombee_api_client/api/list_users.rb +2 -0
  47. data/lib/recombee_api_client/api/merge_users.rb +2 -0
  48. data/lib/recombee_api_client/api/remove_from_group.rb +2 -0
  49. data/lib/recombee_api_client/api/remove_from_series.rb +2 -0
  50. data/lib/recombee_api_client/api/reset_database.rb +3 -1
  51. data/lib/recombee_api_client/api/set_item_values.rb +2 -0
  52. data/lib/recombee_api_client/api/user_based_recommendation.rb +19 -3
  53. data/lib/recombee_api_client/version.rb +1 -1
  54. metadata +2 -2
@@ -12,11 +12,13 @@ module RecombeeApiClient
12
12
  class ListItemProperties < ApiRequest
13
13
 
14
14
  attr_accessor :timeout
15
+ attr_accessor :ensure_https
15
16
 
16
17
  ##
17
18
  #
18
19
  def initialize()
19
20
  @timeout = 1000
21
+ @ensure_https = false
20
22
  end
21
23
 
22
24
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListItemPurchases < ApiRequest
12
12
  attr_reader :item_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -20,6 +21,7 @@ module RecombeeApiClient
20
21
  def initialize(item_id)
21
22
  @item_id = item_id
22
23
  @timeout = 1000
24
+ @ensure_https = false
23
25
  end
24
26
 
25
27
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListItemRatings < ApiRequest
12
12
  attr_reader :item_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -20,6 +21,7 @@ module RecombeeApiClient
20
21
  def initialize(item_id)
21
22
  @item_id = item_id
22
23
  @timeout = 1000
24
+ @ensure_https = false
23
25
  end
24
26
 
25
27
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListItems < ApiRequest
12
12
  attr_reader :filter
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  #
@@ -21,6 +22,7 @@ module RecombeeApiClient
21
22
  @filter = optional['filter']
22
23
  @optional = optional
23
24
  @timeout = 1000
25
+ @ensure_https = false
24
26
  @optional.each do |par, _|
25
27
  fail UnknownOptionalParameter.new(par) unless ["filter"].include? par
26
28
  end
@@ -11,11 +11,13 @@ module RecombeeApiClient
11
11
  class ListSeries < ApiRequest
12
12
 
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  #
17
18
  def initialize()
18
19
  @timeout = 1000
20
+ @ensure_https = false
19
21
  end
20
22
 
21
23
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListSeriesItems < ApiRequest
12
12
  attr_reader :series_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(series_id)
20
21
  @series_id = series_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListUserBookmarks < ApiRequest
12
12
  attr_reader :user_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(user_id)
20
21
  @user_id = user_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListUserCartAdditions < ApiRequest
12
12
  attr_reader :user_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(user_id)
20
21
  @user_id = user_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListUserDetailViews < ApiRequest
12
12
  attr_reader :user_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(user_id)
20
21
  @user_id = user_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListUserPurchases < ApiRequest
12
12
  attr_reader :user_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(user_id)
20
21
  @user_id = user_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class ListUserRatings < ApiRequest
12
12
  attr_reader :user_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -19,6 +20,7 @@ module RecombeeApiClient
19
20
  def initialize(user_id)
20
21
  @user_id = user_id
21
22
  @timeout = 1000
23
+ @ensure_https = false
22
24
  end
23
25
 
24
26
  # HTTP method
@@ -11,11 +11,13 @@ module RecombeeApiClient
11
11
  class ListUsers < ApiRequest
12
12
 
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  #
17
18
  def initialize()
18
19
  @timeout = 1000
20
+ @ensure_https = false
19
21
  end
20
22
 
21
23
  # HTTP method
@@ -15,6 +15,7 @@ module RecombeeApiClient
15
15
  class MergeUsers < ApiRequest
16
16
  attr_reader :target_user_id, :source_user_id, :keep_source_user
17
17
  attr_accessor :timeout
18
+ attr_accessor :ensure_https
18
19
 
19
20
  ##
20
21
  # * *Required arguments*
@@ -30,6 +31,7 @@ module RecombeeApiClient
30
31
  @keep_source_user = optional['keepSourceUser']
31
32
  @optional = optional
32
33
  @timeout = 1000
34
+ @ensure_https = false
33
35
  @optional.each do |par, _|
34
36
  fail UnknownOptionalParameter.new(par) unless ["keepSourceUser"].include? par
35
37
  end
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class RemoveFromGroup < ApiRequest
12
12
  attr_reader :group_id, :item_type, :item_id
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -23,6 +24,7 @@ module RecombeeApiClient
23
24
  @item_type = item_type
24
25
  @item_id = item_id
25
26
  @timeout = 1000
27
+ @ensure_https = false
26
28
  end
27
29
 
28
30
  # HTTP method
@@ -11,6 +11,7 @@ module RecombeeApiClient
11
11
  class RemoveFromSeries < ApiRequest
12
12
  attr_reader :series_id, :item_type, :item_id, :time
13
13
  attr_accessor :timeout
14
+ attr_accessor :ensure_https
14
15
 
15
16
  ##
16
17
  # * *Required arguments*
@@ -25,6 +26,7 @@ module RecombeeApiClient
25
26
  @item_id = item_id
26
27
  @time = time
27
28
  @timeout = 1000
29
+ @ensure_https = false
28
30
  end
29
31
 
30
32
  # HTTP method
@@ -12,11 +12,13 @@ module RecombeeApiClient
12
12
  class ResetDatabase < ApiRequest
13
13
 
14
14
  attr_accessor :timeout
15
+ attr_accessor :ensure_https
15
16
 
16
17
  ##
17
18
  #
18
19
  def initialize()
19
- @timeout = 3000
20
+ @timeout = 5000
21
+ @ensure_https = false
20
22
  end
21
23
 
22
24
  # HTTP method
@@ -12,6 +12,7 @@ module RecombeeApiClient
12
12
  class SetItemValues < ApiRequest
13
13
  attr_reader :item_id, :values
14
14
  attr_accessor :timeout
15
+ attr_accessor :ensure_https
15
16
 
16
17
  ##
17
18
  # * *Required arguments*
@@ -35,6 +36,7 @@ module RecombeeApiClient
35
36
  @item_id = item_id
36
37
  @values = values
37
38
  @timeout = 1000
39
+ @ensure_https = false
38
40
  end
39
41
 
40
42
  # HTTP method
@@ -10,8 +10,9 @@ module RecombeeApiClient
10
10
  #Based on user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for a given user.
11
11
  #
12
12
  class UserBasedRecommendation < ApiRequest
13
- attr_reader :user_id, :count, :filter, :booster, :allow_nonexistent, :diversity, :min_relevance, :rotation_rate, :rotation_time
13
+ attr_reader :user_id, :count, :filter, :booster, :allow_nonexistent, :cascade_create, :scenario, :diversity, :min_relevance, :rotation_rate, :rotation_time
14
14
  attr_accessor :timeout
15
+ attr_accessor :ensure_https
15
16
 
16
17
  ##
17
18
  # * *Required arguments*
@@ -21,7 +22,9 @@ module RecombeeApiClient
21
22
  # * *Optional arguments (given as hash optional)*
22
23
  # - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
23
24
  # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
24
- # - +allowNonexistent+ -> If the user does not exist in the database, returns a list of non-personalized recommendations instead of causing HTTP 404 error.
25
+ # - +allowNonexistent+ -> If the user does not exist in the database, returns a list of non-personalized recommendations instead of causing HTTP 404 error. It doesn't create the user in the database.
26
+ # - +cascadeCreate+ -> If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.
27
+ # - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage" or "cart". The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
25
28
  # - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
26
29
  #
27
30
  # - +minRelevance+ -> **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested qualit, and may return less than *count* items when there is not enough data to fulfill it.
@@ -37,14 +40,17 @@ module RecombeeApiClient
37
40
  @filter = optional['filter']
38
41
  @booster = optional['booster']
39
42
  @allow_nonexistent = optional['allowNonexistent']
43
+ @cascade_create = optional['cascadeCreate']
44
+ @scenario = optional['scenario']
40
45
  @diversity = optional['diversity']
41
46
  @min_relevance = optional['minRelevance']
42
47
  @rotation_rate = optional['rotationRate']
43
48
  @rotation_time = optional['rotationTime']
44
49
  @optional = optional
45
50
  @timeout = 3000
51
+ @ensure_https = false
46
52
  @optional.each do |par, _|
47
- fail UnknownOptionalParameter.new(par) unless ["filter","booster","allowNonexistent","diversity","minRelevance","rotationRate","rotationTime"].include? par
53
+ fail UnknownOptionalParameter.new(par) unless ["filter","booster","allowNonexistent","cascadeCreate","scenario","diversity","minRelevance","rotationRate","rotationTime"].include? par
48
54
  end
49
55
  end
50
56
 
@@ -67,6 +73,8 @@ module RecombeeApiClient
67
73
  params['filter'] = @optional['filter'] if @optional['filter']
68
74
  params['booster'] = @optional['booster'] if @optional['booster']
69
75
  params['allowNonexistent'] = @optional['allowNonexistent'] if @optional['allowNonexistent']
76
+ params['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
77
+ params['scenario'] = @optional['scenario'] if @optional['scenario']
70
78
  params['diversity'] = @optional['diversity'] if @optional['diversity']
71
79
  params['minRelevance'] = @optional['minRelevance'] if @optional['minRelevance']
72
80
  params['rotationRate'] = @optional['rotationRate'] if @optional['rotationRate']
@@ -94,6 +102,14 @@ module RecombeeApiClient
94
102
  p += (p.include? '?') ? '&' : '?'
95
103
  p += "allowNonexistent=#{@optional['allowNonexistent']}"
96
104
  end
105
+ if @optional.include? 'cascadeCreate'
106
+ p += (p.include? '?') ? '&' : '?'
107
+ p += "cascadeCreate=#{@optional['cascadeCreate']}"
108
+ end
109
+ if @optional.include? 'scenario'
110
+ p += (p.include? '?') ? '&' : '?'
111
+ p += "scenario=#{@optional['scenario']}"
112
+ end
97
113
  if @optional.include? 'diversity'
98
114
  p += (p.include? '?') ? '&' : '?'
99
115
  p += "diversity=#{@optional['diversity']}"
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-20 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json