recombee_api_client 4.1.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/recombee_api_client/api/add_bookmark.rb +1 -1
  4. data/lib/recombee_api_client/api/add_cart_addition.rb +1 -1
  5. data/lib/recombee_api_client/api/add_detail_view.rb +1 -1
  6. data/lib/recombee_api_client/api/add_item.rb +1 -1
  7. data/lib/recombee_api_client/api/add_item_property.rb +1 -1
  8. data/lib/recombee_api_client/api/add_purchase.rb +1 -1
  9. data/lib/recombee_api_client/api/add_rating.rb +1 -1
  10. data/lib/recombee_api_client/api/add_series.rb +13 -3
  11. data/lib/recombee_api_client/api/add_user.rb +1 -1
  12. data/lib/recombee_api_client/api/add_user_property.rb +1 -1
  13. data/lib/recombee_api_client/api/delete_bookmark.rb +1 -1
  14. data/lib/recombee_api_client/api/delete_cart_addition.rb +1 -1
  15. data/lib/recombee_api_client/api/delete_detail_view.rb +1 -1
  16. data/lib/recombee_api_client/api/delete_item.rb +1 -1
  17. data/lib/recombee_api_client/api/delete_more_items.rb +1 -1
  18. data/lib/recombee_api_client/api/delete_purchase.rb +1 -1
  19. data/lib/recombee_api_client/api/delete_rating.rb +1 -1
  20. data/lib/recombee_api_client/api/delete_series.rb +13 -3
  21. data/lib/recombee_api_client/api/delete_user.rb +1 -1
  22. data/lib/recombee_api_client/api/delete_view_portion.rb +1 -1
  23. data/lib/recombee_api_client/api/get_item_property_info.rb +1 -1
  24. data/lib/recombee_api_client/api/get_item_values.rb +1 -1
  25. data/lib/recombee_api_client/api/get_user_values.rb +1 -1
  26. data/lib/recombee_api_client/api/insert_to_series.rb +2 -2
  27. data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +2 -2
  28. data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +2 -2
  29. data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +2 -2
  30. data/lib/recombee_api_client/api/recommend_items_to_item_segment.rb +207 -0
  31. data/lib/recombee_api_client/api/remove_from_series.rb +5 -8
  32. data/lib/recombee_api_client/api/set_view_portion.rb +1 -1
  33. data/lib/recombee_api_client/api/update_more_items.rb +1 -1
  34. data/lib/recombee_api_client/version.rb +1 -1
  35. data/lib/recombee_api_client.rb +1 -1
  36. data/recombee_api_client.gemspec +10 -8
  37. metadata +24 -31
  38. data/lib/recombee_api_client/api/add_group.rb +0 -49
  39. data/lib/recombee_api_client/api/delete_group.rb +0 -52
  40. data/lib/recombee_api_client/api/insert_to_group.rb +0 -66
  41. data/lib/recombee_api_client/api/list_group_items.rb +0 -49
  42. data/lib/recombee_api_client/api/list_groups.rb +0 -46
  43. 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: 4768bdac13cee19e3667d59b7cac6ac68fb4df9c63f4fbab76eb2168f76e135a
4
- data.tar.gz: ce298750cdbcec2ad0ec3d3e9baab087d742f44bc9e3e3fc6bc742dcdfcb8c17
3
+ metadata.gz: b6ba78bee5be7cbf745ccd6a3515fdd2bb33d1b44d7bad833496f03253c9d33d
4
+ data.tar.gz: 60b9259daa982cc5a1d7b7f754673d2283bb8d016a3b1d11358f14e61f2c4d4c
5
5
  SHA512:
