recombee_api_client 4.0.0 → 5.0.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/recombee_api_client/api/add_bookmark.rb +2 -2
  4. data/lib/recombee_api_client/api/add_cart_addition.rb +4 -4
  5. data/lib/recombee_api_client/api/add_detail_view.rb +2 -2
  6. data/lib/recombee_api_client/api/add_item.rb +3 -3
  7. data/lib/recombee_api_client/api/add_item_property.rb +2 -2
  8. data/lib/recombee_api_client/api/add_manual_reql_segment.rb +69 -0
  9. data/lib/recombee_api_client/api/add_purchase.rb +5 -5
  10. data/lib/recombee_api_client/api/add_rating.rb +2 -2
  11. data/lib/recombee_api_client/api/add_series.rb +14 -4
  12. data/lib/recombee_api_client/api/add_user.rb +1 -1
  13. data/lib/recombee_api_client/api/add_user_property.rb +2 -2
  14. data/lib/recombee_api_client/api/create_auto_reql_segmentation.rb +75 -0
  15. data/lib/recombee_api_client/api/create_manual_reql_segmentation.rb +71 -0
  16. data/lib/recombee_api_client/api/create_property_based_segmentation.rb +76 -0
  17. data/lib/recombee_api_client/api/delete_bookmark.rb +4 -4
  18. data/lib/recombee_api_client/api/delete_cart_addition.rb +4 -4
  19. data/lib/recombee_api_client/api/delete_detail_view.rb +4 -4
  20. data/lib/recombee_api_client/api/delete_item.rb +3 -3
  21. data/lib/recombee_api_client/api/{list_groups.rb → delete_manual_reql_segment.rb} +13 -7
  22. data/lib/recombee_api_client/api/delete_more_items.rb +4 -4
  23. data/lib/recombee_api_client/api/delete_purchase.rb +4 -4
  24. data/lib/recombee_api_client/api/delete_rating.rb +3 -3
  25. data/lib/recombee_api_client/api/delete_search_synonym.rb +1 -1
  26. data/lib/recombee_api_client/api/{add_group.rb → delete_segmentation.rb} +10 -9
  27. data/lib/recombee_api_client/api/delete_series.rb +14 -4
  28. data/lib/recombee_api_client/api/delete_user.rb +2 -2
  29. data/lib/recombee_api_client/api/delete_user_property.rb +1 -1
  30. data/lib/recombee_api_client/api/delete_view_portion.rb +1 -1
  31. data/lib/recombee_api_client/api/get_item_property_info.rb +1 -1
  32. data/lib/recombee_api_client/api/get_item_values.rb +3 -3
  33. data/lib/recombee_api_client/api/{list_group_items.rb → get_segmentation.rb} +9 -8
  34. data/lib/recombee_api_client/api/get_user_values.rb +3 -3
  35. data/lib/recombee_api_client/api/insert_to_series.rb +3 -3
  36. data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -2
  37. data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -2
  38. data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -2
  39. data/lib/recombee_api_client/api/list_item_purchases.rb +2 -2
  40. data/lib/recombee_api_client/api/list_item_ratings.rb +2 -2
  41. data/lib/recombee_api_client/api/list_item_view_portions.rb +2 -2
  42. data/lib/recombee_api_client/api/list_items.rb +1 -1
  43. data/lib/recombee_api_client/api/{delete_group.rb → list_segmentations.rb} +10 -11
  44. data/lib/recombee_api_client/api/list_series_items.rb +2 -2
  45. data/lib/recombee_api_client/api/list_user_bookmarks.rb +1 -1
  46. data/lib/recombee_api_client/api/list_user_cart_additions.rb +1 -1
  47. data/lib/recombee_api_client/api/list_user_detail_views.rb +1 -1
  48. data/lib/recombee_api_client/api/list_user_purchases.rb +1 -1
  49. data/lib/recombee_api_client/api/list_user_ratings.rb +1 -1
  50. data/lib/recombee_api_client/api/list_user_view_portions.rb +1 -1
  51. data/lib/recombee_api_client/api/list_users.rb +1 -1
  52. data/lib/recombee_api_client/api/merge_users.rb +2 -2
  53. data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +131 -0
  54. data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +131 -0
  55. data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +111 -0
  56. data/lib/recombee_api_client/api/recommend_items_to_item.rb +26 -26
  57. data/lib/recombee_api_client/api/recommend_items_to_item_segment.rb +207 -0
  58. data/lib/recombee_api_client/api/recommend_items_to_user.rb +23 -23
  59. data/lib/recombee_api_client/api/recommend_next_items.rb +2 -2
  60. data/lib/recombee_api_client/api/recommend_users_to_item.rb +18 -18
  61. data/lib/recombee_api_client/api/recommend_users_to_user.rb +21 -21
  62. data/lib/recombee_api_client/api/remove_from_series.rb +5 -8
  63. data/lib/recombee_api_client/api/reset_database.rb +1 -1
  64. data/lib/recombee_api_client/api/search_item_segments.rb +114 -0
  65. data/lib/recombee_api_client/api/search_items.rb +17 -17
  66. data/lib/recombee_api_client/api/set_view_portion.rb +4 -4
  67. data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +69 -0
  68. data/lib/recombee_api_client/api/update_manual_reql_segment.rb +67 -0
  69. data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +65 -0
  70. data/lib/recombee_api_client/api/update_more_items.rb +4 -4
  71. data/lib/recombee_api_client/api/update_property_based_segmentation.rb +69 -0
  72. data/lib/recombee_api_client/version.rb +1 -1
  73. data/lib/recombee_api_client.rb +1 -1
  74. data/recombee_api_client.gemspec +10 -8
  75. metadata +40 -31
  76. data/lib/recombee_api_client/api/insert_to_group.rb +0 -66
  77. data/lib/recombee_api_client/api/remove_from_group.rb +0 -55
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddc59d0fe517546ea3c3e201f4ba31fdab38fee38ef7ab2780a226744d94ed8a
4
- data.tar.gz: 2afe45ef3d9540eb9a1c112152b33a2559d8be9dd49bc613904020ee648e300a
3
+ metadata.gz: b6ba78bee5be7cbf745ccd6a3515fdd2bb33d1b44d7bad833496f03253c9d33d
4
+ data.tar.gz: 60b9259daa982cc5a1d7b7f754673d2283bb8d016a3b1d11358f14e61f2c4d4c
5
5
  SHA512:
