Class: RecombeeApiClient::DeleteItem

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

Overview

Deletes an item of 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](docs.recombee.com/reql.html) instead of deleting the item completely.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_optional

Constructor Details

#initialize(item_id) ⇒ DeleteItem

  • *Required arguments*

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



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

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

Instance Attribute Details

#ensure_httpsObject

Returns the value of attribute ensure_https.



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

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



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

def body_parameters
  p = Hash.new
  p
end

#methodObject

HTTP method



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

def method
  :delete
end

#pathObject

Relative path to the endpoint



50
51
52
# File 'lib/recombee_api_client/api/delete_item.rb', line 50

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

#query_parametersObject

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



44
45
46
47
# File 'lib/recombee_api_client/api/delete_item.rb', line 44

def query_parameters
  params = {}
  params
end