6
- metadata.gz: 1b2c012a478a9a49ebde323fbc5f0b089dbd3287fdd11224abeb2e366a15db0af884068374ffbb46c296ea6f325e9870fda459763e563a7e16391cbc2031cfd3
7
- data.tar.gz: e5786b070204e530824968bca26dfb5e5086a9670110a1aced8773c47f1f0a131ff2302a8c15c44483eb2a62bae39cb9744333e898a8749c287456330cae58cb
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
+ ```
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -9,7 +9,7 @@ module RecombeeApiClient
9
9
  ##
10
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 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.
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
@@ -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
@@ -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
@@ -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
@@ -24,7 +24,7 @@ module RecombeeApiClient
24
24
  #
25
25
  def initialize(item_id)
26
26
  @item_id = item_id
27
- @timeout = 1000
27
+ @timeout = 3000
28
28
  @ensure_https = false
29
29
  end
30
30
 
@@ -21,7 +21,7 @@ module RecombeeApiClient
21
21
  #
22
22
  def initialize(filter)
23
23
  @filter = filter
24
- @timeout = 1000
24
+ @timeout = 100000
25
25
  @ensure_https = false
26
26
  end
27
27
 
@@ -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
@@ -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
@@ -12,7 +12,7 @@ module RecombeeApiClient
12
12
  #Deleting a series will only delete assignment of items to it, not the items themselves!
13
13
  #
14
14
  class DeleteSeries < ApiRequest
15
- attr_reader :series_id
15
+ attr_reader :series_id, :cascade_delete
16
16
  attr_accessor :timeout
17
17
  attr_accessor :ensure_https
18
18
 
@@ -20,10 +20,19 @@ module RecombeeApiClient
20
20
  # * *Required arguments*
21
21
  # - +series_id+ -> ID of the series to be deleted.
22
22
  #
23
- def initialize(series_id)
23
+ # * *Optional arguments (given as hash optional)*
24
+ # - +cascadeDelete+ -> If set to `true`, item with the same ID as seriesId will be also deleted. Default is `false`.
25
+ #
26
+ def initialize(series_id, optional = {})
24
27
  @series_id = series_id
25
- @timeout = 1000
28
+ optional = normalize_optional(optional)
29
+ @cascade_delete = optional['cascadeDelete']
30
+ @optional = optional
31
+ @timeout = 3000
26
32
  @ensure_https = false
33
+ @optional.each do |par, _|
34
+ fail UnknownOptionalParameter.new(par) unless ["cascadeDelete"].include? par
35
+ end
27
36
  end
28
37
 
29
38
  # HTTP method
@@ -34,6 +43,7 @@ module RecombeeApiClient
34
43
  # Values of body parameters as a Hash
35
44
  def body_parameters
36
45
  p = Hash.new
46
+ p['cascadeDelete'] = @optional['cascadeDelete'] if @optional.include? 'cascadeDelete'
37
47
  p
38
48
  end
39
49
 
@@ -22,7 +22,7 @@ module RecombeeApiClient
22
22
  #
23
23
  def initialize(user_id)
24
24
  @user_id = user_id
25
- @timeout = 1000
25
+ @timeout = 3000
26
26
  @ensure_https = false
27
27
  end
28
28
 
@@ -28,7 +28,7 @@ module RecombeeApiClient
28
28
  optional = normalize_optional(optional)
29
29
  @session_id = optional['sessionId']
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 ["sessionId"].include? par
@@ -20,7 +20,7 @@ module RecombeeApiClient
20
20
  #
21
21
  def initialize(property_name)
22
22
  @property_name = property_name
23
- @timeout = 1000
23
+ @timeout = 3000
24
24
  @ensure_https = false
25
25
  end
26
26
 
@@ -21,7 +21,7 @@ module RecombeeApiClient
21
21
  #
22
22
  def initialize(item_id)
23
23
  @item_id = item_id
24
- @timeout = 1000
24
+ @timeout = 3000
25
25
  @ensure_https = false
26
26
  end
27
27
 
@@ -21,7 +21,7 @@ module RecombeeApiClient
21
21
  #
22
22
  def initialize(user_id)
23
23
  @user_id = user_id
24
- @timeout = 1000
24
+ @timeout = 3000
25
25
  @ensure_https = false
26
26
  end
27
27
 
@@ -22,7 +22,7 @@ module RecombeeApiClient
22
22
  # - +time+ -> Time index used for sorting items in the series. According to time, items are sorted within series in ascending order. In the example of TV show episodes, the episode number is a natural choice to be passed as time.
23
23
  #
24
24
  # * *Optional arguments (given as hash optional)*
25
- # - +cascadeCreate+ -> Indicates that any non-existing entity specified within the request should be created (as if corresponding PUT requests were invoked). This concerns both the `seriesId` and the `itemId`. If `cascadeCreate` is set to true, the behavior also depends on the `itemType`. Either item or series may be created if not present in the database.
25
+ # - +cascadeCreate+ -> Indicates that any non-existing entity specified within the request should be created (as if corresponding PUT requests were invoked). This concerns both the `seriesId` and the `itemId`. If `cascadeCreate` is set to true, the behavior also depends on the `itemType`. In case of `item`, an item is created, in case of `series` a series + corresponding item with the same ID is created.
26
26
  #
27
27
  def initialize(series_id, item_type, item_id, time, optional = {})
28
28
  @series_id = series_id
@@ -32,7 +32,7 @@ module RecombeeApiClient
32
32
  optional = normalize_optional(optional)
33
33
  @cascade_create = optional['cascadeCreate']
34
34
  @optional = optional
35
- @timeout = 1000
35
+ @timeout = 3000
36
36
  @ensure_https = false
37
37
  @optional.each do |par, _|
38
38
  fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Recommends Segments from a Segmentation that are the most relevant to a particular item.
10
+ #Recommends Segments from a [Segmentation](https://docs.recombee.com/segmentations.html) that are the most relevant to a particular item.
11
11
  #
12
12
  #Based on the used Segmentation, this endpoint can be used for example for:
13
13
  #
@@ -16,7 +16,7 @@ module RecombeeApiClient
16
16
  # - Recommending the related brands
17
17
  # - Recommending the related artists
18
18
  #
19
- #You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
19
+ #You need to set the used Segmentation the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.
20
20
  #
21
21
  #The returned segments are sorted by relevance (first segment being the most relevant).
22
22
  #
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Recommends Segments from a result Segmentation that are the most relevant to a particular Segment from a context Segmentation.
10
+ #Recommends Segments from a result [Segmentation](https://docs.recombee.com/segmentations.html) that are the most relevant to a particular Segment from a context Segmentation.
11
11
  #
12
12
  #Based on the used Segmentations, this endpoint can be used for example for:
13
13
  #
@@ -15,7 +15,7 @@ module RecombeeApiClient
15
15
  # - Recommending the related brands to particular category
16
16
  # - Recommending the related artists to a particular genre (assuming songs are the Items)
17
17
  #
18
- #You need to set the used context and result Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
18
+ #You need to set the used context and result Segmentation the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.
19
19
  #
20
20
  #The returned segments are sorted by relevance (first segment being the most relevant).
21
21
  #
@@ -7,7 +7,7 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- #Recommends the top Segments from a Segmentation for a particular user, based on the user's past interactions.
10
+ #Recommends the top Segments from a [Segmentation](https://docs.recombee.com/segmentations.html) for a particular user, based on the user's past interactions.
11
11
  #
12
12
  #Based on the used Segmentation, this endpoint can be used for example for:
13
13
  #
@@ -16,7 +16,7 @@ module RecombeeApiClient
16
16
  # - Recommending the top brands for the user
17
17
  # - Recommending the top artists for the user
18
18
  #
19
- #You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
19
+ #You need to set the used Segmentation the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.
20
20
  #
21
21
  #The returned segments are sorted by relevance (first segment being the most relevant).
22
22
  #
@@ -0,0 +1,207 @@
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
+ #Recommends Items that are the most relevant to a particular Segment from a context [Segmentation](https://docs.recombee.com/segmentations.html).
11
+ #
12
+ #Based on the used Segmentation, this endpoint can be used for example for:
13
+ #
14
+ #- Recommending articles related to a particular topic
15
+ #- Recommending songs belonging to a particular genre
16
+ #- Recommending products produced by a particular brand
17
+ #
18
+ #You need to set the used context Segmentation in the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.
19
+ #
20
+ #The returned items are sorted by relevance (the first item being the most relevant).
21
+ #
22
+ #It is also possible to use the POST HTTP method (for example, in the case of a very long ReQL filter) — query parameters then become body parameters.
23
+ #
24
+ class RecommendItemsToItemSegment < ApiRequest
25
+ attr_reader :context_segment_id, :target_user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
26
+ attr_accessor :timeout
27
+ attr_accessor :ensure_https
28
+
29
+ ##
30
+ # * *Required arguments*
31
+ # - +context_segment_id+ -> ID of the segment from `contextSegmentationId` for which the recommendations are to be generated.
32
+ # - +target_user_id+ -> ID of the user who will see the recommendations.
33
+ #
34
+ #Specifying the *targetUserId* is beneficial because:
35
+ #
36
+ #* It makes the recommendations personalized
37
+ #* Allows the calculation of Actions and Conversions
38
+ # in the graphical user interface,
39
+ # as Recombee can pair the user who got recommendations
40
+ # and who afterward viewed/purchased an item.
41
+ #
42
+ #If you insist on not specifying the user, pass `null`
43
+ #(`None`, `nil`, `NULL` etc., depending on the language) to *targetUserId*.
44
+ #Do not create some special dummy user for getting recommendations,
45
+ #as it could mislead the recommendation models,
46
+ #and result in wrong recommendations.
47
+ #
48
+ #For anonymous/unregistered users, it is possible to use, for example, their session ID.
49
+ #
50
+ # - +count+ -> Number of items to be recommended (N for the top-N recommendation).
51
+ #
52
+ # * *Optional arguments (given as hash optional)*
53
+ # - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
54
+ #
55
+ #You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
56
+ #
57
+ #The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
58
+ #
59
+ # - +cascadeCreate+ -> If an item of the given *itemId* or user of the given *targetUserId* doesn't exist in the database, it creates the missing entity/entities and returns some (non-personalized) recommendations. This allows, for example, rotations in the following recommendations for the user of the given *targetUserId*, as the user will be already known to the system.
60
+ # - +returnProperties+ -> With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended items to the user.
61
+ #
62
+ #Example response:
63
+ #```
64
+ # {
65
+ # "recommId": "0c6189e7-dc1a-429a-b613-192696309361",
66
+ # "recomms":
67
+ # [
68
+ # {
69
+ # "id": "tv-178",
70
+ # "values": {
71
+ # "description": "4K TV with 3D feature",
72
+ # "categories": ["Electronics", "Televisions"],
73
+ # "price": 342,
74
+ # "url": "myshop.com/tv-178"
75
+ # }
76
+ # },
77
+ # {
78
+ # "id": "mixer-42",
79
+ # "values": {
80
+ # "description": "Stainless Steel Mixer",
81
+ # "categories": ["Home & Kitchen"],
82
+ # "price": 39,
83
+ # "url": "myshop.com/mixer-42"
84
+ # }
85
+ # }
86
+ # ],
87
+ # "numberNextRecommsCalls": 0
88
+ # }
89
+ #```
90
+ #
91
+ # - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
92
+ #
93
+ #Example response for `includedProperties=description,price`:
94
+ #```
95
+ # {
96
+ # "recommId": "6842c725-a79f-4537-a02c-f34d668a3f80",
97
+ # "recomms":
98
+ # [
99
+ # {
100
+ # "id": "tv-178",
101
+ # "values": {
102
+ # "description": "4K TV with 3D feature",
103
+ # "price": 342
104
+ # }
105
+ # },
106
+ # {
107
+ # "id": "mixer-42",
108
+ # "values": {
109
+ # "description": "Stainless Steel Mixer",
110
+ # "price": 39
111
+ # }
112
+ # }
113
+ # ],
114
+ # "numberNextRecommsCalls": 0
115
+ # }
116
+ #```
117
+ #
118
+ # - +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.
119
+ #
120
+ #Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
121
+ #
122
+ # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
123
+ #
124
+ #Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
125
+ #
126
+ # - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
127
+ #See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
128
+ #
129
+ #The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
130
+ #
131
+ #Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
132
+ #
133
+ # - +minRelevance+ -> **Expert option** If the *targetUserId* is provided: Specifies the threshold of how 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 a number of items equal to *count* at any cost. If there is not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations being 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 relevance and may return less than *count* items when there is not enough data to fulfill it.
134
+ #
135
+ # - +rotationRate+ -> **Expert option** If the *targetUserId* is provided: If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per request in a backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example, `rotationRate=0.2` for only slight rotation of recommended items.
136
+ #
137
+ # - +rotationTime+ -> **Expert option** If the *targetUserId* is provided: Taking *rotationRate* into account, specifies how long it takes for an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized.
138
+ #
139
+ # - +expertSettings+ -> Dictionary of custom options.
140
+ #
141
+ # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
142
+ #
143
+ #
144
+ def initialize(context_segment_id, target_user_id, count, optional = {})
145
+ @context_segment_id = context_segment_id
146
+ @target_user_id = target_user_id
147
+ @count = count
148
+ optional = normalize_optional(optional)
149
+ @scenario = optional['scenario']
150
+ @cascade_create = optional['cascadeCreate']
151
+ @return_properties = optional['returnProperties']
152
+ @included_properties = optional['includedProperties']
153
+ @filter = optional['filter']
154
+ @booster = optional['booster']
155
+ @logic = optional['logic']
156
+ @min_relevance = optional['minRelevance']
157
+ @rotation_rate = optional['rotationRate']
158
+ @rotation_time = optional['rotationTime']
159
+ @expert_settings = optional['expertSettings']
160
+ @return_ab_group = optional['returnAbGroup']
161
+ @optional = optional
162
+ @timeout = 3000
163
+ @ensure_https = false
164
+ @optional.each do |par, _|
165
+ fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","returnProperties","includedProperties","filter","booster","logic","minRelevance","rotationRate","rotationTime","expertSettings","returnAbGroup"].include? par
166
+ end
167
+ end
168
+
169
+ # HTTP method
170
+ def method
171
+ :post
172
+ end
173
+
174
+ # Values of body parameters as a Hash
175
+ def body_parameters
176
+ p = Hash.new
177
+ p['contextSegmentId'] = @context_segment_id
178
+ p['targetUserId'] = @target_user_id
179
+ p['count'] = @count
180
+ p['scenario'] = @optional['scenario'] if @optional.include? 'scenario'
181
+ p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
182
+ p['returnProperties'] = @optional['returnProperties'] if @optional.include? 'returnProperties'
183
+ p['includedProperties'] = @optional['includedProperties'] if @optional.include? 'includedProperties'
184
+ p['filter'] = @optional['filter'] if @optional.include? 'filter'
185
+ p['booster'] = @optional['booster'] if @optional.include? 'booster'
186
+ p['logic'] = @optional['logic'] if @optional.include? 'logic'
187
+ p['minRelevance'] = @optional['minRelevance'] if @optional.include? 'minRelevance'
188
+ p['rotationRate'] = @optional['rotationRate'] if @optional.include? 'rotationRate'
189
+ p['rotationTime'] = @optional['rotationTime'] if @optional.include? 'rotationTime'
190
+ p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
191
+ p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
192
+ p
193
+ end
194
+
195
+ # Values of query parameters as a Hash.
196
+ # name of parameter => value of the parameter
197
+ def query_parameters
198
+ params = {}
199
+ params
200
+ end
201
+
202
+ # Relative path to the endpoint
203
+ def path
204
+ "/{databaseId}/recomms/item-segments/items/"
205
+ end
206
+ end
207
+ end
@@ -9,7 +9,7 @@ module RecombeeApiClient
9
9
  ##