6
- metadata.gz: 4550dea796a247b45f3e80c840b876dec5065835f9127ad5f991440256e512dbd40c9d1c95675c7d3d4fe8700d5851201c278193ed561d2d28414b660b111d30
7
- data.tar.gz: efa14da6a11f0fa00490e38cf22f0e9bdf741e7a331ef69a9b609ef683c28b2f7c07afb70548d07077e8b366ca968f2592290249591b28f1d8f0320136b54f49
6
+ metadata.gz: 367c36d059d054f2be05651d41ee4c0c2a268f05a68667c424b690ebb21b41fe81a2f40d0e578848cf53ba252f0b61d8143da5c3c44d85ada360c1506b4d089b
7
+ data.tar.gz: a2e076c146940a86bab07eac90756745a6af9343b69e571f636b4e2bd309b22771f690a170b14cb58feebf69d4c215eaa8f2fee09ae320d05b9d8cef867db9aa
data/README.md CHANGED
@@ -29,7 +29,7 @@ Or install it yourself as:
29
29
  require 'recombee_api_client'
30
30
  include RecombeeApiClient
31
31
 
32
- client = RecombeeClient('--my-database-id--', '--db-private-token--', {:region => 'us-west'})
32
+ client = RecombeeClient.new('--my-database-id--', '--db-private-token--', {:region => 'us-west'})
33
33
 
34
34
  # Generate some random purchases of items by users
35
35
  NUM = 100
@@ -76,7 +76,7 @@ include RecombeeApiClient
76
76
  NUM = 100
77
77
  PROBABILITY_PURCHASED = 0.1
