recombee_api_client 5.1.0 → 6.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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/recombee_api_client/api/add_bookmark.rb +26 -26
  3. data/lib/recombee_api_client/api/add_cart_addition.rb +28 -28
  4. data/lib/recombee_api_client/api/add_detail_view.rb +32 -28
  5. data/lib/recombee_api_client/api/add_item.rb +15 -18
  6. data/lib/recombee_api_client/api/add_item_property.rb +34 -35
  7. data/lib/recombee_api_client/api/add_manual_reql_segment.rb +26 -27
  8. data/lib/recombee_api_client/api/add_purchase.rb +29 -29
  9. data/lib/recombee_api_client/api/add_rating.rb +27 -27
  10. data/lib/recombee_api_client/api/add_search_synonym.rb +29 -30
  11. data/lib/recombee_api_client/api/add_series.rb +20 -21
  12. data/lib/recombee_api_client/api/add_user.rb +14 -17
  13. data/lib/recombee_api_client/api/add_user_property.rb +30 -31
  14. data/lib/recombee_api_client/api/batch.rb +12 -16
  15. data/lib/recombee_api_client/api/composite_recommendation.rb +132 -0
  16. data/lib/recombee_api_client/api/create_auto_reql_segmentation.rb +29 -30
  17. data/lib/recombee_api_client/api/create_manual_reql_segmentation.rb +27 -28
  18. data/lib/recombee_api_client/api/create_property_based_segmentation.rb +30 -31
  19. data/lib/recombee_api_client/api/delete_all_search_synonyms.rb +15 -19
  20. data/lib/recombee_api_client/api/delete_bookmark.rb +21 -22
  21. data/lib/recombee_api_client/api/delete_cart_addition.rb +21 -22
  22. data/lib/recombee_api_client/api/delete_detail_view.rb +21 -22
  23. data/lib/recombee_api_client/api/delete_item.rb +16 -19
  24. data/lib/recombee_api_client/api/delete_item_property.rb +15 -18
  25. data/lib/recombee_api_client/api/delete_manual_reql_segment.rb +16 -19
  26. data/lib/recombee_api_client/api/delete_more_items.rb +18 -19
  27. data/lib/recombee_api_client/api/delete_purchase.rb +21 -22
  28. data/lib/recombee_api_client/api/delete_rating.rb +21 -22
  29. data/lib/recombee_api_client/api/delete_search_synonym.rb +15 -18
  30. data/lib/recombee_api_client/api/delete_segmentation.rb +15 -18
  31. data/lib/recombee_api_client/api/delete_series.rb +21 -22
  32. data/lib/recombee_api_client/api/delete_user.rb +15 -18
  33. data/lib/recombee_api_client/api/delete_user_property.rb +15 -18
  34. data/lib/recombee_api_client/api/delete_view_portion.rb +21 -22
  35. data/lib/recombee_api_client/api/get_item_property_info.rb +14 -17
  36. data/lib/recombee_api_client/api/get_item_values.rb +15 -18
  37. data/lib/recombee_api_client/api/get_segmentation.rb +15 -18
  38. data/lib/recombee_api_client/api/get_user_property_info.rb +15 -18
  39. data/lib/recombee_api_client/api/get_user_values.rb +15 -18
  40. data/lib/recombee_api_client/api/insert_to_series.rb +23 -24
  41. data/lib/recombee_api_client/api/list_item_bookmarks.rb +16 -19
  42. data/lib/recombee_api_client/api/list_item_cart_additions.rb +16 -19
  43. data/lib/recombee_api_client/api/list_item_detail_views.rb +16 -19
  44. data/lib/recombee_api_client/api/list_item_properties.rb +15 -19
  45. data/lib/recombee_api_client/api/list_item_purchases.rb +16 -19
  46. data/lib/recombee_api_client/api/list_item_ratings.rb +16 -19
  47. data/lib/recombee_api_client/api/list_item_view_portions.rb +16 -19
  48. data/lib/recombee_api_client/api/list_items.rb +62 -62
  49. data/lib/recombee_api_client/api/list_scenarios.rb +15 -19
  50. data/lib/recombee_api_client/api/list_search_synonyms.rb +20 -21
  51. data/lib/recombee_api_client/api/list_segmentations.rb +16 -17
  52. data/lib/recombee_api_client/api/list_series.rb +15 -19
  53. data/lib/recombee_api_client/api/list_series_items.rb +15 -18
  54. data/lib/recombee_api_client/api/list_user_bookmarks.rb +15 -18
  55. data/lib/recombee_api_client/api/list_user_cart_additions.rb +15 -18
  56. data/lib/recombee_api_client/api/list_user_detail_views.rb +15 -18
  57. data/lib/recombee_api_client/api/list_user_properties.rb +15 -19
  58. data/lib/recombee_api_client/api/list_user_purchases.rb +15 -18
  59. data/lib/recombee_api_client/api/list_user_ratings.rb +15 -18
  60. data/lib/recombee_api_client/api/list_user_view_portions.rb +15 -18
  61. data/lib/recombee_api_client/api/list_users.rb +56 -56
  62. data/lib/recombee_api_client/api/merge_users.rb +24 -25
  63. data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +69 -68
  64. data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +70 -69
  65. data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +51 -50
  66. data/lib/recombee_api_client/api/recommend_items_to_item.rb +185 -139
  67. data/lib/recombee_api_client/api/recommend_items_to_item_segment.rb +181 -138
  68. data/lib/recombee_api_client/api/recommend_items_to_user.rb +165 -122
  69. data/lib/recombee_api_client/api/recommend_next_items.rb +24 -25
  70. data/lib/recombee_api_client/api/recommend_users_to_item.rb +151 -105
  71. data/lib/recombee_api_client/api/recommend_users_to_user.rb +154 -111
  72. data/lib/recombee_api_client/api/remove_from_series.rb +17 -18
  73. data/lib/recombee_api_client/api/request.rb +1 -1
  74. data/lib/recombee_api_client/api/reset_database.rb +15 -19
  75. data/lib/recombee_api_client/api/search_item_segments.rb +52 -51
  76. data/lib/recombee_api_client/api/search_items.rb +157 -114
  77. data/lib/recombee_api_client/api/set_item_values.rb +28 -29
  78. data/lib/recombee_api_client/api/set_user_values.rb +21 -22
  79. data/lib/recombee_api_client/api/set_values.rb +28 -28
  80. data/lib/recombee_api_client/api/set_view_portion.rb +37 -30
  81. data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +26 -27
  82. data/lib/recombee_api_client/api/update_manual_reql_segment.rb +25 -26
  83. data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +24 -25
  84. data/lib/recombee_api_client/api/update_more_items.rb +19 -20
  85. data/lib/recombee_api_client/api/update_property_based_segmentation.rb +26 -27
  86. data/lib/recombee_api_client/errors.rb +2 -5
  87. data/lib/recombee_api_client/inputs/composite_recommendation_stage_parameters.rb +240 -0
  88. data/lib/recombee_api_client/inputs/input.rb +9 -0
  89. data/lib/recombee_api_client/inputs/logic.rb +45 -0
  90. data/lib/recombee_api_client/utils/hash_normalizer.rb +21 -0
  91. data/lib/recombee_api_client/version.rb +1 -1
  92. data/lib/recombee_api_client.rb +40 -35
  93. data/recombee_api_client.gemspec +2 -3
  94. metadata +14 -10
  95. data/lib/recombee_api_client/api/hash_normalizer.rb +0 -21