10
10
  #Removes an existing series item from the series.
11
11
  class RemoveFromSeries < ApiRequest
12
- attr_reader :series_id, :item_type, :item_id, :time
12
+ attr_reader :series_id, :item_type, :item_id
13
13
  attr_accessor :timeout
14
14
  attr_accessor :ensure_https
15
15
 
@@ -18,14 +18,12 @@ module RecombeeApiClient
18
18
  # - +series_id+ -> ID of the series from which a series item is to be removed.
19
19
  # - +item_type+ -> Type of the item to be removed.
20
20
  # - +item_id+ -> ID of the item iff `itemType` is `item`. ID of the series iff `itemType` is `series`.
21
- # - +time+ -> Time index of the item to be removed.
22
21
  #
23
- def initialize(series_id, item_type, item_id, time)
22
+ def initialize(series_id, item_type, item_id)
24
23
  @series_id = series_id
25
24
  @item_type = item_type
26
25
  @item_id = item_id
27
- @time = time
28
- @timeout = 1000
26
+ @timeout = 3000
29
27
  @ensure_https = false
30
28
  end
31
29
 
@@ -37,6 +35,8 @@ module RecombeeApiClient
37
35
  # Values of body parameters as a Hash
38
36
  def body_parameters
39
37
  p = Hash.new
