Class: RecombeeApiClient::SetUserValues

Inherits:
SetValues show all
Defined in:
lib/recombee_api_client/api/set_user_values.rb

Overview

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

Instance Attribute Summary collapse

Attributes inherited from SetValues

#cascade_create, #values

Instance Method Summary collapse

Methods inherited from SetValues

#body_parameters, #method, #query_parameters

Methods included from HashNormalizer

#camelize, #normalize_optional

Constructor Details

#initialize(user_id, values, optional = {}) ⇒ SetUserValues

  • *Required arguments*

    • user_id -> ID of the user which will be modified.

    • values -> The values for the individual properties.

Example of body: “‘

{
  "country": "US",
  "sex": "F",
}

“‘

  • *Optional arguments (given as hash optional)*

    • cascadeCreate -> Sets whether the item should be created if not present in the database.



30
31
32
33
34
35
# File 'lib/recombee_api_client/api/set_user_values.rb', line 30

def initialize(user_id, values, optional = {})
  super(values, optional)
  @user_id = user_id
  @timeout = 1000
  @ensure_https = false
end

Instance Attribute Details

#ensure_httpsObject

Returns the value of attribute ensure_https.



11
12
13
# File 'lib/recombee_api_client/api/set_user_values.rb', line 11

def ensure_https
  @ensure_https
end

#timeoutObject

Returns the value of attribute timeout.



10
11
12
# File 'lib/recombee_api_client/api/set_user_values.rb', line 10

def timeout
  @timeout
end

#user_idObject (readonly)

Returns the value of attribute user_id.



9
10
11
# File 'lib/recombee_api_client/api/set_user_values.rb', line 9

def user_id
  @user_id
end

Instance Method Details

#pathObject

Relative path to the endpoint



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

def path
  "/{databaseId}/users/#{@user_id}"
end