recombee_api_client 3.2.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/recombee_api_client/api/add_bookmark.rb +1 -1
  4. data/lib/recombee_api_client/api/add_cart_addition.rb +3 -3
  5. data/lib/recombee_api_client/api/add_detail_view.rb +1 -1
  6. data/lib/recombee_api_client/api/add_group.rb +1 -1
  7. data/lib/recombee_api_client/api/add_item.rb +2 -2
  8. data/lib/recombee_api_client/api/add_item_property.rb +1 -1
  9. data/lib/recombee_api_client/api/add_manual_reql_segment.rb +69 -0
  10. data/lib/recombee_api_client/api/add_purchase.rb +4 -4
  11. data/lib/recombee_api_client/api/add_rating.rb +1 -1
  12. data/lib/recombee_api_client/api/add_series.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 +3 -3
  18. data/lib/recombee_api_client/api/delete_cart_addition.rb +3 -3
  19. data/lib/recombee_api_client/api/delete_detail_view.rb +3 -3
  20. data/lib/recombee_api_client/api/delete_group.rb +2 -2
  21. data/lib/recombee_api_client/api/delete_item.rb +3 -3
  22. data/lib/recombee_api_client/api/delete_manual_reql_segment.rb +52 -0
  23. data/lib/recombee_api_client/api/delete_more_items.rb +52 -0
  24. data/lib/recombee_api_client/api/delete_purchase.rb +3 -3
  25. data/lib/recombee_api_client/api/delete_rating.rb +2 -2
  26. data/lib/recombee_api_client/api/delete_search_synonym.rb +1 -1
  27. data/lib/recombee_api_client/api/delete_segmentation.rb +50 -0
  28. data/lib/recombee_api_client/api/delete_series.rb +1 -1
  29. data/lib/recombee_api_client/api/delete_user.rb +2 -2
  30. data/lib/recombee_api_client/api/delete_user_property.rb +1 -1
  31. data/lib/recombee_api_client/api/get_item_values.rb +2 -2
  32. data/lib/recombee_api_client/api/get_segmentation.rb +50 -0
  33. data/lib/recombee_api_client/api/get_user_values.rb +2 -2
  34. data/lib/recombee_api_client/api/insert_to_group.rb +2 -2
  35. data/lib/recombee_api_client/api/insert_to_series.rb +2 -2
  36. data/lib/recombee_api_client/api/list_group_items.rb +1 -1
  37. data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -2
  38. data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -2
  39. data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -2
  40. data/lib/recombee_api_client/api/list_item_purchases.rb +2 -2
  41. data/lib/recombee_api_client/api/list_item_ratings.rb +2 -2
  42. data/lib/recombee_api_client/api/list_item_view_portions.rb +2 -2
  43. data/lib/recombee_api_client/api/list_items.rb +1 -1
  44. data/lib/recombee_api_client/api/list_segmentations.rb +51 -0
  45. data/lib/recombee_api_client/api/list_series_items.rb +2 -2
  46. data/lib/recombee_api_client/api/list_user_bookmarks.rb +1 -1
  47. data/lib/recombee_api_client/api/list_user_cart_additions.rb +1 -1
  48. data/lib/recombee_api_client/api/list_user_detail_views.rb +1 -1
  49. data/lib/recombee_api_client/api/list_user_purchases.rb +1 -1
  50. data/lib/recombee_api_client/api/list_user_ratings.rb +1 -1
  51. data/lib/recombee_api_client/api/list_user_view_portions.rb +1 -1
  52. data/lib/recombee_api_client/api/list_users.rb +1 -1
  53. data/lib/recombee_api_client/api/merge_users.rb +2 -2
  54. data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +131 -0
  55. data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +131 -0
  56. data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +111 -0
  57. data/lib/recombee_api_client/api/recommend_items_to_item.rb +26 -26
  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/reset_database.rb +1 -1
  63. data/lib/recombee_api_client/api/search_item_segments.rb +114 -0
  64. data/lib/recombee_api_client/api/search_items.rb +17 -17
  65. data/lib/recombee_api_client/api/set_view_portion.rb +3 -3
  66. data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +69 -0
  67. data/lib/recombee_api_client/api/update_manual_reql_segment.rb +67 -0
  68. data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +65 -0
  69. data/lib/recombee_api_client/api/update_more_items.rb +63 -0
  70. data/lib/recombee_api_client/api/update_property_based_segmentation.rb +69 -0
  71. data/lib/recombee_api_client/version.rb +1 -1
  72. data/lib/recombee_api_client.rb +40 -15
  73. data/recombee_api_client.gemspec +2 -2
  74. metadata +24 -8
  75. data/lib/recombee_api_client/api/item_based_recommendation.rb +0 -159
  76. data/lib/recombee_api_client/api/user_based_recommendation.rb +0 -143
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 993911797068c239b3eb1ed0bff4f115049a3a7c5c25cc10ee2e7606fabaecc5
4
- data.tar.gz: 9759c4ad279ea317cbdf0d6b3ac93eee89761010b1d8aded8cdd946f9dc0e793
3
+ metadata.gz: 4768bdac13cee19e3667d59b7cac6ac68fb4df9c63f4fbab76eb2168f76e135a
4
+ data.tar.gz: ce298750cdbcec2ad0ec3d3e9baab087d742f44bc9e3e3fc6bc742dcdfcb8c17
5
5
  SHA512:
6
- metadata.gz: 7a5cccd32d72f4ec654b3ffc9c8f9d0f50e90618b104afc7618e24cf40f0ad9ceaf14b18031d7e8c4ef1ac05027a7857a592e3fc18fded5a7a2f1b27b80f9225
7
- data.tar.gz: 8a68e11edd23890854ec6248994d77e4f494fd19b881d798eb7f916b0823b77987695ad0c439594fdadc82c7f229cda3128ce6d3dfecdd17162e38654d1f3200
6
+ metadata.gz: 1b2c012a478a9a49ebde323fbc5f0b089dbd3287fdd11224abeb2e366a15db0af884068374ffbb46c296ea6f325e9870fda459763e563a7e16391cbc2031cfd3
7
+ data.tar.gz: e5786b070204e530824968bca26dfb5e5086a9670110a1aced8773c47f1f0a131ff2302a8c15c44483eb2a62bae39cb9744333e898a8749c287456330cae58cb
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--')
32
+ client = RecombeeClient('--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--')
79
+ client = RecombeeClient('--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
@@ -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
@@ -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
  #
@@ -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
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Creates new group in the database.
10
+ #Creates a new group in the database.
11
11
  class AddGroup < ApiRequest
12
12
  attr_reader :group_id
13
13
  attr_accessor :timeout
@@ -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
@@ -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
  #
@@ -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
@@ -7,7 +7,7 @@ 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
12
  attr_reader :series_id
13
13
  attr_accessor :timeout
@@ -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 somehow 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
@@ -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
@@ -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
@@ -7,9 +7,9 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Deletes the group of given `groupId` from the database.
10
+ #Deletes the group of the given `groupId` from the database.
11
11
  #
12
- #Deleting a group will only delete assignment of items to it, not the items themselves!
12
+ #Deleting a group will only delete the assignment of items to it, not the items themselves!
13
13
  #
14
14
  class DeleteGroup < ApiRequest
15
15
  attr_reader :group_id
@@ -7,11 +7,11 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Deletes an item of given `itemId` from the catalog.
10
+ #Deletes an item of the given `itemId` from the catalog.
11
11
  #
12
- #If there are any *purchases*, *ratings*, *bookmarks*, *cart additions* or *detail views* of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some *series*, it will be removed from all the *series* where present.
12
+ #If there are any *purchases*, *ratings*, *bookmarks*, *cart additions*, or *detail views* of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some *series*, it will be removed from all the *series* where present.
13
13
  #
14
- #If an item becomes obsolete/no longer available, it is often meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and only exclude the item from recommendations. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
14
+ #If an item becomes obsolete/no longer available, it is meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
15
15
  #
16
16
  class DeleteItem < ApiRequest
17
17
  attr_reader :item_id
@@ -0,0 +1,52 @@
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
+ #Delete a Segment from a Manual ReQL Segmentation.
11
+ #
12
+ class DeleteManualReqlSegment < ApiRequest
13
+ attr_reader :segmentation_id, :segment_id
14
+ attr_accessor :timeout
15
+ attr_accessor :ensure_https
16
+
17
+ ##
18
+ # * *Required arguments*
19
+ # - +segmentation_id+ -> ID of the Segmentation from which the Segment should be deleted
20
+ # - +segment_id+ -> ID of the Segment that should be deleted
21
+ #
22
+ def initialize(segmentation_id, segment_id)
23
+ @segmentation_id = segmentation_id
24
+ @segment_id = segment_id
25
+ @timeout = 10000
26
+ @ensure_https = false
27
+ end
28
+
29
+ # HTTP method
30
+ def method
31
+ :delete
32
+ end
33
+
34
+ # Values of body parameters as a Hash
35
+ def body_parameters
36
+ p = Hash.new
37
+ p
38
+ end
39
+
40
+ # Values of query parameters as a Hash.
41
+ # name of parameter => value of the parameter
42
+ def query_parameters
43
+ params = {}
44
+ params
45
+ end
46
+
47
+ # Relative path to the endpoint
48
+ def path
49
+ "/{databaseId}/segmentations/manual-reql/#{@segmentation_id}/segments/#{@segment_id}"
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,52 @@
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
+ #Deletes all the items that pass the filter.
11
+ #
12
+ #If an item becomes obsolete/no longer available, it is meaningful to **keep it in the catalog** (along with all the interaction data, which are very useful) and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
13
+ class DeleteMoreItems < ApiRequest
14
+ attr_reader :filter
15
+ attr_accessor :timeout
16
+ attr_accessor :ensure_https
17
+
18
+ ##
19
+ # * *Required arguments*
20
+ # - +filter+ -> A [ReQL](https://docs.recombee.com/reql.html) expression, which returns `true` for the items that shall be updated.
21
+ #
22
+ def initialize(filter)
23
+ @filter = filter
24
+ @timeout = 1000
25
+ @ensure_https = false
26
+ end
27
+
28
+ # HTTP method
29
+ def method
30
+ :delete
31
+ end
32
+
33
+ # Values of body parameters as a Hash
34
+ def body_parameters
35
+ p = Hash.new
36
+ p['filter'] = @filter
37
+ p
38
+ end
39
+
40
+ # Values of query parameters as a Hash.
41
+ # name of parameter => value of the parameter
42
+ def query_parameters
43
+ params = {}
44
+ params
45
+ end
46
+
47
+ # Relative path to the endpoint
48
+ def path
49
+ "/{databaseId}/more-items/"
50
+ end
51
+ end
52
+ end