38
+ p['itemType'] = @item_type
39
+ p['itemId'] = @item_id
40
40
  p
41
41
  end
42
42
 
@@ -44,9 +44,6 @@ module RecombeeApiClient
44
44
  # name of parameter => value of the parameter
45
45
  def query_parameters
46
46
  params = {}
47
- params['itemType'] = @item_type
48
- params['itemId'] = @item_id
49
- params['time'] = @time
50
47
  params
51
48
  end
52
49
 
@@ -39,7 +39,7 @@ module RecombeeApiClient
39
39
  @recomm_id = optional['recommId']
40
40
  @additional_data = optional['additionalData']
41
41
  @optional = optional
42
- @timeout = 1000
42
+ @timeout = 3000
43
43
  @ensure_https = false
44
44
  @optional.each do |par, _|
45
45
  fail UnknownOptionalParameter.new(par) unless ["sessionId","timestamp","cascadeCreate","recommId","additionalData"].include? par
@@ -31,7 +31,7 @@ module RecombeeApiClient
31
31
  def initialize(filter, changes)
32
32
  @filter = filter
33
33
  @changes = changes
34
- @timeout = 1000
34
+ @timeout = 100000
35
35
  @ensure_https = false
36
36
  end
37
37
 
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '4.1.0'
2
+ VERSION = '5.0.0'
3
3
  end
