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,147 +5,187 @@
5
5
  module RecombeeApiClient
6
6
  require_relative 'request'
7
7
  require_relative '../errors'
8
-
8
+
9
9
  ##
10
- #Recommends Items that are the most relevant to a particular Segment from a context [Segmentation](https://docs.recombee.com/segmentations).
10
+ # Recommends Items that are the most relevant to a particular Segment from a context [Segmentation](https://docs.recombee.com/segmentations).
11
11
  #
12
- #Based on the used Segmentation, this endpoint can be used for example for:
12
+ # Based on the used Segmentation, this endpoint can be used for example for:
13
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
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
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.
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
19
  #
20
- #The returned items are sorted by relevance (the first item being the most relevant).
20
+ # The returned items are sorted by relevance (the first item being the most relevant).
21
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.
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
23
  #
24
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) 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 a user of the given *targetUserId* doesn't exist in the database, it creates this user 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
- #```json
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
- #```json
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) 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) in the [Admin UI](https://admin.recombee.com).
121
- #
122
- # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql) 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) 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) 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) 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
- #
25
+ attr_reader :context_segment_id, :target_user_id, :count, :scenario, :cascade_create, :return_properties,
26
+ :included_properties, :filter, :booster, :logic, :reql_expressions, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
27
+ attr_accessor :timeout, :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) 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 a user of the given *targetUserId* doesn't exist in the database, it creates this user 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
+ # ```json
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
+ # ```json
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) 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) in the [Admin UI](https://admin.recombee.com).
121
+ #
122
+ # - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql) 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) 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) 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) in the [Admin UI](https://admin.recombee.com).
132
+ #
133
+ # - +reqlExpressions+ -> A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended item.
134
+ # This can be used to compute additional properties of the recommended items that are not stored in the database.
135
+ #
136
+ # The keys are the names of the expressions, and the values are the actual ReQL expressions.
137
+ #
138
+ # Example request:
139
+ # ```json
140
+ # {
141
+ # "reqlExpressions": {
142
+ # "isInUsersCity": "context_user[\"city\"] in 'cities'",
143
+ # "distanceToUser": "earth_distance('location', context_user[\"location\"])"
144
+ # }
145
+ # }
146
+ # ```
147
+ #
148
+ # Example response:
149
+ # ```json
150
+ # {
151
+ # "recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
152
+ # "recomms":
153
+ # [
154
+ # {
155
+ # "id": "restaurant-178",
156
+ # "reqlEvaluations": {
157
+ # "isInUsersCity": true,
158
+ # "distanceToUser": 5200.2
159
+ # }
160
+ # },
161
+ # {
162
+ # "id": "bar-42",
163
+ # "reqlEvaluations": {
164
+ # "isInUsersCity": false,
165
+ # "distanceToUser": 2516.0
166
+ # }
167
+ # }
168
+ # ],
169
+ # "numberNextRecommsCalls": 0
170
+ # }
171
+ # ```
172
+ #
173
+ # - +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.
174
+ #
175
+ # - +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.
176
+ #
177
+ # - +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.
178
+ #
179
+ # - +expertSettings+ -> Dictionary of custom options.
180
+ #
181
+ # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
182
+ #
183
+ #
144
184
  def initialize(context_segment_id, target_user_id, count, optional = {})
145
185
  @context_segment_id = context_segment_id
146
186
  @target_user_id = target_user_id
147
187
  @count = count
148
- optional = normalize_optional(optional)
188
+ optional = normalize_hash_to_camel_case(optional)
149
189
  @scenario = optional['scenario']
150
190
  @cascade_create = optional['cascadeCreate']
151
191
  @return_properties = optional['returnProperties']
@@ -153,6 +193,7 @@ module RecombeeApiClient
153
193
  @filter = optional['filter']
154
194
  @booster = optional['booster']
155
195
  @logic = optional['logic']
196
+ @reql_expressions = optional['reqlExpressions']
156
197
  @min_relevance = optional['minRelevance']
157
198
  @rotation_rate = optional['rotationRate']
158
199
  @rotation_time = optional['rotationTime']
@@ -162,18 +203,19 @@ module RecombeeApiClient
162
203
  @timeout = 3000
163
204
  @ensure_https = false
164
205
  @optional.each do |par, _|
165
- fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","returnProperties","includedProperties","filter","booster","logic","minRelevance","rotationRate","rotationTime","expertSettings","returnAbGroup"].include? par
206
+ raise UnknownOptionalParameter.new(par) unless %w[scenario cascadeCreate returnProperties
207
+ includedProperties filter booster logic reqlExpressions minRelevance rotationRate rotationTime expertSettings returnAbGroup].include? par
166
208
  end
167
209
  end
168
-
210
+
169
211
  # HTTP method
170
212
  def method
171
213
  :post
172
214
  end
173
-
215
+
174
216
  # Values of body parameters as a Hash
175
217
  def body_parameters
176
- p = Hash.new
218
+ p = {}
177
219
  p['contextSegmentId'] = @context_segment_id
178
220
  p['targetUserId'] = @target_user_id
179
221
  p['count'] = @count
@@ -184,24 +226,25 @@ module RecombeeApiClient
184
226
  p['filter'] = @optional['filter'] if @optional.include? 'filter'
185
227
  p['booster'] = @optional['booster'] if @optional.include? 'booster'
186
228
  p['logic'] = @optional['logic'] if @optional.include? 'logic'
229
+ p['reqlExpressions'] = @optional['reqlExpressions'] if @optional.include? 'reqlExpressions'
187
230
  p['minRelevance'] = @optional['minRelevance'] if @optional.include? 'minRelevance'
188
231
  p['rotationRate'] = @optional['rotationRate'] if @optional.include? 'rotationRate'
189
232
  p['rotationTime'] = @optional['rotationTime'] if @optional.include? 'rotationTime'
190
233
  p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
191
234
  p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
235
+
192
236
  p
193
237
  end
194
-
238
+
195
239
  # Values of query parameters as a Hash.
196
240
  # name of parameter => value of the parameter
197
241
  def query_parameters
198
- params = {}
199
- params
242
+ {}
200
243
  end
201
-
244
+
202
245
  # Relative path to the endpoint
203
246
  def path
204
- "/{databaseId}/recomms/item-segments/items/"
247
+ '/{databaseId}/recomms/item-segments/items/'
205
248
  end
206
249
  end
207
250
  end