Class: RecombeeApiClient::UpdateMoreItems
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::UpdateMoreItems
- Defined in:
- lib/recombee_api_client/api/update_more_items.rb
Overview
Updates (some) property values of all the items that pass the filter.
Example: *Setting all the items that are older than a week as unavailable*
```json
{
"filter": "'releaseDate' < now() - 7*24*3600",
"changes": {"available": false}
}
```
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#body_parameters ⇒ Object
Values of body parameters as a Hash.
-
#initialize(filter, changes) ⇒ UpdateMoreItems
constructor
-
*Required arguments* -
filter
-> A [ReQL](docs.recombee.com/reql) expression, which returns ‘true` for the items that shall be updated.
-
-
#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(filter, changes) ⇒ UpdateMoreItems
-
*Required arguments*
-
filter
-> A [ReQL](docs.recombee.com/reql) expression, which returns ‘true` for the items that shall be updated. -
changes
-> A dictionary where the keys are properties that shall be updated.
-
31 32 33 34 35 36 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 31 def initialize(filter, changes) @filter = filter @changes = changes @timeout = 100000 @ensure_https = false end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
22 23 24 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 22 def changes @changes end |
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
24 25 26 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 24 def ensure_https @ensure_https end |
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
22 23 24 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 22 def filter @filter end |
#timeout ⇒ Object
Returns the value of attribute timeout.
23 24 25 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 23 def timeout @timeout end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
44 45 46 47 48 49 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 44 def body_parameters p = Hash.new p['filter'] = @filter p['changes'] = @changes p end |
#method ⇒ Object
HTTP method
39 40 41 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 39 def method :post end |
#path ⇒ Object
Relative path to the endpoint
59 60 61 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 59 def path "/{databaseId}/more-items/" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
53 54 55 56 |
# File 'lib/recombee_api_client/api/update_more_items.rb', line 53 def query_parameters params = {} params end |