algolia 3.21.1 → 3.22.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: 5a5e39d35817a8422093311ebd458f87bba18346808a138a8b45ca3ca86917c1
4
- data.tar.gz: 5407640c35307096179c4b3ff1c5875bd8d62b19d2d64fb51ae250fd6be8046c
3
+ metadata.gz: 1254547116cba77dde8f18bcb16d3b690ae04fcc6a35e418a0e9c0c0cc4a44ec
4
+ data.tar.gz: ed5ee1f58057bbf5942661457428ec598b87fed322037b9742d5807ace7e7b0c
5
5
  SHA512:
6
- metadata.gz: 3a107416244b5e4cac43ad07c3f6605f31ceab1c8bec776e373ad760a189cd5eb463708b6500b76cb70d71d4bcde74af46f2a0d0bf244231784d2c0c5b01f351
7
- data.tar.gz: 11e88b59830fd81a37d7b8a2e0f832b85824c792e5539e6877927c66eea86184e87f3351c3ca09bdd3bb5d90acbda29f7e5c9edb8c0211610b2780c69a4ef87b
6
+ metadata.gz: 18ea56bd2e7990cce08dfa90816e295bccb826b3696095d433e79105a129dce71d5a7535a1bc040eb98378e06f73985912e8b5695b91d2d060c061716fd0422e
7
+ data.tar.gz: 0e294c87fa29ba5c6728dd73443587f8a8b2bbbf42fbe14f83c81ae7809cf152c8abbe90a1fb3b824cfbab8c89475201f1e7465a5e71996642a143e9b17a23bb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [3.22.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.21.1...3.22.0)
2
+
3
+ - [a7a3c5fc95](https://github.com/algolia/api-clients-automation/commit/a7a3c5fc95) feat(specs): document runMetadata parameter ([#5087](https://github.com/algolia/api-clients-automation/pull/5087)) by [@DevinCodes](https://github.com/DevinCodes/)
4
+ - [f3717177c5](https://github.com/algolia/api-clients-automation/commit/f3717177c5) fix(specs): `averageClickPosition` return type ([#5089](https://github.com/algolia/api-clients-automation/pull/5089)) by [@shortcuts](https://github.com/shortcuts/)
5
+
1
6
  ## [3.21.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.21.0...3.21.1)
2
7
 
3
8
  - [4c9416a9fe](https://github.com/algolia/api-clients-automation/commit/4c9416a9fe) fix(specs): update sourceRun docs ([#5057](https://github.com/algolia/api-clients-automation/pull/5057)) by [@DevinCodes](https://github.com/DevinCodes/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.21.1)
4
+ algolia (3.22.0)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -2322,9 +2322,10 @@ module Algolia
2322
2322
  # - deleteIndex
2323
2323
  # - editSettings
2324
2324
  # @param task_id [String] Unique identifier of a task. (required)
2325
+ # @param run_task_payload [RunTaskPayload]
2325
2326
  # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2326
2327
  # @return [Http::Response] the response
2327
- def run_task_with_http_info(task_id, request_options = {})
2328
+ def run_task_with_http_info(task_id, run_task_payload = nil, request_options = {})
2328
2329
  # verify the required parameter 'task_id' is set
2329
2330
  if @api_client.config.client_side_validation && task_id.nil?
2330
2331
  raise ArgumentError, "Parameter `task_id` is required when calling `run_task`."
@@ -2336,7 +2337,7 @@ module Algolia
2336
2337
  header_params = {}
2337
2338
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2338
2339
 
2339
- post_body = request_options[:debug_body]
2340
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(run_task_payload)
2340
2341
 
2341
2342
  new_options = request_options.merge(
2342
2343
  :operation => :"IngestionClient.run_task",
@@ -2356,10 +2357,11 @@ module Algolia
2356
2357
  # - deleteIndex
2357
2358
  # - editSettings
2358
2359
  # @param task_id [String] Unique identifier of a task. (required)
2360
+ # @param run_task_payload [RunTaskPayload]
2359
2361
  # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2360
2362
  # @return [RunResponse]
2361
- def run_task(task_id, request_options = {})
2362
- response = run_task_with_http_info(task_id, request_options)
2363
+ def run_task(task_id, run_task_payload = nil, request_options = {})
2364
+ response = run_task_with_http_info(task_id, run_task_payload, request_options)
2363
2365
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::RunResponse")
2364
2366
  end
2365
2367
 
@@ -2371,9 +2373,10 @@ module Algolia
2371
2373
  # - editSettings
2372
2374
  # THIS OPERATION IS DEPRECATED
2373
2375
  # @param task_id [String] Unique identifier of a task. (required)
2376
+ # @param run_task_payload [RunTaskPayload]
2374
2377
  # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2375
2378
  # @return [Http::Response] the response
2376
- def run_task_v1_with_http_info(task_id, request_options = {})
2379
+ def run_task_v1_with_http_info(task_id, run_task_payload = nil, request_options = {})
2377
2380
  # verify the required parameter 'task_id' is set
2378
2381
  if @api_client.config.client_side_validation && task_id.nil?
2379
2382
  raise ArgumentError, "Parameter `task_id` is required when calling `run_task_v1`."
@@ -2385,7 +2388,7 @@ module Algolia
2385
2388
  header_params = {}
2386
2389
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2387
2390
 
2388
- post_body = request_options[:debug_body]
2391
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(run_task_payload)
2389
2392
 
2390
2393
  new_options = request_options.merge(
2391
2394
  :operation => :"IngestionClient.run_task_v1",
@@ -2405,10 +2408,11 @@ module Algolia
2405
2408
  # - deleteIndex
2406
2409
  # - editSettings
2407
2410
  # @param task_id [String] Unique identifier of a task. (required)
2411
+ # @param run_task_payload [RunTaskPayload]
2408
2412
  # @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2409
2413
  # @return [RunResponse]
2410
- def run_task_v1(task_id, request_options = {})
2411
- response = run_task_v1_with_http_info(task_id, request_options)
2414
+ def run_task_v1(task_id, run_task_payload = nil, request_options = {})
2415
+ response = run_task_v1_with_http_info(task_id, run_task_payload, request_options)
2412
2416
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::RunResponse")
2413
2417
  end
2414
2418
 
@@ -98,7 +98,7 @@ module Algolia
98
98
  {
99
99
  :add_to_cart_count => :"Integer",
100
100
  :add_to_cart_rate => :"Float",
101
- :average_click_position => :"Integer",
101
+ :average_click_position => :"Float",
102
102
  :click_count => :"Integer",
103
103
  :click_through_rate => :"Float",
104
104
  :conversion_count => :"Integer",
@@ -19,13 +19,17 @@ module Algolia
19
19
 
20
20
  attr_accessor :entity_type
21
21
 
22
+ # Additional information that will be passed to the created runs.
23
+ attr_accessor :run_metadata
24
+
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
25
28
  :index_to_include => :indexToInclude,
26
29
  :index_to_exclude => :indexToExclude,
27
30
  :entity_ids => :entityIDs,
28
- :entity_type => :entityType
31
+ :entity_type => :entityType,
32
+ :run_metadata => :runMetadata
29
33
  }
30
34
  end
31
35
 
@@ -35,7 +39,8 @@ module Algolia
35
39
  :index_to_include => :"Array<String>",
36
40
  :index_to_exclude => :"Array<String>",
37
41
  :entity_ids => :"Array<String>",
38
- :entity_type => :"EntityType"
42
+ :entity_type => :"EntityType",
43
+ :run_metadata => :"Hash<String, Object>"
39
44
  }
40
45
  end
41
46
 
@@ -90,6 +95,12 @@ module Algolia
90
95
  if attributes.key?(:entity_type)
91
96
  self.entity_type = attributes[:entity_type]
92
97
  end
98
+
99
+ if attributes.key?(:run_metadata)
100
+ if (value = attributes[:run_metadata]).is_a?(Hash)
101
+ self.run_metadata = value
102
+ end
103
+ end
93
104
  end
94
105
 
95
106
  # Checks equality by comparing each attribute.
@@ -100,7 +111,8 @@ module Algolia
100
111
  index_to_include == other.index_to_include &&
101
112
  index_to_exclude == other.index_to_exclude &&
102
113
  entity_ids == other.entity_ids &&
103
- entity_type == other.entity_type
114
+ entity_type == other.entity_type &&
115
+ run_metadata == other.run_metadata
104
116
  end
105
117
 
106
118
  # @see the `==` method
@@ -112,7 +124,7 @@ module Algolia
112
124
  # Calculates hash code according to all attributes.
113
125
  # @return [Integer] Hash code
114
126
  def hash
115
- [index_to_include, index_to_exclude, entity_ids, entity_type].hash
127
+ [index_to_include, index_to_exclude, entity_ids, entity_type, run_metadata].hash
116
128
  end
117
129
 
118
130
  # Builds the object from hash
@@ -0,0 +1,211 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module Ingestion
10
+ class RunTaskPayload
11
+ # Additional information that will be passed to the created run.
12
+ attr_accessor :run_metadata
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :run_metadata => :runMetadata
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.types_mapping
23
+ {
24
+ :run_metadata => :"Hash<String, Object>"
25
+ }
26
+ end
27
+
28
+ # List of attributes with nullable: true
29
+ def self.openapi_nullable
30
+ Set.new(
31
+ []
32
+ )
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ raise(
40
+ ArgumentError,
41
+ "The input argument (attributes) must be a hash in `Algolia::RunTaskPayload` initialize method"
42
+ )
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ raise(
49
+ ArgumentError,
50
+ "`#{k}` is not a valid attribute in `Algolia::RunTaskPayload`. Please check the name to make sure it's valid. List of attributes: " +
51
+ self.class.attribute_map.keys.inspect
52
+ )
53
+ end
54
+
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:run_metadata)
59
+ if (value = attributes[:run_metadata]).is_a?(Hash)
60
+ self.run_metadata = value
61
+ end
62
+ end
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(other)
68
+ return true if self.equal?(other)
69
+ self.class == other.class &&
70
+ run_metadata == other.run_metadata
71
+ end
72
+
73
+ # @see the `==` method
74
+ # @param [Object] Object to be compared
75
+ def eql?(other)
76
+ self == other
77
+ end
78
+
79
+ # Calculates hash code according to all attributes.
80
+ # @return [Integer] Hash code
81
+ def hash
82
+ [run_metadata].hash
83
+ end
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def self.build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+ attributes = attributes.transform_keys(&:to_sym)
91
+ transformed_hash = {}
92
+ types_mapping.each_pair do |key, type|
93
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
94
+ transformed_hash[key.to_sym] = nil
95
+ elsif type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[attribute_map[key]].is_a?(Array)
99
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
100
+ _deserialize(::Regexp.last_match(1), v)
101
+ }
102
+ end
103
+ elsif !attributes[attribute_map[key]].nil?
104
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
105
+ end
106
+ end
107
+
108
+ new(transformed_hash)
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def self._deserialize(type, value)
116
+ case type.to_sym
117
+ when :Time
118
+ Time.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :Boolean
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+
134
+ when :Object
135
+ # generic object (usually a Hash), return directly
136
+ value
137
+ when /\AArray<(?<inner_type>.+)>\z/
138
+ inner_type = Regexp.last_match[:inner_type]
139
+ value.map { |v| _deserialize(inner_type, v) }
140
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
141
+ k_type = Regexp.last_match[:k_type]
142
+ v_type = Regexp.last_match[:v_type]
143
+ {}.tap do |hash|
144
+ value.each do |k, v|
145
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
146
+ end
147
+ end
148
+ # model
149
+ else
150
+ # models (e.g. Pet) or oneOf
151
+ klass = Algolia::Ingestion.const_get(type)
152
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
153
+ .build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ def to_json(*_args)
170
+ to_hash.to_json
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to?(:to_hash)
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+
210
+ end
211
+ end
@@ -3,5 +3,5 @@
3
3
  # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
4
 
5
5
  module Algolia
6
- VERSION = "3.21.1"
6
+ VERSION = "3.22.0"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.21.1
4
+ version: 3.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
@@ -359,6 +359,7 @@ files:
359
359
  - lib/algolia/models/ingestion/run_source_payload.rb
360
360
  - lib/algolia/models/ingestion/run_source_response.rb
361
361
  - lib/algolia/models/ingestion/run_status.rb
362
+ - lib/algolia/models/ingestion/run_task_payload.rb
362
363
  - lib/algolia/models/ingestion/run_type.rb
363
364
  - lib/algolia/models/ingestion/schedule_trigger.rb
364
365
  - lib/algolia/models/ingestion/schedule_trigger_input.rb