Class: RecombeeApiClient::RecommendNextItemSegments
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::RecommendNextItemSegments
- Defined in:
- lib/recombee_api_client/api/recommend_next_item_segments.rb
Overview
Returns [Item Segments](docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
The request requires the ‘recommId` of a base recommendation request and the number of Segments to return (`count`).
The base request can be one of:
- [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
- [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
- [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
- [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
All other parameters are inherited from the base request associated with the provided ‘recommId`.
This endpoint can be called multiple times for a single ‘recommId`. Each call returns different Item Segments that have not been recommended in previous calls. The number of calls made so far is returned in the `numberNextRecommsCalls` field.
Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
For billing purposes, each call to this endpoint is counted as a separate recommendation request.
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
-
#recomm_id ⇒ Object
readonly
Returns the value of attribute recomm_id.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#body_parameters ⇒ Object
Values of body parameters as a Hash.
-
#initialize(recomm_id, count) ⇒ RecommendNextItemSegments
constructor
-
*Required arguments* -
recomm_id-> ID of the base recommendation request for which next recommendations should be returned -count-> Number of item segments to be recommended.
-
-
#method ⇒ Object
HTTP method.
-
#path ⇒ Object
Relative path to the endpoint.
-
#query_parameters ⇒ Object
Values of query parameters as a Hash.
Methods included from HashNormalizer
#camelize, #normalize_hash_to_camel_case
Constructor Details
#initialize(recomm_id, count) ⇒ RecommendNextItemSegments
-
*Required arguments*
-
recomm_id-> ID of the base recommendation request for which next recommendations should be returned -
count-> Number of item segments to be recommended
-
39 40 41 42 43 44 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 39 def initialize(recomm_id, count) @recomm_id = recomm_id @count = count @timeout = 3000 @ensure_https = false end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
30 31 32 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 30 def count @count end |
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
31 32 33 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 31 def ensure_https @ensure_https end |
#recomm_id ⇒ Object (readonly)
Returns the value of attribute recomm_id.
30 31 32 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 30 def recomm_id @recomm_id end |
#timeout ⇒ Object
Returns the value of attribute timeout.
31 32 33 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 31 def timeout @timeout end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
52 53 54 55 56 57 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 52 def body_parameters p = {} p['count'] = @count p end |
#method ⇒ Object
HTTP method
47 48 49 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 47 def method :post end |
#path ⇒ Object
Relative path to the endpoint
66 67 68 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 66 def path "/{databaseId}/recomms/next/item-segments/#{@recomm_id}" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
61 62 63 |
# File 'lib/recombee_api_client/api/recommend_next_item_segments.rb', line 61 def query_parameters {} end |