Class: RecombeeApiClient::AddItemProperty
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::AddItemProperty
- Defined in:
- lib/recombee_api_client/api/add_item_property.rb
Overview
Adding an item property is somewhat equivalent to adding a column to the table of items. The items may be characterized by various properties of different types.
Instance Attribute Summary collapse
-
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
-
#property_name ⇒ Object
readonly
Returns the value of attribute property_name.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#body_parameters ⇒ Object
Values of body parameters as a Hash.
-
#initialize(property_name, type) ⇒ AddItemProperty
constructor
-
*Required arguments* -
property_name
-> Name of the item property to be created.
-
-
#method ⇒ Object
HTTP method.
-
#path ⇒ Object
Relative path to the endpoint.
-
#query_parameters ⇒ Object
Values of query parameters as a Hash.
Methods included from HashNormalizer
#camelize, #normalize_optional
Constructor Details
#initialize(property_name, type) ⇒ AddItemProperty
-
*Required arguments*
-
property_name
-> Name of the item property to be created. Currently, the following names are reserved: ‘id`, `itemid`, case-insensitively. Also, the length of the property name must not exceed 63 characters. -
type
-> Value type of the item property to be created. One of: ‘int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
-
-
‘int`- Signed integer number.
-
‘double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
-
‘string` - UTF-8 string.
-
‘boolean` - true / false
-
‘timestamp` - Value representing date and time.
-
‘set` - Set of strings.
-
‘image` - URL of an image (`jpeg`, `png` or `gif`).
-
‘imageList` - List of URLs that refer to images.
40 41 42 43 44 45 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 40 def initialize(property_name, type) @property_name = property_name @type = type @timeout = 100000 @ensure_https = false end |
Instance Attribute Details
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
15 16 17 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 15 def ensure_https @ensure_https end |
#property_name ⇒ Object (readonly)
Returns the value of attribute property_name.
13 14 15 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 13 def property_name @property_name end |
#timeout ⇒ Object
Returns the value of attribute timeout.
14 15 16 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 14 def timeout @timeout end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 13 def type @type end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
53 54 55 56 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 53 def body_parameters p = Hash.new p end |
#method ⇒ Object
HTTP method
48 49 50 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 48 def method :put end |
#path ⇒ Object
Relative path to the endpoint
67 68 69 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 67 def path "/{databaseId}/items/properties/#{@property_name}" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
60 61 62 63 64 |
# File 'lib/recombee_api_client/api/add_item_property.rb', line 60 def query_parameters params = {} params['type'] = @type params end |