78
78
 
79
- client = RecombeeClient('--my-database-id--', '--db-private-token--', {:region => 'ap-se'})
79
+ client = RecombeeClient.new('--my-database-id--', '--db-private-token--', {:region => 'ap-se'})
80
80
  client.send(ResetDatabase.new) # Clear everything from the database (asynchronous)
81
81
 
82
82
  # We will use computers as items in this example
@@ -177,4 +177,4 @@ rescue ApiTimeout => e
177
177
  rescue APIError => e
178
178
  # APIError is parent of both ResponseError and ApiTimeout
179
179
  end
180
- ```
180
+ ```
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds a bookmark of a given item made by a given user.
10
+ #Adds a bookmark of the given item made by the given user.
11
11
  #
12
12
  class AddBookmark < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp, :cascade_create, :recomm_id, :additional_data
@@ -34,7 +34,7 @@ module RecombeeApiClient
34
34
  @recomm_id = optional['recommId']
35
35
  @additional_data = optional['additionalData']
36
36
  @optional = optional
37
- @timeout = 1000
37
+ @timeout = 3000
38
38
  @ensure_https = false
39
39
  @optional.each do |par, _|
40
40
  fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate","recommId","additionalData"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds a cart addition of a given item made by a given user.
10
+ #Adds a cart addition of the given item made by the given user.
11
11
  #
12
12
  class AddCartAddition < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp, :cascade_create, :amount, :price, :recomm_id, :additional_data
@@ -22,8 +22,8 @@ module RecombeeApiClient
22
22
  # * *Optional arguments (given as hash optional)*
23
23
  # - +timestamp+ -> UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
24
24
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
25
- # - +amount+ -> Amount (number) added to cart. The default is 1. For example if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal to 2.
26
- # - +price+ -> Price of the added item. If `amount` is greater than 1, sum of prices of all the items should be given.
25
+ # - +amount+ -> Amount (number) added to cart. The default is 1. For example, if `user-x` adds two `item-y` during a single order (session...), the `amount` should equal 2.
26
+ # - +price+ -> Price of the added item. If `amount` is greater than 1, the sum of prices of all the items should be given.
27
27
  # - +recommId+ -> If this cart addition is based on a recommendation request, `recommId` is the id of the clicked recommendation.
28
28
  # - +additionalData+ -> A dictionary of additional data for the interaction.
29
29
  #
@@ -38,7 +38,7 @@ module RecombeeApiClient
38
38
  @recomm_id = optional['recommId']
39
39
  @additional_data = optional['additionalData']
40
40
  @optional = optional
41
- @timeout = 1000
41
+ @timeout = 3000
42
42
  @ensure_https = false
43
43
  @optional.each do |par, _|
44
44
  fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate","amount","price","recommId","additionalData"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds a detail view of a given item made by a given user.
10
+ #Adds a detail view of the given item made by the given user.
11
11
  #
12
12
  class AddDetailView < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp, :duration, :cascade_create, :recomm_id, :additional_data
@@ -36,7 +36,7 @@ module RecombeeApiClient
36
36
  @recomm_id = optional['recommId']
37
37
  @additional_data = optional['additionalData']
38
38
  @optional = optional
39
- @timeout = 1000
39
+ @timeout = 3000
40
40
  @ensure_https = false
41
41
  @optional.each do |par, _|
42
42
  fail UnknownOptionalParameter.new(par) unless ["timestamp","duration","cascadeCreate","recommId","additionalData"].include? par
@@ -7,9 +7,9 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds new item of given `itemId` to the items catalog.
10
+ #Adds new item of the given `itemId` to the items catalog.
11
11
  #
12
- #All the item properties for the newly created items are set null.
12
+ #All the item properties for the newly created items are set to null.
13
13
  #
14
14
  class AddItem < ApiRequest
15
15
  attr_reader :item_id
@@ -22,7 +22,7 @@ module RecombeeApiClient
22
22
  #
23
23
  def initialize(item_id)
24
24
  @item_id = item_id