@@ -18,7 +18,7 @@ module RecombeeApiClient
18
18
  include HTTParty
19
19
 
20
20
  BATCH_MAX_SIZE = 10000
21
- USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/4.1.0'}
21
+ USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/5.0.0'}
22
22
 
23
23
  ##
24
24
  # - +account+ -> Name of your account at Recombee
@@ -10,17 +10,19 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['ondrej.fiedler@recombee.com']
11
11
 
12
12
  spec.summary = 'Client for Recombee recommendation API'
13
- spec.homepage = 'http://recombee.com'
13
+ spec.description = 'A Ruby client for accessing the Recombee recommendation API. Supports personalization and search capabilities with ease.'
14
+ spec.homepage = 'https://recombee.com'
14
15
  spec.license = 'MIT'
15
- spec.required_ruby_version = '>= 1.9.0'
16
+
17
+ spec.required_ruby_version = '>= 2.5.0'
16
18
 
17
19
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
20
  spec.require_paths = ['lib']
19
21
 
20
- spec.add_dependency 'multi_json'
21
- spec.add_dependency 'httparty'
22
+ spec.add_dependency 'multi_json', '~> 1.15'
23
+ spec.add_dependency 'httparty', '~> 0.18'
22
24
 
23
- spec.add_development_dependency 'bundler', '~> 2.2.10'
24
- spec.add_development_dependency 'rake', '~> 12.3.3'
25
- spec.add_development_dependency 'rspec'
26
- end
25
+ spec.add_development_dependency 'bundler', '~> 2.6.2'
26
+ spec.add_development_dependency 'rake', '~> 13.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.11'
28
+ end
metadata CHANGED
@@ -1,86 +1,86 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-01-10 00:00:00.000000000 Z
10
+ date: 2025-01-14 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: multi_json
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '1.15'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '1.15'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: httparty
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">="
30
+ - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '0'
32
+ version: '0.18'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - ">="
37
+ - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '0'
39
+ version: '0.18'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: bundler
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 2.2.10
46
+ version: 2.6.2
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: 2.2.10
53
+ version: 2.6.2
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rake
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: 12.3.3
60
+ version: '13.0'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: 12.3.3
67
+ version: '13.0'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: rspec
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - ">="
72
+ - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: '0'
74
+ version: '3.11'
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - ">="
79
+ - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '0'
83
- description:
81
+ version: '3.11'
82
+ description: A Ruby client for accessing the Recombee recommendation API. Supports
83
+ personalization and search capabilities with ease.
84
84
  email:
