class RecombeeApiClient::SetValues

Set/update (some) property values of a given entity.

Attributes

cascade_create[R]
values[R]

Public Class Methods

new( values, optional = {}) click to toggle source
* *Required arguments*
  - +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",
}

“`

* *Optional arguments (given as hash optional)*
  - +cascadeCreate+ -> Sets whether the item should be created  if not present in the database.
# File lib/recombee_api_client/api/set_values.rb, line 28
def initialize( values, optional = {})
  @values = values
  optional = normalize_optional(optional)
  @cascade_create = optional['cascadeCreate']
  @optional = optional
  @optional.each do |par, _|
    fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].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/set_values.rb, line 44
def body_parameters
  result = Hash.new
  result = result.merge(@values)
  result['!cascadeCreate'] = true if @cascade_create
  result
end
method() click to toggle source

HTTP method

# File lib/recombee_api_client/api/set_values.rb, line 39
def method
  :post
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/set_values.rb, line 53
def query_parameters
  Hash.new
end