@@ -5,47 +5,45 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
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 the 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
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +user_id+ -> ID of the user who made the detail view.
20
- # - +item_id+ -> ID of the item whose details were viewed.
21
- #
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 the given `userId` and `itemId` are deleted.
24
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +user_id+ -> ID of the user who made the detail view.
19
+ # - +item_id+ -> ID of the item whose details were viewed.
20
+ #
21
+ # * *Optional arguments (given as hash optional)*
22
+ # - +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.
23
+ #
25
24
  def initialize(user_id, item_id, optional = {})
26
25
  @user_id = user_id
27
26
  @item_id = item_id
28
- optional = normalize_optional(optional)
27
+ optional = normalize_hash_to_camel_case(optional)
29
28
  @timestamp = optional['timestamp']
30
29
  @optional = optional
31
30
  @timeout = 3000
32
31
  @ensure_https = false
33
32
  @optional.each do |par, _|
34
- fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
33
+ raise UnknownOptionalParameter.new(par) unless ['timestamp'].include? par
35
34
  end
36
35
  end
37
-
36
+
38
37
  # HTTP method
39
38
  def method
40
39
  :delete
41
40
  end
42
-
41
+
43
42
  # Values of body parameters as a Hash
44
43
  def body_parameters
45
- p = Hash.new
46
- p
44
+ {}
47
45
  end