25
- @timeout = 1000
25
+ @timeout = 3000
26
26
  @ensure_https = false
27
27
  end
28
28
 
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adding an item property is somehow equivalent to adding a column to the table of items. The items may be characterized by various properties of different types.
10
+ #Adding an item property is somewhat equivalent to adding a column to the table of items. The items may be characterized by various properties of different types.
11
11
  #
12
12
  class AddItemProperty < ApiRequest
13
13
  attr_reader :property_name, :type
@@ -16,7 +16,7 @@ module RecombeeApiClient
16
16
 
17
17
  ##
18
18
  # * *Required arguments*
19
- # - +property_name+ -> Name of the item property to be created. Currently, the following names are reserved:`id`, `itemid`, case insensitively. Also, the length of the property name must not exceed 63 characters.
19
+ # - +property_name+ -> Name of the item property to be created. Currently, the following names are reserved: `id`, `itemid`, case-insensitively. Also, the length of the property name must not exceed 63 characters.
20
20
  #
21
21
  # - +type+ -> Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
22
22
  #
@@ -0,0 +1,69 @@
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
+ #Adds a new Segment into a Manual ReQL Segmentation.
11
+ #
12
+ #The new Segment is defined by a [ReQL](https://docs.recombee.com/reql.html) filter that returns `true` for an item in case that this item belongs to the segment.
13
+ #
14
+ class AddManualReqlSegment < ApiRequest
15
+ attr_reader :segmentation_id, :segment_id, :filter, :title
16
+ attr_accessor :timeout
17
+ attr_accessor :ensure_https
18
+
19
+ ##
20
+ # * *Required arguments*
21
+ # - +segmentation_id+ -> ID of the Segmentation to which the new Segment should be added
22
+ # - +segment_id+ -> ID of the newly created Segment
23
+ # - +filter+ -> ReQL filter that returns `true` for items that belong to this Segment. Otherwise returns `false`.
24
+ #
25
+ #
26
+ # * *Optional arguments (given as hash optional)*
27
+ # - +title+ -> Human-readable name of the Segment that is shown in the Recombee Admin UI.
28
+ #
29
+ #
30
+ def initialize(segmentation_id, segment_id, filter, optional = {})
31
+ @segmentation_id = segmentation_id
32
+ @segment_id = segment_id
33
+ @filter = filter
34
+ optional = normalize_optional(optional)
35
+ @title = optional['title']
36
+ @optional = optional
37
+ @timeout = 10000
38
+ @ensure_https = false
39
+ @optional.each do |par, _|
40
+ fail UnknownOptionalParameter.new(par) unless ["title"].include? par
41
+ end
42
+ end
43
+
44
+ # HTTP method
45
+ def method
46
+ :put
47
+ end
48
+
49
+ # Values of body parameters as a Hash
50
+ def body_parameters
51
+ p = Hash.new
52
+ p['filter'] = @filter
53
+ p['title'] = @optional['title'] if @optional.include? 'title'
54
+ p
55
+ end
56
+
57
+ # Values of query parameters as a Hash.
58
+ # name of parameter => value of the parameter
59
+ def query_parameters
60
+ params = {}
61
+ params
62
+ end
63
+
64
+ # Relative path to the endpoint
65
+ def path
66
+ "/{databaseId}/segmentations/manual-reql/#{@segmentation_id}/segments/#{@segment_id}"
67
+ end
68
+ end
69
+ end
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds a purchase of a given item made by a given user.
10
+ #Adds a purchase of the given item made by the given user.
11
11
  #
12
12
  class AddPurchase < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp, :cascade_create, :amount, :price, :profit, :recomm_id, :additional_data
@@ -22,9 +22,9 @@ module RecombeeApiClient
22
22
  # * *Optional arguments (given as hash optional)*
23
23
  # - +timestamp+ -> UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
