class RecombeeApiClient::DeleteBookmark

Deletes a bookmark uniquely specified by `userId`, `itemId`, and `timestamp` or all the bookmarks with given `userId` and `itemId` if `timestamp` is omitted.

Attributes

ensure_https[RW]
item_id[R]
timeout[RW]
timestamp[R]
user_id[R]

Public Class Methods

new(user_id, item_id, optional = {}) click to toggle source
  • *Required arguments*

    • user_id -> ID of the user who made the bookmark.

    • item_id -> ID of the item of 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 given `userId` and `itemId` are deleted.

# 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 = 1000
  @ensure_https = false
  @optional.each do |par, _|
    fail UnknownOptionalParameter.new(par) unless ["timestamp"].include? par
  end
end

Public Instance Methods

body_parameters() click to toggle source

Values of body parameters as a Hash

# File lib/recombee_api_client/api/delete_bookmark.rb, line 44
def body_parameters
  p = Hash.new
  p
end
method() click to toggle source

HTTP method

# File lib/recombee_api_client/api/delete_bookmark.rb, line 39
def method
  :delete
end
path() click to toggle source

Relative path to the endpoint

# File lib/recombee_api_client/api/delete_bookmark.rb, line 60
def path
  "/{databaseId}/bookmarks/"
end
query_parameters() click to toggle source

Values of query parameters as a Hash. name of parameter => value of the parameter

# 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