class RecombeeApiClient::DeleteRating

Deletes an existing rating specified by (`userId`, `itemId`, `timestamp`) from the database or all the ratings 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 rated the item.

    • item_id -> ID of the item which was rated.

  • *Optional arguments (given as hash optional)*

    • timestamp -> Unix timestamp of the rating. If the `timestamp` is omitted, then all the ratings with given `userId` and `itemId` are deleted.

# File lib/recombee_api_client/api/delete_rating.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_rating.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_rating.rb, line 39
def method
  :delete
end
path() click to toggle source

Relative path to the endpoint

# File lib/recombee_api_client/api/delete_rating.rb, line 60
def path
  "/{databaseId}/ratings/"
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_rating.rb, line 51
def query_parameters
  params = {}
  params['userId'] = @user_id
  params['itemId'] = @item_id
  params['timestamp'] = @optional['timestamp'] if @optional['timestamp']
  params
end