24
24
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
25
- # - +amount+ -> Amount (number) of purchased items. The default is 1. For example if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal to 2.
26
- # - +price+ -> Price paid by the user for the item. If `amount` is greater than 1, sum of prices of all the items should be given.
27
- # - +profit+ -> Your profit from the purchased item. The profit is natural in e-commerce domain (for example if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30), but is applicable also in other domains (for example at a news company it may be income from displayed advertisement on article page). If `amount` is greater than 1, sum of profit of all the items should be given.
25
+ # - +amount+ -> Amount (number) of purchased items. The default is 1. For example, if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal 2.
26
+ # - +price+ -> Price paid by the user for the item. If `amount` is greater than 1, the sum of prices of all the items should be given.
27
+ # - +profit+ -> Your profit from the purchased item. The profit is natural in the e-commerce domain (for example, if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30) but is also applicable in other domains (for example, at a news company it may be income from a displayed advertisement on article page). If `amount` is greater than 1, the sum of profit of all the items should be given.
28
28
  # - +recommId+ -> If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.
29
29
  # - +additionalData+ -> A dictionary of additional data for the interaction.
30
30
  #
@@ -40,7 +40,7 @@ module RecombeeApiClient
40
40
  @recomm_id = optional['recommId']
41
41
  @additional_data = optional['additionalData']
42
42
  @optional = optional
43
- @timeout = 1000
43
+ @timeout = 3000
44
44
  @ensure_https = false
45
45
  @optional.each do |par, _|
46
46
  fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate","amount","price","profit","recommId","additionalData"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adds a rating of given item made by a given user.
10
+ #Adds a rating of the given item made by the given user.
11
11
  #
12
12
  class AddRating < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp, :rating, :cascade_create, :recomm_id, :additional_data
@@ -36,7 +36,7 @@ module RecombeeApiClient
36
36
  @recomm_id = optional['recommId']
37
37
  @additional_data = optional['additionalData']
38
38
  @optional = optional
39
- @timeout = 1000
39
+ @timeout = 3000
40
40
  @ensure_https = false
41
41
  @optional.each do |par, _|
42
42
  fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate","recommId","additionalData"].include? par
@@ -7,9 +7,9 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Creates new series in the database.
10
+ #Creates a new series in the database.
11
11
  class AddSeries < ApiRequest
12
- attr_reader :series_id
12
+ attr_reader :series_id, :cascade_create
13
13
  attr_accessor :timeout
14
14
  attr_accessor :ensure_https
15
15
 
@@ -17,10 +17,19 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +series_id+ -> ID of the series to be created.
19
19
  #
20
- def initialize(series_id)
20
+ # * *Optional arguments (given as hash optional)*
21
+ # - +cascadeCreate+ -> If set to `true`, the item will be created with the same ID as the series. Default is `true`.
22
+ #
23
+ def initialize(series_id, optional = {})
21
24
  @series_id = series_id
22
- @timeout = 1000
25
+ optional = normalize_optional(optional)
26
+ @cascade_create = optional['cascadeCreate']
27
+ @optional = optional
28
+ @timeout = 3000
23
29
  @ensure_https = false
30
+ @optional.each do |par, _|
31
+ fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
32
+ end
24
33
  end
25
34
 
26
35
  # HTTP method
@@ -31,6 +40,7 @@ module RecombeeApiClient
31
40
  # Values of body parameters as a Hash
32
41
  def body_parameters
33
42
  p = Hash.new
43
+ p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
34
44
  p
35
45
  end
36
46
 
@@ -20,7 +20,7 @@ module RecombeeApiClient
20
20
  #
21
21
  def initialize(user_id)
22
22
  @user_id = user_id
23
- @timeout = 1000
23
+ @timeout = 3000
24
24
  @ensure_https = false
25
25
  end
26
26
 
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Adding an user property is somehow equivalent to adding a column to the table of users. The users may be characterized by various properties of different types.
10
+ #Adding a user property is somewhat equivalent to adding a column to the table of users. The users may be characterized by various properties of different types.
11
11
  #
12
12
  class AddUserProperty < ApiRequest
13
13
  attr_reader :property_name, :type
@@ -16,7 +16,7 @@ module RecombeeApiClient
16
16
 