85
85
  - ondrej.fiedler@recombee.com
86
86
  executables: []
@@ -95,7 +95,6 @@ files:
95
95
  - lib/recombee_api_client/api/add_bookmark.rb
96
96
  - lib/recombee_api_client/api/add_cart_addition.rb
97
97
  - lib/recombee_api_client/api/add_detail_view.rb
98
- - lib/recombee_api_client/api/add_group.rb
99
98
  - lib/recombee_api_client/api/add_item.rb
100
99
  - lib/recombee_api_client/api/add_item_property.rb
101
100
  - lib/recombee_api_client/api/add_manual_reql_segment.rb
@@ -113,7 +112,6 @@ files:
113
112
  - lib/recombee_api_client/api/delete_bookmark.rb
114
113
  - lib/recombee_api_client/api/delete_cart_addition.rb
115
114
  - lib/recombee_api_client/api/delete_detail_view.rb
116
- - lib/recombee_api_client/api/delete_group.rb
117
115
  - lib/recombee_api_client/api/delete_item.rb
118
116
  - lib/recombee_api_client/api/delete_item_property.rb
119
117
  - lib/recombee_api_client/api/delete_manual_reql_segment.rb
@@ -132,10 +130,7 @@ files:
132
130
  - lib/recombee_api_client/api/get_user_property_info.rb
133
131
  - lib/recombee_api_client/api/get_user_values.rb
134
132
  - lib/recombee_api_client/api/hash_normalizer.rb
135
- - lib/recombee_api_client/api/insert_to_group.rb
136
133
  - lib/recombee_api_client/api/insert_to_series.rb
137
- - lib/recombee_api_client/api/list_group_items.rb
138
- - lib/recombee_api_client/api/list_groups.rb
139
134
  - lib/recombee_api_client/api/list_item_bookmarks.rb
140
135
  - lib/recombee_api_client/api/list_item_cart_additions.rb
141
136
  - lib/recombee_api_client/api/list_item_detail_views.rb