48
-
46
+
49
47
  # Values of query parameters as a Hash.
50
48
  # name of parameter => value of the parameter
51
49
  def query_parameters
@@ -53,12 +51,13 @@ module RecombeeApiClient
53
51
  params['userId'] = @user_id
54
52
  params['itemId'] = @item_id
55
53
  params['timestamp'] = @optional['timestamp'] if @optional['timestamp']
54
+
56
55
  params
57
56
  end
58
-
57
+
59
58
  # Relative path to the endpoint
60
59
  def path
61
- "/{databaseId}/detailviews/"
60
+ '/{databaseId}/detailviews/'
62
61
  end
63
62
  end
64
63
  end
@@ -5,47 +5,44 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deletes an item of the 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 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) 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) instead of deleting the item completely.
15
15
  #
16
16
  class DeleteItem < ApiRequest
17
17
  attr_reader :item_id
18
- attr_accessor :timeout
19
- attr_accessor :ensure_https
20
-
21
- ##
22
- # * *Required arguments*
23
- # - +item_id+ -> ID of the item to be deleted.
24
- #
18
+ attr_accessor :timeout, :ensure_https
19
+
20
+ ##
21
+ # * *Required arguments*
22
+ # - +item_id+ -> ID of the item to be deleted.
23
+ #
25
24
  def initialize(item_id)
26
25
  @item_id = item_id
27
26
  @timeout = 3000
28
27
  @ensure_https = false
29
28
  end
30
-
29
+
31
30
  # HTTP method
32
31
  def method
33
32
  :delete
34
33
  end
35
-
34
+
36
35
  # Values of body parameters as a Hash
37
36
  def body_parameters
38
- p = Hash.new
39
- p
37
+ {}
40
38
  end
41
-
39
+
42
40
  # Values of query parameters as a Hash.
43
41
  # name of parameter => value of the parameter
44
42
  def query_parameters
45
- params = {}
46
- params
43
+ {}
47
44
  end
48
-
45
+
49
46
  # Relative path to the endpoint
50
47
  def path
51
48
  "/{databaseId}/items/#{@item_id}"
@@ -5,43 +5,40 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deleting an item property is roughly equivalent to removing a column from the table of items.
10
+ # Deleting an item property is roughly equivalent to removing a column from the table of items.
11
11
  #
12
12
  class DeleteItemProperty < ApiRequest
13
13
  attr_reader :property_name
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +property_name+ -> Name of the property to be deleted.
20
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +property_name+ -> Name of the property to be deleted.
19
+ #
21
20
  def initialize(property_name)
22
21
  @property_name = property_name
23
- @timeout = 100000
22
+ @timeout = 100_000
24
23
  @ensure_https = false
25
24
  end
26
-
25
+
27
26
  # HTTP method
28
27
  def method