17
17
  ##
18
18
  # * *Required arguments*
19
- # - +property_name+ -> Name of the user property to be created. Currently, the following names are reserved:`id`, `userid`, case insensitively. Also, the length of the property name must not exceed 63 characters.
19
+ # - +property_name+ -> Name of the user property to be created. Currently, the following names are reserved: `id`, `userid`, case-insensitively. Also, the length of the property name must not exceed 63 characters.
20
20
  #
21
21
  # - +type+ -> Value type of the user property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`.
22
22
  #
@@ -0,0 +1,75 @@
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
+ #Segment the items using a [ReQL](https://docs.recombee.com/reql.html) expression.
11
+ #
12
+ #For each item, the expression should return a set that contains IDs of segments to which the item belongs to.
13
+ #
14
+ class CreateAutoReqlSegmentation < ApiRequest
15
+ attr_reader :segmentation_id, :source_type, :expression, :title, :description
16
+ attr_accessor :timeout
17
+ attr_accessor :ensure_https
18
+
19
+ ##
20
+ # * *Required arguments*
21
+ # - +segmentation_id+ -> ID of the newly created Segmentation
22
+ # - +source_type+ -> What type of data should be segmented. Currently only `items` are supported.
23
+ #
24
+ # - +expression+ -> ReQL expression that returns for each item a set with IDs of segments to which the item belongs
25
+ #
26
+ #
27
+ # * *Optional arguments (given as hash optional)*
28
+ # - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
29
+ #
30
+ # - +description+ -> Description that is shown in the Recombee Admin UI.
31
+ #
32
+ #
33
+ def initialize(segmentation_id, source_type, expression, optional = {})
34
+ @segmentation_id = segmentation_id
35
+ @source_type = source_type
36
+ @expression = expression
37
+ optional = normalize_optional(optional)
38
+ @title = optional['title']
39
+ @description = optional['description']
40
+ @optional = optional
41
+ @timeout = 10000
42
+ @ensure_https = false
43
+ @optional.each do |par, _|
44
+ fail UnknownOptionalParameter.new(par) unless ["title","description"].include? par
45
+ end
46
+ end
47
+
48
+ # HTTP method
49
+ def method
50
+ :put
51
+ end
52
+
53
+ # Values of body parameters as a Hash
54
+ def body_parameters
55
+ p = Hash.new
56
+ p['sourceType'] = @source_type
57
+ p['expression'] = @expression
58
+ p['title'] = @optional['title'] if @optional.include? 'title'
59
+ p['description'] = @optional['description'] if @optional.include? 'description'
60
+ p
61
+ end
62
+
63
+ # Values of query parameters as a Hash.
64
+ # name of parameter => value of the parameter
65
+ def query_parameters
66
+ params = {}
67
+ params
68
+ end
69
+
70
+ # Relative path to the endpoint
71
+ def path
72
+ "/{databaseId}/segmentations/auto-reql/#{@segmentation_id}"
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,71 @@
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
+ #Segment the items using multiple [ReQL](https://docs.recombee.com/reql.html) filters.
11
+ #
12
+ #Use the Add Manual ReQL Items Segment endpoint to create the individual segments.
13
+ #
14
+ class CreateManualReqlSegmentation < ApiRequest
15
+ attr_reader :segmentation_id, :source_type, :title, :description
16
+ attr_accessor :timeout
17
+ attr_accessor :ensure_https
18
+
19
+ ##
20
+ # * *Required arguments*
21
+ # - +segmentation_id+ -> ID of the newly created Segmentation
22
+ # - +source_type+ -> What type of data should be segmented. Currently only `items` are supported.
23
+ #
24
+ #
25
+ # * *Optional arguments (given as hash optional)*
26
+ # - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
27
+ #
28
+ # - +description+ -> Description that is shown in the Recombee Admin UI.
29
+ #
30
+ #
31
+ def initialize(segmentation_id, source_type, optional = {})
32
+ @segmentation_id = segmentation_id
33
+ @source_type = source_type
34
+ optional = normalize_optional(optional)
35
+ @title = optional['title']
36
+ @description = optional['description']
37
+ @optional = optional
38
+ @timeout = 10000
39
+ @ensure_https = false
40
+ @optional.each do |par, _|
41
+ fail UnknownOptionalParameter.new(par) unless ["title","description"].include? par
42
+ end
43
+ end
44
+
45
+ # HTTP method
46
+ def method
47
+ :put
48
+ end
49
+
50
+ # Values of body parameters as a Hash
51
+ def body_parameters
52
+ p = Hash.new
53
+ p['sourceType'] = @source_type
54
+ p['title'] = @optional['title'] if @optional.include? 'title'
55
+ p['description'] = @optional['description'] if @optional.include? 'description'
56
+ p
57
+ end
58
+
59
+ # Values of query parameters as a Hash.
60
+ # name of parameter => value of the parameter
61
+ def query_parameters
62
+ params = {}
63
+ params
64
+ end
65
+
66
+ # Relative path to the endpoint
67
+ def path
68
+ "/{databaseId}/segmentations/manual-reql/#{@segmentation_id}"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,76 @@
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
+ #Creates a Segmentation that splits the items into segments based on values of a particular item property.
11
+ #
12
+ #A segment is created for each unique value of the property.
13
+ #In case of `set` properties, a segment is created for each value in the set. Item belongs to all these segments.
14
+ #
15
+ class CreatePropertyBasedSegmentation < ApiRequest
16
+ attr_reader :segmentation_id, :source_type, :property_name, :title, :description
17
+ attr_accessor :timeout
18
+ attr_accessor :ensure_https
19
+
20
+ ##
21
+ # * *Required arguments*
22
+ # - +segmentation_id+ -> ID of the newly created Segmentation
23
+ # - +source_type+ -> What type of data should be segmented. Currently only `items` are supported.
24
+ #
25
+ # - +property_name+ -> Name of the property on which the Segmentation should be based
26
+ #
27
+ #
28
+ # * *Optional arguments (given as hash optional)*
29
+ # - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
30
+ #
31
+ # - +description+ -> Description that is shown in the Recombee Admin UI.
32
+ #
33
+ #
34
+ def initialize(segmentation_id, source_type, property_name, optional = {})
35
+ @segmentation_id = segmentation_id
36
+ @source_type = source_type
37
+ @property_name = property_name
38
+ optional = normalize_optional(optional)
39
+ @title = optional['title']
40
+ @description = optional['description']
41
+ @optional = optional
42
+ @timeout = 10000
43
+ @ensure_https = false
44
+ @optional.each do |par, _|
45
+ fail UnknownOptionalParameter.new(par) unless ["title","description"].include? par
46
+ end
47
+ end
48
+
49
+ # HTTP method
50
+ def method
51
+ :put
52
+ end
53
+
54
+ # Values of body parameters as a Hash
55
+ def body_parameters
56
+ p = Hash.new
57
+ p['sourceType'] = @source_type
58
+ p['propertyName'] = @property_name
59
+ p['title'] = @optional['title'] if @optional.include? 'title'
60
+ p['description'] = @optional['description'] if @optional.include? 'description'
61
+ p
62
+ end
63
+
64
+ # Values of query parameters as a Hash.
65
+ # name of parameter => value of the parameter
66
+ def query_parameters
67
+ params = {}
68
+ params
69
+ end
70
+
71
+ # Relative path to the endpoint
72
+ def path
73
+ "/{databaseId}/segmentations/property-based/#{@segmentation_id}"
74
+ end
75
+ end
76
+ end
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with given `userId` and `itemId` if `timestamp` is omitted.
10
+ #Deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with the given `userId` and `itemId` if `timestamp` is omitted.
11
11
  #
