Class: RecombeeApiClient::DeleteItem

Inherits:
ApiRequest show all
Defined in:
lib/recombee_api_client/api/delete_item.rb

Overview

Deletes an item of the given itemId from the catalog.

If there are any purchases, ratings, bookmarks, cart additions, or detail views of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some series, it will be removed from all the series where present.

If an item becomes obsolete/no longer available, it is meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and only exclude the item from recommendations. In such a case, use ReQL filter instead of deleting the item completely.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_hash_to_camel_case

Constructor Details

#initialize(item_id) ⇒ DeleteItem

  • Required arguments
    • item_id -> ID of the item to be deleted.


24
25
26
27
28
# File 'lib/recombee_api_client/api/delete_item.rb', line 24

def initialize(item_id)
  @item_id = item_id
  @timeout = 3000
  @ensure_https = false
end

Instance Attribute Details

#ensure_httpsObject

Returns the value of attribute ensure_https.



18
19
20
# File 'lib/recombee_api_client/api/delete_item.rb', line 18

def ensure_https
  @ensure_https
end

#item_idObject (readonly)

Returns the value of attribute item_id.



17
18
19
# File 'lib/recombee_api_client/api/delete_item.rb', line 17

def item_id
  @item_id
end

#timeoutObject

Returns the value of attribute timeout.



18
19
20
# File 'lib/recombee_api_client/api/delete_item.rb', line 18

def timeout
  @timeout
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



36
37
38
# File 'lib/recombee_api_client/api/delete_item.rb', line 36

def body_parameters
  {}
end

#methodObject

HTTP method



31
32
33
# File 'lib/recombee_api_client/api/delete_item.rb', line 31

def method
  :delete
end

#pathObject

Relative path to the endpoint



47
48
49
# File 'lib/recombee_api_client/api/delete_item.rb', line 47

def path
  "/{databaseId}/items/#{@item_id}"
end

#query_parametersObject

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



42
43
44
# File 'lib/recombee_api_client/api/delete_item.rb', line 42

def query_parameters
  {}
end