recombee_api_client 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 946801c5ff87b7b436bdebae1c869bb47adaa63d07f0a779da3da48961fdb704
4
- data.tar.gz: 14e9ead529eb19b683314182f8cdf2c22f18f208f4d58559a6aa8086e788343f
3
+ metadata.gz: 322e3294002769557374b46669a1958f70b82f0d0934d0c3591fe2171d6f4339
4
+ data.tar.gz: 454a96ba684ea9cfd9ccfe054dc11a3882c44ea223d791443ebfec60942283d6
5
5
  SHA512:
6
- metadata.gz: 41cf5de6569aae7b973a3d03eccd2d819aaadcce8c2afccba7d8b38462c822bb04efbbe033fa96a4ad7d89a7a9891d947c6fe8779fe9732ae2cd59ae1584acae
7
- data.tar.gz: f8ef99a8dffd542ea917e43a2ae776eeda38308daa9dc12f62155623df2ff633793aa5d5a054c10d48f0065d9633dbe1e382f07fd3fc73d22636e9635b825ebb
6
+ metadata.gz: b81694d2b9129008f36176f97549987cc0b6e70e1483c7255f1a96e93212bd031a39e195affa1a983981a5ebb75bd39a7681769f285e59d718cdc46119c4544d
7
+ data.tar.gz: bab1496561a47afc49bf0395848d31a903bf6e6bcaee3c438c5c04957b3833a6b59e67886414f49a7a4b077dd2e4dbfdc1951b443867bf639cc2c5ec308bc0cb
@@ -10,7 +10,7 @@ module RecombeeApiClient
10
10
  # 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.
11
11
  #
12
12
  class AddItemProperty < ApiRequest
13
- attr_reader :property_name, :type
13
+ attr_reader :property_name, :type, :role, :metadata
14
14
  attr_accessor :timeout, :ensure_https
15
15
 
16
16
  ##
@@ -19,7 +19,7 @@ module RecombeeApiClient
19
19
  #
20
20
  # - +type+ -> Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
21
21
  #
22
- # * `int`- Signed integer number.
22
+ # * `int` - Signed integer number.
23
23
  #
24
24
  # * `double` - Floating point number. It uses 64-bit base-2 format (IEEE 754 standard).
25
25
  #
@@ -27,7 +27,7 @@ module RecombeeApiClient
27
27
  #
28
28
  # * `boolean` - *true* / *false*
29
29
  #
30
- # * `timestamp` - Value representing date and time.
30
+ # * `timestamp` - Value representing date and time. ISO8601-1 pattern (string) or UTC epoch time (number).
31
31
  #
32
32
  # * `set` - Set of strings.
33
33
  #
@@ -36,11 +36,23 @@ module RecombeeApiClient
36
36
  # * `imageList` - List of URLs that refer to images.
37
37
  #
38
38
  #
39
- def initialize(property_name, type)
39
+ # * *Optional arguments (given as hash optional)*
40
+ # - +role+ -> [Role](https://docs.recombee.com/api/property_roles_metadata#roles) to assign to the property.
41
+ #
42
+ # - +metadata+ -> List of [metadata](https://docs.recombee.com/api/property_roles_metadata#metadata) entries to assign to the property.
43
+ #
44
+ def initialize(property_name, type, optional = {})
40
45
  @property_name = property_name
41
46
  @type = type
47
+ optional = normalize_hash_to_camel_case(optional)
48
+ @role = optional['role']
49
+ @metadata = optional['metadata']
50
+ @optional = optional
42
51
  @timeout = 100_000
43
52
  @ensure_https = false
53
+ @optional.each do |par, _|
54
+ raise UnknownOptionalParameter.new(par) unless %w[role metadata].include? par
55
+ end
44
56
  end
45
57
 
46
58
  # HTTP method
@@ -50,16 +62,18 @@ module RecombeeApiClient
50
62
 
51
63
  # Values of body parameters as a Hash
52
64
  def body_parameters
53
- {}
65
+ p = {}
66
+ p['type'] = @type
67
+ p['role'] = @optional['role'] if @optional.include? 'role'
68
+ p['metadata'] = @optional['metadata'] if @optional.include? 'metadata'
69
+
70
+ p
54
71
  end
55
72
 
56
73
  # Values of query parameters as a Hash.
57
74
  # name of parameter => value of the parameter
58
75
  def query_parameters