12
12
  class DeleteBookmark < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp
@@ -17,10 +17,10 @@ module RecombeeApiClient
17
17
  ##
18
18
  # * *Required arguments*
19
19
  # - +user_id+ -> ID of the user who made the bookmark.
20
- # - +item_id+ -> ID of the item of which was bookmarked.
20
+ # - +item_id+ -> ID of the item which was bookmarked.
21
21
  #
22
22
  # * *Optional arguments (given as hash optional)*
23
- # - +timestamp+ -> Unix timestamp of the bookmark. If the `timestamp` is omitted, then all the bookmarks with given `userId` and `itemId` are deleted.
23
+ # - +timestamp+ -> Unix timestamp of the bookmark. If the `timestamp` is omitted, then all the bookmarks with the given `userId` and `itemId` are deleted.
24
24
  #
25
25
  def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
@@ -28,7 +28,7 @@ module RecombeeApiClient
28
28
  optional = normalize_optional(optional)
29
29
  @timestamp = optional['timestamp']
30
30
  @optional = optional
31
- @timeout = 1000
31
+ @timeout = 3000
32
32
  @ensure_https = false
33
33
  @optional.each do |par, _|
34
34
  fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Deletes an existing cart addition uniquely specified by `userId`, `itemId`, and `timestamp` or all the cart additions with given `userId` and `itemId` if `timestamp` is omitted.