@@ -161,11 +156,11 @@ files:
161
156
  - lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb
162
157
  - lib/recombee_api_client/api/recommend_item_segments_to_user.rb
163
158
  - lib/recombee_api_client/api/recommend_items_to_item.rb
159
+ - lib/recombee_api_client/api/recommend_items_to_item_segment.rb
164
160
  - lib/recombee_api_client/api/recommend_items_to_user.rb
165
161
  - lib/recombee_api_client/api/recommend_next_items.rb
166
162
  - lib/recombee_api_client/api/recommend_users_to_item.rb
167
163
  - lib/recombee_api_client/api/recommend_users_to_user.rb
168
- - lib/recombee_api_client/api/remove_from_group.rb
169
164
  - lib/recombee_api_client/api/remove_from_series.rb
170
165
  - lib/recombee_api_client/api/request.rb
171
166
  - lib/recombee_api_client/api/reset_database.rb
@@ -183,11 +178,10 @@ files:
183
178
  - lib/recombee_api_client/errors.rb
184
179
  - lib/recombee_api_client/version.rb
185
180
  - recombee_api_client.gemspec
186
- homepage: http://recombee.com
181
+ homepage: https://recombee.com
187
182
  licenses:
188
183
  - MIT
189
184
  metadata: {}
190
- post_install_message:
191
185
  rdoc_options: []
192
186
  require_paths:
193
187
  - lib
@@ -195,15 +189,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
189
  requirements:
196
190
  - - ">="
197
191
  - !ruby/object:Gem::Version
198
- version: 1.9.0
192
+ version: 2.5.0
199
193
  required_rubygems_version: !ruby/object:Gem::Requirement
200
194
  requirements:
201
195
  - - ">="
202
196
  - !ruby/object:Gem::Version
203
197
  version: '0'
204
198
  requirements: []
205
- rubygems_version: 3.1.2
206
- signing_key:
199
+ rubygems_version: 3.6.2
207
200
  specification_version: 4
208
201
  summary: Client for Recombee recommendation API
209
202
  test_files: []