29
28
  :delete
30
29
  end
31
-
30
+
32
31
  # Values of body parameters as a Hash
33
32
  def body_parameters
34
- p = Hash.new
35
- p
33
+ {}
36
34
  end
37
-
35
+
38
36
  # Values of query parameters as a Hash.
39
37
  # name of parameter => value of the parameter
40
38
  def query_parameters
41
- params = {}
42
- params
39
+ {}
43
40
  end
44
-
41
+
45
42
  # Relative path to the endpoint
46
43
  def path
47
44
  "/{databaseId}/items/properties/#{@property_name}"
@@ -5,45 +5,42 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Delete a Segment from a Manual ReQL Segmentation.
10
+ # Delete a Segment from a Manual ReQL Segmentation.
11
11
  #
12
12
  class DeleteManualReqlSegment < ApiRequest
13
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
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +segmentation_id+ -> ID of the Segmentation from which the Segment should be deleted
19
+ # - +segment_id+ -> ID of the Segment that should be deleted
20
+ #
22
21
  def initialize(segmentation_id, segment_id)
23
22
  @segmentation_id = segmentation_id
24
23
  @segment_id = segment_id
25
- @timeout = 10000
24
+ @timeout = 10_000
26
25
  @ensure_https = false
27
26
  end
28
-
27
+
29
28
  # HTTP method
30
29
  def method
31
30
  :delete
32
31
  end
33
-
32
+
34
33
  # Values of body parameters as a Hash
35
34
  def body_parameters
36
- p = Hash.new
37
- p
35
+ {}
38
36
  end
39
-
37
+
40
38
  # Values of query parameters as a Hash.
41
39
  # name of parameter => value of the parameter
42
40
  def query_parameters
43
- params = {}
44
- params
41
+ {}
45
42
  end
46
-
43
+
47
44
  # Relative path to the endpoint
48
45
  def path
49
46
  "/{databaseId}/segmentations/manual-reql/#{@segmentation_id}/segments/#{@segment_id}"
@@ -5,48 +5,47 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deletes all the items that pass the filter.
10
+ # Deletes all the items that pass the filter.
11
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) instead of deleting the item completely.
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) instead of deleting the item completely.#
13
13
  class DeleteMoreItems < ApiRequest
14
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) expression, which returns `true` for the items that shall be updated.
21
- #
15
+ attr_accessor :timeout, :ensure_https
16
+
17
+ ##
18
+ # * *Required arguments*
19
+ # - +filter+ -> A [ReQL](https://docs.recombee.com/reql) expression, which returns `true` for the items that shall be updated.
20
+ #
22
21
  def initialize(filter)
23
22
  @filter = filter
24
- @timeout = 100000
23
+ @timeout = 100_000
25
24
  @ensure_https = false
26
25
  end
27
-
26
+
28
27
  # HTTP method
29
28
  def method
30
29
  :delete
31
30
  end
32
-
31
+
33
32
  # Values of body parameters as a Hash
34
33
  def body_parameters
35
- p = Hash.new
34
+ p = {}
36
35
  p['filter'] = @filter
36
+
37
37
  p
38
38
  end
39
-
39
+
40
40
  # Values of query parameters as a Hash.
41
41
  # name of parameter => value of the parameter
42
42
  def query_parameters
43
- params = {}
44
- params
43
+ {}
45
44
  end
46
-
45
+
47
46
  # Relative path to the endpoint
48
47
  def path
49
- "/{databaseId}/more-items/"
48
+ '/{databaseId}/more-items/'
50
49
  end
51
50
  end
52
51
  end
@@ -5,47 +5,45 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deletes an existing purchase uniquely specified by `userId`, `itemId`, and `timestamp` or all the purchases with the given `userId` and `itemId` if `timestamp` is omitted.
10
+ # Deletes an existing purchase uniquely specified by `userId`, `itemId`, and `timestamp` or all the purchases with the given `userId` and `itemId` if `timestamp` is omitted.
11
11
  #