10
+ #Deletes an existing cart addition uniquely specified by `userId`, `itemId`, and `timestamp` or all the cart additions with the given `userId` and `itemId` if `timestamp` is omitted.
11
11
  #
12
12
  class DeleteCartAddition < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp
@@ -17,10 +17,10 @@ module RecombeeApiClient
17
17
  ##
18
18
  # * *Required arguments*
19
19
  # - +user_id+ -> ID of the user who made the cart addition.
20
- # - +item_id+ -> ID of the item of which was added to cart.
20
+ # - +item_id+ -> ID of the item which was added to the cart.
21
21
  #
22
22
  # * *Optional arguments (given as hash optional)*
23
- # - +timestamp+ -> Unix timestamp of the cart addition. If the `timestamp` is omitted, then all the cart additions with given `userId` and `itemId` are deleted.
23
+ # - +timestamp+ -> Unix timestamp of the cart addition. If the `timestamp` is omitted, then all the cart additions with the given `userId` and `itemId` are deleted.
24
24
  #
25
25
  def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
@@ -28,7 +28,7 @@ module RecombeeApiClient
28
28
  optional = normalize_optional(optional)
29
29
  @timestamp = optional['timestamp']
30
30
  @optional = optional
31
- @timeout = 1000
31
+ @timeout = 3000
32
32
  @ensure_https = false
33
33
  @optional.each do |par, _|
34
34
  fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Deletes an existing detail view uniquely specified by (`userId`, `itemId`, and `timestamp`) or all the detail views with given `userId` and `itemId` if `timestamp` is omitted.
10
+ #Deletes an existing detail view uniquely specified by (`userId`, `itemId`, and `timestamp`) or all the detail views with the given `userId` and `itemId` if `timestamp` is omitted.
11
11
  #
12
12
  class DeleteDetailView < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp
@@ -17,10 +17,10 @@ module RecombeeApiClient
17
17
  ##
18
18
  # * *Required arguments*
19
19
  # - +user_id+ -> ID of the user who made the detail view.
20
- # - +item_id+ -> ID of the item of which the details were viewed.
20
+ # - +item_id+ -> ID of the item whose details were viewed.
21
21
  #
22
22
  # * *Optional arguments (given as hash optional)*
23
- # - +timestamp+ -> Unix timestamp of the detail view. If the `timestamp` is omitted, then all the detail views with given `userId` and `itemId` are deleted.
23
+ # - +timestamp+ -> Unix timestamp of the detail view. If the `timestamp` is omitted, then all the detail views with the given `userId` and `itemId` are deleted.
24
24
  #
25
25
  def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
@@ -28,7 +28,7 @@ module RecombeeApiClient
28
28
  optional = normalize_optional(optional)
29
29
  @timestamp = optional['timestamp']
30
30
  @optional = optional
31
- @timeout = 1000
31
+ @timeout = 3000
32
32
  @ensure_https = false
33
33
  @optional.each do |par, _|
34
34
  fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par