59
- params = {}
60
- params['type'] = @type
61
-
62
- params
76
+ {}
63
77
  end
64
78
 
65
79
  # Relative path to the endpoint
@@ -10,7 +10,7 @@ module RecombeeApiClient
10
10
  # Adding a user property is somewhat equivalent to adding a column to the table of users. The users may be characterized by various properties of different types.
11
11
  #
12
12
  class AddUserProperty < ApiRequest
13
- attr_reader :property_name, :type
13
+ attr_reader :property_name, :type, :role, :metadata
14
14
  attr_accessor :timeout, :ensure_https
15
15
 
16
16
  ##
@@ -27,16 +27,28 @@ module RecombeeApiClient
27
27
  #
28
28
  # * `boolean` - *true* / *false*
29
29
  #
30
- # * `timestamp` - Value representing date and time.
30
+ # * `timestamp` - Value representing date and time. ISO8601-1 pattern (string) or UTC epoch time (number).
31
31
  #
32
32
  # * `set` - Set of strings.
33
33
  #
34
34
  #
35
- def initialize(property_name, type)
35
+ # * *Optional arguments (given as hash optional)*
36
+ # - +role+ -> [Role](https://docs.recombee.com/api/property_roles_metadata#roles) to assign to the property.
37
+ #
38
+ # - +metadata+ -> List of [metadata](https://docs.recombee.com/api/property_roles_metadata#metadata) entries to assign to the property.
39
+ #
40
+ def initialize(property_name, type, optional = {})
36
41
  @property_name = property_name
37
42
  @type = type
43
+ optional = normalize_hash_to_camel_case(optional)
44
+ @role = optional['role']
45
+ @metadata = optional['metadata']
46
+ @optional = optional
38
47
  @timeout = 100_000
39
48
  @ensure_https = false
49
+ @optional.each do |par, _|
50
+ raise UnknownOptionalParameter.new(par) unless %w[role metadata].include? par
51
+ end
40
52
  end
41
53
 
42
54
  # HTTP method
@@ -46,16 +58,18 @@ module RecombeeApiClient
46
58
 
47
59
  # Values of body parameters as a Hash
48
60
  def body_parameters
49
- {}
61
+ p = {}
62
+ p['type'] = @type
63
+ p['role'] = @optional['role'] if @optional.include? 'role'
64
+ p['metadata'] = @optional['metadata'] if @optional.include? 'metadata'
65
+
66
+ p
50
67
  end
51
68
 
52
69
  # Values of query parameters as a Hash.
53
70
  # name of parameter => value of the parameter
54
71
  def query_parameters
55
- params = {}
56
- params['type'] = @type
57
-
58
- params
72
+ {}
59
73
  end
60
74
 
61
75
  # Relative path to the endpoint
@@ -7,23 +7,24 @@ module RecombeeApiClient
7
7
  require_relative '../errors'
8
8
 
9
9
  ##
10
- # Returns Item segments that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (*infinite scroll*) or goes to the next page.
10
+ # Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
11
+ #
12
+ # The request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).
11
13
  #
12
- # It accepts `recommId` of a base recommendation request (e.g., request from the first page) and the number of segments that shall be returned (`count`).
13
14
  # The base request can be one of:
14
15
  # - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
15
16
  # - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
16
17
  # - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
17
18
  # - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
18
19
  #
19
- # All the other parameters are inherited from the base request.
20
+ # All other parameters are inherited from the base request associated with the provided `recommId`.
20
21
  #
21
- # *Recommend next Item segments* can be called many times for a single `recommId` and each call returns different (previously not recommended) segments.
22
- # The number of *Recommend next Item segments* calls performed so far is returned in the `numberNextRecommsCalls` field.
22
+ # This endpoint can be called multiple times for a single `recommId`. Each call returns different Item Segments that have not been recommended in previous calls.
23
+ # The number of calls made so far is returned in the `numberNextRecommsCalls` field.
23
24
  #
24
- # *Recommend next Item segments* can be requested up to 30 minutes after the base request or a previous *Recommend next Item segments* call.
25
+ # Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
25
26
  #
26
- # For billing purposes, each call to *Recommend next Item segments* is counted as a separate recommendation request.
27
+ # For billing purposes, each call to this endpoint is counted as a separate recommendation request.
27
28
  #
28
29
  class RecommendNextItemSegments < ApiRequest