12
12
  class DeletePurchase < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +user_id+ -> ID of the user who made the purchase.
20
- # - +item_id+ -> ID of the item which was purchased.
21
- #
22
- # * *Optional arguments (given as hash optional)*
23
- # - +timestamp+ -> Unix timestamp of the purchase. If the `timestamp` is omitted, then all the purchases with the given `userId` and `itemId` are deleted.
24
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +user_id+ -> ID of the user who made the purchase.
19
+ # - +item_id+ -> ID of the item which was purchased.
20
+ #
21
+ # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> Unix timestamp of the purchase. If the `timestamp` is omitted, then all the purchases with the given `userId` and `itemId` are deleted.
23
+ #
25
24
  def initialize(user_id, item_id, optional = {})
26
25
  @user_id = user_id
27
26
  @item_id = item_id
28
- optional = normalize_optional(optional)
27
+ optional = normalize_hash_to_camel_case(optional)
29
28
  @timestamp = optional['timestamp']
30
29
  @optional = optional
31
30
  @timeout = 3000
32
31
  @ensure_https = false
33
32
  @optional.each do |par, _|
34
- fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
33
+ raise UnknownOptionalParameter.new(par) unless ['timestamp'].include? par
35
34
  end
36
35
  end
37
-
36
+
38
37
  # HTTP method
39
38
  def method
40
39
  :delete
41
40
  end
42
-
41
+
43
42
  # Values of body parameters as a Hash
44
43
  def body_parameters
45
- p = Hash.new
46
- p
44
+ {}
47
45
  end
48
-
46
+
49
47
  # Values of query parameters as a Hash.
50
48
  # name of parameter => value of the parameter
51
49
  def query_parameters
@@ -53,12 +51,13 @@ module RecombeeApiClient
53
51
  params['userId'] = @user_id
54
52
  params['itemId'] = @item_id
55
53
  params['timestamp'] = @optional['timestamp'] if @optional['timestamp']
54
+
56
55
  params
57
56
  end
58
-
57
+
59
58
  # Relative path to the endpoint
60
59
  def path
61
- "/{databaseId}/purchases/"
60
+ '/{databaseId}/purchases/'
62
61
  end
63
62
  end
64
63
  end
@@ -5,47 +5,45 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deletes an existing rating specified by (`userId`, `itemId`, `timestamp`) from the database or all the ratings with the given `userId` and `itemId` if `timestamp` is omitted.
10
+ # Deletes an existing rating specified by (`userId`, `itemId`, `timestamp`) from the database or all the ratings with the given `userId` and `itemId` if `timestamp` is omitted.
11
11
  #
12
12
  class DeleteRating < ApiRequest
13
13
  attr_reader :user_id, :item_id, :timestamp
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +user_id+ -> ID of the user who rated the item.
20
- # - +item_id+ -> ID of the item which was rated.
21
- #
22
- # * *Optional arguments (given as hash optional)*
23
- # - +timestamp+ -> Unix timestamp of the rating. If the `timestamp` is omitted, then all the ratings with the given `userId` and `itemId` are deleted.
24
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +user_id+ -> ID of the user who rated the item.
19
+ # - +item_id+ -> ID of the item which was rated.
20
+ #
21
+ # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> Unix timestamp of the rating. If the `timestamp` is omitted, then all the ratings with the given `userId` and `itemId` are deleted.
23
+ #
25
24
  def initialize(user_id, item_id, optional = {})
26
25
  @user_id = user_id
27
26
  @item_id = item_id
28
- optional = normalize_optional(optional)
27
+ optional = normalize_hash_to_camel_case(optional)
29
28
  @timestamp = optional['timestamp']
30
29
  @optional = optional
31
30
  @timeout = 3000
32
31
  @ensure_https = false
33
32
  @optional.each do |par, _|
