Package recombee_api_client :: Package api_requests :: Module delete_rating
[hide private]
[frames] | no frames]

Source Code for Module recombee_api_client.api_requests.delete_rating

 1  from recombee_api_client.api_requests.request import Request 
 2  import uuid 
 3   
 4  DEFAULT = uuid.uuid4() 
 5   
6 -class DeleteRating(Request):
7 """ 8 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. 9 10 """ 11
12 - def __init__(self, user_id, item_id, timestamp=DEFAULT):
13 """ 14 Required parameters: 15 @param user_id: ID of the user who rated the item. 16 17 @param item_id: ID of the item which was rated. 18 19 20 Optional parameters: 21 @param timestamp: Unix timestamp of the rating. If the `timestamp` is omitted, then all the ratings with given `userId` and `itemId` are deleted. 22 23 """ 24 self.user_id = user_id 25 self.item_id = item_id 26 self.timestamp = timestamp 27 self.timeout = 1000 28 self.ensure_https = False 29 self.method = 'delete' 30 self.path = "/ratings/" % ()
31
32 - def get_body_parameters(self):
33 """ 34 Values of body parameters as a dictionary (name of parameter: value of the parameter). 35 """ 36 p = dict() 37 return p
38
39 - def get_query_parameters(self):
40 """ 41 Values of query parameters as a dictionary (name of parameter: value of the parameter). 42 """ 43 params = dict() 44 params['userId'] = self.user_id 45 params['itemId'] = self.item_id 46 if self.timestamp is not DEFAULT: 47 params['timestamp'] = self.timestamp 48 return params
49