class RecombeeApiClient::SetItemValues

Set/update (some) property values of a given item. The properties (columns) must be previously created by [Add item property](docs.recombee.com/api.html#add-item-property).

Attributes

ensure_https[RW]
item_id[R]
timeout[RW]

Public Class Methods

new(item_id, values, optional = {}) click to toggle source
* *Required arguments*
  - +item_id+ -> ID of the item which will be modified.

  - +values+ -> The values for the individual properties.

Example of body: “`

{
  "product_description": "4K TV with 3D feature",
  "categories":   ["Electronics", "Televisions"],
  "price_usd": 342,
  "in_stock_from": "2016-11-16T08:00Z",
  "!cascadeCreate": true
}

“`

Special parameter `!cascadeCreate` may be used. It indicates that the item of the given itemId should be created if it does not exist in the database, as if the corresponding PUT method was used. Note the exclamation mark (!) at the beginning of the parameter's name to distinguish it from item property names.

* *Optional arguments (given as hash optional)*
  - +cascadeCreate+ -> Sets whether the item should be created  if not present in the database.
Calls superclass method
# File lib/recombee_api_client/api/set_item_values.rb, line 36
def initialize(item_id, values, optional = {})
  super(values, optional)
  @item_id = item_id
  @timeout = 1000
  @ensure_https = false
end

Public Instance Methods

path() click to toggle source

Relative path to the endpoint

# File lib/recombee_api_client/api/set_item_values.rb, line 44
def path
  "/{databaseId}/items/#{@item_id}"
end