34
- fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
33
+ raise UnknownOptionalParameter.new(par) unless ['timestamp'].include? par
35
34
  end
36
35
  end
37
-
36
+
38
37
  # HTTP method
39
38
  def method
40
39
  :delete
41
40
  end
42
-
41
+
43
42
  # Values of body parameters as a Hash
44
43
  def body_parameters
45
- p = Hash.new
46
- p
44
+ {}
47
45
  end
48
-
46
+
49
47
  # Values of query parameters as a Hash.
50
48
  # name of parameter => value of the parameter
51
49
  def query_parameters
@@ -53,12 +51,13 @@ module RecombeeApiClient
53
51
  params['userId'] = @user_id
54
52
  params['itemId'] = @item_id
55
53
  params['timestamp'] = @optional['timestamp'] if @optional['timestamp']
54
+
56
55
  params
57
56
  end
58
-
57
+
59
58
  # Relative path to the endpoint
60
59
  def path
61
- "/{databaseId}/ratings/"
60
+ '/{databaseId}/ratings/'
62
61
  end
63
62
  end
64
63
  end
@@ -5,43 +5,40 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Deletes synonym of the given `id`. This synonym is no longer taken into account in the [Search items](https://docs.recombee.com/api#search-items).
10
+ # Deletes synonym of the given `id`. This synonym is no longer taken into account in the [Search items](https://docs.recombee.com/api#search-items).
11
11
  #
12
12
  class DeleteSearchSynonym < ApiRequest
13
13
  attr_reader :id
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +id+ -> ID of the synonym that should be deleted.
20
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +id+ -> ID of the synonym that should be deleted.
19
+ #
21
20
  def initialize(id)
22
21
  @id = id
23
- @timeout = 10000
22
+ @timeout = 10_000
24
23
  @ensure_https = false
25
24
  end
26
-
25
+
27
26
  # HTTP method
28
27
  def method
29
28
  :delete
30
29
  end
31
-
30
+
32
31
  # Values of body parameters as a Hash
33
32
  def body_parameters
34
- p = Hash.new
35
- p
33
+ {}
36
34
  end
37
-
35
+
38
36
  # Values of query parameters as a Hash.
39
37
  # name of parameter => value of the parameter
40
38
  def query_parameters
41
- params = {}
42
- params
39
+ {}
43
40
  end
44
-
41
+
45
42
  # Relative path to the endpoint
46
43
  def path
47
44
  "/{databaseId}/synonyms/items/#{@id}"
@@ -5,43 +5,40 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Delete existing Segmentation.
10
+ # Delete existing Segmentation.
11
11
  #
12
12
  class DeleteSegmentation < ApiRequest
13
13
  attr_reader :segmentation_id
14
- attr_accessor :timeout
15
- attr_accessor :ensure_https
16
-
17
- ##
18
- # * *Required arguments*
19
- # - +segmentation_id+ -> ID of the Segmentation that should be deleted
20
- #
14
+ attr_accessor :timeout, :ensure_https
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +segmentation_id+ -> ID of the Segmentation that should be deleted
19
+ #
21
20
  def initialize(segmentation_id)
22
21
  @segmentation_id = segmentation_id
23
- @timeout = 10000
22
+ @timeout = 10_000
24
23
  @ensure_https = false
25
24
  end
26
-
25
+
27
26
  # HTTP method
28
27
  def method
29
28
  :delete
30
29
  end
31
-
30
+
32
31
  # Values of body parameters as a Hash
33
32
  def body_parameters
34
- p = Hash.new
35
- p
33
+ {}
36
34
  end
37
-
35
+
38
36
  # Values of query parameters as a Hash.
39
37
  # name of parameter => value of the parameter
40
38
  def query_parameters
41
- params = {}
42
- params
39
+ {}
43
40
  end
44
-
41
+
45
42
  # Relative path to the endpoint
46
43
  def path
47
44
  "/{databaseId}/segmentations/#{@segmentation_id}"