@@ -1,49 +0,0 @@
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 new group in the database.
11
- class AddGroup < ApiRequest
12
- attr_reader :group_id
13
- attr_accessor :timeout
14
- attr_accessor :ensure_https
15
-
16
- ##
17
- # * *Required arguments*
18
- # - +group_id+ -> ID of the group to be created.
19
- #
20
- def initialize(group_id)
21
- @group_id = group_id
22
- @timeout = 1000
23
- @ensure_https = false
24
- end
25
-
26
- # HTTP method
27
- def method
28
- :put
29
- end
30
-
31
- # Values of body parameters as a Hash
32
- def body_parameters
33
- p = Hash.new
34
- p
35
- end
36
-
37
- # Values of query parameters as a Hash.
38
- # name of parameter => value of the parameter
39
- def query_parameters
40
- params = {}
41
- params
42
- end
43
-
44
- # Relative path to the endpoint
45
- def path
46
- "/{databaseId}/groups/#{@group_id}"
47
- end
48
- end
49
- end
@@ -1,52 +0,0 @@
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 the group of the given `groupId` from the database.
11
- #
12
- #Deleting a group will only delete the assignment of items to it, not the items themselves!
13
- #
14
- class DeleteGroup < ApiRequest
15
- attr_reader :group_id
16
- attr_accessor :timeout
17
- attr_accessor :ensure_https
18
-
19
- ##
20
- # * *Required arguments*
21
- # - +group_id+ -> ID of the group to be deleted.
22
- #
23
- def initialize(group_id)
24
- @group_id = group_id
25
- @timeout = 1000
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}/groups/#{@group_id}"
50
- end
51
- end
52
- end
@@ -1,66 +0,0 @@
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
- #Inserts an existing item/group into a group of the given `groupId`.
11
- #
12
- class InsertToGroup < ApiRequest
13
- attr_reader :group_id, :item_type, :item_id, :cascade_create
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +group_id+ -> ID of the group to be inserted into.
20
- # - +item_type+ -> `item` iff the regular item from the catalog is to be inserted, `group` iff group is inserted as the item.
21
- # - +item_id+ -> ID of the item iff `itemType` is `item`. ID of the group iff `itemType` is `group`.
22
- #
23
- # * *Optional arguments (given as hash optional)*
24
- # - +cascadeCreate+ -> Indicates that any non-existing entity specified within the request should be created (as if corresponding PUT requests were invoked). This concerns both the `groupId` and the `groupId`. If `cascadeCreate` is set to true, the behavior also depends on the `itemType`. Either items or group may be created if not present in the database.
25
- #
26
- def initialize(group_id, item_type, item_id, optional = {})
27
- @group_id = group_id
28
- @item_type = item_type
29
- @item_id = item_id
30
- optional = normalize_optional(optional)
31
- @cascade_create = optional['cascadeCreate']
32
- @optional = optional
33
- @timeout = 1000
34
- @ensure_https = false
35
- @optional.each do |par, _|
36
- fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
37
- end
38
- end
39
-
40
- # HTTP method
41
- def method
42
- :post
43
- end
44
-
45
- # Values of body parameters as a Hash
46
- def body_parameters
47
- p = Hash.new
48
- p['itemType'] = @item_type
49
- p['itemId'] = @item_id
50
- p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
51
- p
52
- end
53
-
54
- # Values of query parameters as a Hash.
55
- # name of parameter => value of the parameter
56
- def query_parameters
57
- params = {}
58
- params
59
- end
60
-
61
- # Relative path to the endpoint
62
- def path
63
- "/{databaseId}/groups/#{@group_id}/items/"
64
- end
65
- end
66
- end
@@ -1,49 +0,0 @@
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 group.
11
- class ListGroupItems < ApiRequest
12
- attr_reader :group_id
13
- attr_accessor :timeout
14
- attr_accessor :ensure_https
15
-
16
- ##
17
- # * *Required arguments*
18
- # - +group_id+ -> ID of the group whose items are to be listed.
19
- #
20
- def initialize(group_id)
21
- @group_id = group_id
22
- @timeout = 100000
23
- @ensure_https = false
24
- end
25
-
26
- # HTTP method
27
- def method
28
- :get
29
- end
30
-
31
- # Values of body parameters as a Hash
32
- def body_parameters
33
- p = Hash.new
34
- p
35
- end
36
-
37
- # Values of query parameters as a Hash.
38
- # name of parameter => value of the parameter
39
- def query_parameters
40
- params = {}
41
- params
42
- end
43
-
44
- # Relative path to the endpoint
45
- def path
46
- "/{databaseId}/groups/#{@group_id}/items/"
47
- end
48
- end
49
- end
@@ -1,46 +0,0 @@
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 the list of all the groups currently present in the database.
11
- class ListGroups < ApiRequest
12
-
13
- attr_accessor :timeout
14
- attr_accessor :ensure_https
15
-
16
- ##
17
- #
18
- def initialize()
19
- @timeout = 100000
20
- @ensure_https = false
21
- end
22
-
23
- # HTTP method
24
- def method
25
- :get
26
- end
27
-
28
- # Values of body parameters as a Hash
29
- def body_parameters
30
- p = Hash.new
31
- p
32
- end
33
-
34
- # Values of query parameters as a Hash.
35
- # name of parameter => value of the parameter
36
- def query_parameters
37
- params = {}
38
- params
39
- end
40
-
41
- # Relative path to the endpoint
42
- def path
43
- "/{databaseId}/groups/list/"
44
- end
45
- end
46
- end
@@ -1,55 +0,0 @@
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
- #Removes an existing group item from the group.
11
- class RemoveFromGroup < ApiRequest
12
- attr_reader :group_id, :item_type, :item_id
13
- attr_accessor :timeout
14
- attr_accessor :ensure_https
15
-
16
- ##
17
- # * *Required arguments*
18
- # - +group_id+ -> ID of the group from which a group item is to be removed.
19
- # - +item_type+ -> Type of the item to be removed.
20
- # - +item_id+ -> ID of the item iff `itemType` is `item`. ID of the group iff `itemType` is `group`.
21
- #
22
- def initialize(group_id, item_type, item_id)
23
- @group_id = group_id
24
- @item_type = item_type
25
- @item_id = item_id
26
- @timeout = 1000
27
- @ensure_https = false
28
- end
29
-
30
- # HTTP method
31
- def method
32
- :delete
33
- end
34
-
35
- # Values of body parameters as a Hash
36
- def body_parameters
37
- p = Hash.new
38
- p
39
- end
40
-
41
- # Values of query parameters as a Hash.
42
- # name of parameter => value of the parameter
43
- def query_parameters
44
- params = {}
45
- params['itemType'] = @item_type
46
- params['itemId'] = @item_id
47
- params
48
- end
49
-
50
- # Relative path to the endpoint
51
- def path
52
- "/{databaseId}/groups/#{@group_id}/items/"
53
- end
54
- end
55
- end