29
30
  attr_reader :recomm_id, :count
@@ -0,0 +1,46 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ require 'json'
6
+
7
+ module RecombeeApiClient
8
+ require_relative 'input'
9
+ require_relative '../errors'
10
+
11
+ ##
12
+ # Initializes PropertyMetadata input#
13
+ class PropertyMetadata < Input
14
+ attr_reader :name, :settings
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +name+ -> Name of the [metadata](https://docs.recombee.com/api/property_roles_metadata#metadata) assigned to the property.
19
+ #
20
+ # * *Optional arguments (given as hash optional)*
21
+ # - +settings+ -> Optional configuration for this metadata entry.
22
+ #
23
+ def initialize(name, optional = {})
24
+ @name = name
25
+ optional = normalize_hash_to_camel_case(optional)
26
+ @settings = optional['settings']
27
+ @optional = optional
28
+ @optional.each do |par, _|
29
+ raise UnknownOptionalParameter.new(par) unless ['settings'].include? par
30
+ end
31
+ end
32
+
33
+ # Return only JSON-serializable primitives.
34
+ def as_json(_options = {})
35
+ res = {}
36
+ res['name'] = @name
37
+ res['settings'] = @optional['settings'] if @optional['settings']
38
+
39
+ res
40
+ end
41
+
42
+ def to_json(*args)
43
+ as_json.to_json(*args)
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,46 @@
1
+ #
2
+ # This file is auto-generated, do not edit
3
+ #
4
+
5
+ require 'json'
6
+
7
+ module RecombeeApiClient
8
+ require_relative 'input'
9
+ require_relative '../errors'
10
+
11
+ ##
12
+ # Initializes PropertyRole input#
13
+ class PropertyRole < Input
14
+ attr_reader :name, :settings
15
+
16
+ ##
17
+ # * *Required arguments*
18
+ # - +name+ -> Name of the [role](https://docs.recombee.com/api/property_roles_metadata#roles) assigned to the property.
19
+ #
20
+ # * *Optional arguments (given as hash optional)*
21
+ # - +settings+ -> Optional configuration specific to the selected role.
22
+ #
23
+ def initialize(name, optional = {})
24
+ @name = name
25
+ optional = normalize_hash_to_camel_case(optional)
26
+ @settings = optional['settings']
27
+ @optional = optional
28
+ @optional.each do |par, _|
29
+ raise UnknownOptionalParameter.new(par) unless ['settings'].include? par
30
+ end
31
+ end
32
+
33
+ # Return only JSON-serializable primitives.
34
+ def as_json(_options = {})
35
+ res = {}
36
+ res['name'] = @name
37
+ res['settings'] = @optional['settings'] if @optional['settings']
38
+
39
+ res
40
+ end
41
+
42
+ def to_json(*args)
43
+ as_json.to_json(*args)
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '6.2.0'
2
+ VERSION = '6.3.0'
3
3
  end
@@ -19,7 +19,7 @@ module RecombeeApiClient
19
19
  include HTTParty
20
20
 
21
21
  BATCH_MAX_SIZE = 10_000
22
- USER_AGENT = { 'User-Agent' => 'recombee-ruby-api-client/6.2.0' }
22
+ USER_AGENT = { 'User-Agent' => 'recombee-ruby-api-client/6.3.0' }
23
23
 
24
24
  ##
25
25
  # - +account+ -> Name of your account at Recombee
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2026-06-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty
@@ -181,6 +181,8 @@ files:
181
181
  - lib/recombee_api_client/inputs/composite_recommendation_stage_parameters.rb
182
182
  - lib/recombee_api_client/inputs/input.rb
183
183
  - lib/recombee_api_client/inputs/logic.rb
184
+ - lib/recombee_api_client/inputs/property_metadata.rb
185
+ - lib/recombee_api_client/inputs/property_role.rb
184
186
  - lib/recombee_api_client/utils/hash_normalizer.rb
185
187
  - lib/recombee_api_client/version.rb
186
188
  - recombee_api_client.gemspec
@@ -202,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
204
  - !ruby/object:Gem::Version
203
205
  version: '0'
204
206
  requirements: []
205
- rubygems_version: 3.7.2
207
+ rubygems_version: 3.6.2
206
208
  specification_version: 4
207
209
  summary: Client for Recombee recommendation API
208
210
  test_files: []