Class: RecombeeApiClient::DeleteBookmark
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::DeleteBookmark
- Defined in:
- lib/recombee_api_client/api/delete_bookmark.rb
Overview
Deletes a bookmark uniquely specified by ‘userId`, `itemId`, and `timestamp` or all the bookmarks with the given `userId` and `itemId` if `timestamp` is omitted.
Instance Attribute Summary collapse
-
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
-
#item_id ⇒ Object
readonly
Returns the value of attribute item_id.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#body_parameters ⇒ Object
Values of body parameters as a Hash.
-
#initialize(user_id, item_id, optional = {}) ⇒ DeleteBookmark
constructor
-
*Required arguments* -
user_id
-> ID of the user who made the bookmark.
-
-
#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_optional
Constructor Details
#initialize(user_id, item_id, optional = {}) ⇒ DeleteBookmark
-
*Required arguments*
-
user_id
-> ID of the user who made the bookmark. -
item_id
-> ID of the item which was bookmarked.
-
-
*Optional arguments (given as hash optional)*
-
timestamp
-> Unix timestamp of the bookmark. If the ‘timestamp` is omitted, then all the bookmarks with the given `userId` and `itemId` are deleted.
-
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 25 def initialize(user_id, item_id, optional = {}) @user_id = user_id @item_id = item_id optional = normalize_optional(optional) @timestamp = optional['timestamp'] @optional = optional @timeout = 3000 @ensure_https = false @optional.each do |par, _| fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par end end |
Instance Attribute Details
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
15 16 17 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 15 def ensure_https @ensure_https end |
#item_id ⇒ Object (readonly)
Returns the value of attribute item_id.
13 14 15 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 13 def item_id @item_id end |
#timeout ⇒ Object
Returns the value of attribute timeout.
14 15 16 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 14 def timeout @timeout end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
13 14 15 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 13 def @timestamp end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
13 14 15 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 13 def user_id @user_id end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
44 45 46 47 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 44 def body_parameters p = Hash.new p end |
#method ⇒ Object
HTTP method
39 40 41 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 39 def method :delete end |
#path ⇒ Object
Relative path to the endpoint
60 61 62 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 60 def path "/{databaseId}/bookmarks/" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
51 52 53 54 55 56 57 |
# File 'lib/recombee_api_client/api/delete_bookmark.rb', line 51 def query_parameters params = {} params['userId'] = @user_id params['itemId'] = @item_id params['timestamp'] = @optional['timestamp'] if @optional['timestamp'] params end |