Class: RecombeeApiClient::RecommendNextItems
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::RecommendNextItems
- Defined in:
- lib/recombee_api_client/api/recommend_next_items.rb
Overview
Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (infinite scroll) or goes to the next page.
It accepts recommId of a base recommendation request (e.g., request from the first page) and the number of items that shall be returned (count).
The base request can be one of:
All the other parameters are inherited from the base request.
Recommend next items can be called many times for a single recommId and each call returns different (previously not recommended) items.
The number of Recommend next items calls performed so far is returned in the numberNextRecommsCalls field.
Recommend next items can be requested up to 30 minutes after the base request or a previous Recommend next items call.
For billing purposes, each call to Recommend next items 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) ⇒ RecommendNextItems
constructor
- Required arguments -
recomm_id-> ID of the base recommendation request for which next recommendations should be returned -count-> Number of items to be recommended.
- Required arguments -
-
#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) ⇒ RecommendNextItems
-
Required arguments
recomm_id-> ID of the base recommendation request for which next recommendations should be returnedcount-> Number of items to be recommended
38 39 40 41 42 43 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 38 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.
29 30 31 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 29 def count @count end |
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
30 31 32 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 30 def ensure_https @ensure_https end |
#recomm_id ⇒ Object (readonly)
Returns the value of attribute recomm_id.
29 30 31 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 29 def recomm_id @recomm_id end |
#timeout ⇒ Object
Returns the value of attribute timeout.
30 31 32 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 30 def timeout @timeout end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
51 52 53 54 55 56 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 51 def body_parameters p = {} p['count'] = @count p end |
#method ⇒ Object
HTTP method
46 47 48 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 46 def method :post end |
#path ⇒ Object
Relative path to the endpoint
65 66 67 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 65 def path "/{databaseId}/recomms/next/items/#{@recomm_id}" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
60 61 62 |
# File 'lib/recombee_api_client/api/recommend_next_items.rb', line 60 def query_parameters {} end |