recombee_api_client 1.3 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01eda031f563d917d6ab45fc0df38088548040f0
4
- data.tar.gz: 4cde01351f86b3fdf7eb7d860e765e9aab61d324
3
+ metadata.gz: f4bc519621572e646541d23ca0d6ccf8748344d2
4
+ data.tar.gz: f57786e0c50990eab3d21ff781448dd012b30bac
5
5
  SHA512:
6
- metadata.gz: 554558dbacfc64473c3611ed0a258921cedf8541e19fb1555f567c6dac1ea718f80a2e7db19ea4a7f44fb20a516ec971ef8571ff73eeea4f5216aae3b7d7a6a8
7
- data.tar.gz: b632b4e5ba2dc78402955a4a418a555e14fa89a9a767d10d46329282723764e6490a77ef8d387266030244cc430163295d9b81f5e80f5095307eda437f7534b2
6
+ metadata.gz: 9e2fda2576c5cdcf35fe48ee23bb3bd5a6360930f8078e3511b394ef6a2bfa5dc9bd98d48c34c337e236ba1f015e0c18eac8903784943e894427d89a4c85e47b
7
+ data.tar.gz: 053a016e1e4fd90708de1998e1625559e09604a09da9c631f7ce0ac0b5ec997bcf57ea8a2a55e6bdf25a35942bcdb3ec130e3e186454a471853b81c019e49e4e
@@ -0,0 +1,56 @@
1
+ module RecombeeApiClient
2
+ require_relative 'request'
3
+ require_relative '../errors'
4
+
5
+ ##
6
+ #Set/update (some) property values of a given entity.
7
+ #
8
+ class SetValues < ApiRequest
9
+ attr_reader :cascade_create, :values
10
+
11
+ ##
12
+ # * *Required arguments*
13
+ # - +values+ -> The values for the individual properties.
14
+ #
15
+ #Example of body:
16
+ #```
17
+ # {
18
+ # "product_description": "4K TV with 3D feature",
19
+ # "categories": ["Electronics", "Televisions"],
20
+ # "price_usd": 342,
21
+ # "in_stock_from": "2016-11-16T08:00Z",
22
+ # }
23
+ #```
24
+ #
25
+ # * *Optional arguments (given as hash optional)*
26
+ # - +cascadeCreate+ -> Sets whether the item should be created if not present in the database.
27
+ #
28
+ def initialize( values, optional = {})
29
+ @values = values
30
+ @cascade_create = optional['cascadeCreate']
31
+ @optional = optional
32
+ @optional.each do |par, _|
33
+ fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
34
+ end
35
+ end
36
+
37
+ # HTTP method
38
+ def method
39
+ :post
40
+ end
41
+
42
+ # Values of body parameters as a Hash
43
+ def body_parameters
44
+ result = Hash.new
45
+ result = result.merge(@values)
46
+ result['!cascadeCreate'] = true if @cascade_create
47
+ result
48
+ end
49
+
50
+ # Values of query parameters as a Hash.
51
+ # name of parameter => value of the parameter
52
+ def query_parameters
53
+ Hash.new
54
+ end
55
+ end
56
+ end
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '1.3'
2
+ VERSION = '1.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler
@@ -147,6 +147,7 @@ files:
147
147
  - lib/recombee_api_client/api/reset_database.rb
148
148
  - lib/recombee_api_client/api/set_item_values.rb
149
149
  - lib/recombee_api_client/api/set_user_values.rb
150
+ - lib/recombee_api_client/api/set_values.rb
150
151
  - lib/recombee_api_client/api/user_based_recommendation.rb
151
152
  - lib/recombee_api_client/errors.rb
152
153
  - lib/recombee_api_client/version.rb