algolia 3.5.3 → 3.6.0

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
  SHA256:
3
- metadata.gz: 579d49fc4b1ff43b579a660ee660f29ede78c357d8be8c6e114815f3c2fbba0d
4
- data.tar.gz: 9b7cde4698aea7d6def55213e7f36ff32d8db3c57451c3abe3478ec3ab17a463
3
+ metadata.gz: 2b69b808ce96019740c30c69c06a65099eaab82d19970c84d232e04d14e817ce
4
+ data.tar.gz: 91215450649fb00e5cd29de2d8ac38b2c3a1fe64df5598cddd12091ce77263c8
5
5
  SHA512:
6
- metadata.gz: c438ef675f78aac07488a8e2ddd20dab0f0528d3bc3f7a9a95206a9ae2e66ad17935c42f29a4b431747fbf6071343090248535aecc3c3f998f83c3c92d77f8f9
7
- data.tar.gz: c975b0cfe14004c921688ebe712750a5c8fe4806d7b26df2e82b54082ec411ab555ece86451414c88a67c5ad761ec63c92a28da776b745d97c15e13f20b4b1c4
6
+ metadata.gz: 97c9bcc12f6fa8f7860fbb2daecb2711ed67553f2050d0c770bf7ee5d3f138160715d32a853197f922cddb8258554ced95f407571f78fb2431845279ae5a518a
7
+ data.tar.gz: c9430142c056ff019be74f2f73b67617825681dee9454d18f9e3c51df485d0a31f07f7f5dc21e541182ff22a18c102856a9a02c757f02c7b5f9268107ce63df0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [3.6.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.5.4...3.6.0)
2
+
3
+ - [46ba4b50a](https://github.com/algolia/api-clients-automation/commit/46ba4b50a) fix(ruby): provide default ttl ([#4027](https://github.com/algolia/api-clients-automation/pull/4027)) by [@millotp](https://github.com/millotp/)
4
+ - [312d33731](https://github.com/algolia/api-clients-automation/commit/312d33731) feat(specs): add missing message attribute to GetObjectsResponse [skip-bc] ([#4029](https://github.com/algolia/api-clients-automation/pull/4029)) by [@kombucha](https://github.com/kombucha/)
5
+ - [32f9f4d16](https://github.com/algolia/api-clients-automation/commit/32f9f4d16) fix(specs): support synonyms type in camel case [skip-bc] ([#4031](https://github.com/algolia/api-clients-automation/pull/4031)) by [@shortcuts](https://github.com/shortcuts/)
6
+ - [7f5fe6b68](https://github.com/algolia/api-clients-automation/commit/7f5fe6b68) feat(clients): expose waitForTasks to batch helpers [skip-bc] ([#4030](https://github.com/algolia/api-clients-automation/pull/4030)) by [@shortcuts](https://github.com/shortcuts/)
7
+
8
+ ## [3.5.4](https://github.com/algolia/algoliasearch-client-ruby/compare/3.5.3...3.5.4)
9
+
10
+ - [1f36e8f93](https://github.com/algolia/api-clients-automation/commit/1f36e8f93) fix(specs): results in getObjects is required ([#4024](https://github.com/algolia/api-clients-automation/pull/4024)) by [@shortcuts](https://github.com/shortcuts/)
11
+
1
12
  ## [3.5.3](https://github.com/algolia/algoliasearch-client-ruby/compare/3.5.2...3.5.3)
2
13
 
3
14
  - [fe2c8440e](https://github.com/algolia/api-clients-automation/commit/fe2c8440e) docs(analytics): constrain pagination only to limit query parameter ([#4012](https://github.com/algolia/api-clients-automation/pull/4012)) by [@febeck](https://github.com/febeck/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.5.3)
4
+ algolia (3.6.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)
@@ -3333,16 +3333,17 @@ module Algolia
3333
3333
  #
3334
3334
  # @param index_name [String]: The `index_name` to save `objects` in.
3335
3335
  # @param objects [Array]: The array of `objects` to store in the given Algolia `indexName`.
3336
+ # @param wait_for_tasks [Boolean]: Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
3336
3337
  # @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)
3337
3338
  #
3338
3339
  # @return [BatchResponse]
3339
3340
  #
3340
- def save_objects(index_name, objects, request_options = {})
3341
+ def save_objects(index_name, objects, wait_for_tasks = false, request_options = {})
3341
3342
  chunked_batch(
3342
3343
  index_name,
3343
3344
  objects,
3344
3345
  Search::Action::ADD_OBJECT,
3345
- false,
3346
+ wait_for_tasks,
3346
3347
  1000,
3347
3348
  request_options
3348
3349
  )
@@ -3352,16 +3353,17 @@ module Algolia
3352
3353
  #
3353
3354
  # @param index_name [String]: The `index_name` to delete `object_ids` from.
3354
3355
  # @param object_ids [Array]: The object_ids to delete.
3356
+ # @param wait_for_tasks [Boolean]: Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
3355
3357
  # @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)
3356
3358
  #
3357
3359
  # @return [BatchResponse]
3358
3360
  #
3359
- def delete_objects(index_name, object_ids, request_options = {})
3361
+ def delete_objects(index_name, object_ids, wait_for_tasks = false, request_options = {})
3360
3362
  chunked_batch(
3361
3363
  index_name,
3362
3364
  object_ids.map { |id| {"objectID" => id} },
3363
3365
  Search::Action::DELETE_OBJECT,
3364
- false,
3366
+ wait_for_tasks,
3365
3367
  1000,
3366
3368
  request_options
3367
3369
  )
@@ -3372,16 +3374,17 @@ module Algolia
3372
3374
  # @param index_name [String]: The `index_name` to delete `object_ids` from.
3373
3375
  # @param objects [Array]: The objects to partially update.
3374
3376
  # @param create_if_not_exists [Boolean]: To be provided if non-existing objects are passed, otherwise, the call will fail.
3377
+ # @param wait_for_tasks [Boolean] Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
3375
3378
  # @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)
3376
3379
  #
3377
3380
  # @return [BatchResponse]
3378
3381
  #
3379
- def partial_update_objects(index_name, objects, create_if_not_exists, request_options = {})
3382
+ def partial_update_objects(index_name, objects, create_if_not_exists, wait_for_tasks = false, request_options = {})
3380
3383
  chunked_batch(
3381
3384
  index_name,
3382
3385
  objects,
3383
3386
  create_if_not_exists ? Search::Action::PARTIAL_UPDATE_OBJECT : Search::Action::PARTIAL_UPDATE_OBJECT_NO_CREATE,
3384
- false,
3387
+ wait_for_tasks,
3385
3388
  1000,
3386
3389
  request_options
3387
3390
  )
@@ -0,0 +1,5 @@
1
+ module Algolia
2
+ module Defaults
3
+ TTL = 300
4
+ end
5
+ end
@@ -6,12 +6,16 @@ require "time"
6
6
  module Algolia
7
7
  module Search
8
8
  class GetObjectsResponse
9
+ # An optional status message.
10
+ attr_accessor :message
11
+
9
12
  # Retrieved records.
10
13
  attr_accessor :results
11
14
 
12
15
  # Attribute mapping from ruby-style variable name to JSON key.
13
16
  def self.attribute_map
14
17
  {
18
+ :message => :message,
15
19
  :results => :results
16
20
  }
17
21
  end
@@ -24,6 +28,7 @@ module Algolia
24
28
  # Attribute type mapping.
25
29
  def self.types_mapping
26
30
  {
31
+ :message => :"String",
27
32
  :results => :"Array<Object>"
28
33
  }
29
34
  end
@@ -58,10 +63,16 @@ module Algolia
58
63
  h[k.to_sym] = v
59
64
  }
60
65
 
66
+ if attributes.key?(:message)
67
+ self.message = attributes[:message]
68
+ end
69
+
61
70
  if attributes.key?(:results)
62
71
  if (value = attributes[:results]).is_a?(Array)
63
72
  self.results = value
64
73
  end
74
+ else
75
+ self.results = nil
65
76
  end
66
77
  end
67
78
 
@@ -70,6 +81,7 @@ module Algolia
70
81
  def ==(other)
71
82
  return true if self.equal?(other)
72
83
  self.class == other.class &&
84
+ message == other.message &&
73
85
  results == other.results
74
86
  end
75
87
 
@@ -82,7 +94,7 @@ module Algolia
82
94
  # Calculates hash code according to all attributes.
83
95
  # @return [Integer] Hash code
84
96
  def hash
85
- [results].hash
97
+ [message, results].hash
86
98
  end
87
99
 
88
100
  # Builds the object from hash
@@ -11,9 +11,21 @@ module Algolia
11
11
  ALTCORRECTION1 = "altcorrection1".freeze
12
12
  ALTCORRECTION2 = "altcorrection2".freeze
13
13
  PLACEHOLDER = "placeholder".freeze
14
+ ONE_WAY_SYNONYM = "oneWaySynonym".freeze
15
+ ALT_CORRECTION1 = "altCorrection1".freeze
16
+ ALT_CORRECTION2 = "altCorrection2".freeze
14
17
 
15
18
  def self.all_vars
16
- @all_vars ||= [SYNONYM, ONEWAYSYNONYM, ALTCORRECTION1, ALTCORRECTION2, PLACEHOLDER].freeze
19
+ @all_vars ||= [
20
+ SYNONYM,
21
+ ONEWAYSYNONYM,
22
+ ALTCORRECTION1,
23
+ ALTCORRECTION2,
24
+ PLACEHOLDER,
25
+ ONE_WAY_SYNONYM,
26
+ ALT_CORRECTION1,
27
+ ALT_CORRECTION2
28
+ ].freeze
17
29
  end
18
30
 
19
31
  # Builds the enum from string
@@ -1,5 +1,5 @@
1
1
  # 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.
2
2
 
3
3
  module Algolia
4
- VERSION = "3.5.3".freeze
4
+ VERSION = "3.6.0".freeze
5
5
  end
data/lib/algolia.rb CHANGED
@@ -5,6 +5,7 @@
5
5
  # Common files
6
6
  require "algolia/api_client"
7
7
  require "algolia/api_error"
8
+ require "algolia/defaults"
8
9
  require "algolia/error"
9
10
  require "algolia/version"
10
11
  require "algolia/configuration"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.3
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-21 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -143,6 +143,7 @@ files:
143
143
  - lib/algolia/api_client.rb
144
144
  - lib/algolia/api_error.rb
145
145
  - lib/algolia/configuration.rb
146
+ - lib/algolia/defaults.rb
146
147
  - lib/algolia/error.rb
147
148
  - lib/algolia/logger_helper.rb
148
149
  - lib/algolia/models/abtesting/ab_test.rb