algolia 3.8.2 → 3.10.2

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: bbf3a0681721633040ecb0140b17558a30960ea7269bc92b811ee7e3061b0c01
4
- data.tar.gz: a6192d821fed7c69849d2c0464235d3c83bf47377ac94d270a459e96849033d8
3
+ metadata.gz: cd4fd82006d6c1d476f2a5990f20e71863de4daab0b1d34e8ed60f73db4863e8
4
+ data.tar.gz: f35d07b8971f883cefde61736b1e5e083ab100668b6cc52c721767ed70c8033a
5
5
  SHA512:
6
- metadata.gz: 7bfcf91d318232cffaa4af72e6979cb0fd561d4c299c25e497a17c54809749249c787d4741803d43435dbb7362ea16cfd45c8a5c240ae981d9f0e8607ed784cf
7
- data.tar.gz: 29b4a760a9a5ae9d6f409cada459e5db1e69e219590aef04ad9ca1e0069578660cb841ee6980c41b1ad086c208f0b6a79f82c07e206dad6e307af02a3028298f
6
+ metadata.gz: 31d4c9f1d4cc7c4dc5b837f023b20dd1d6fbbb34397dd2bdb58519630af04e3189350d400b68fdca4b415d963615038ee61804f6093a45b7b93c5ef425eaaec4
7
+ data.tar.gz: 3294d75374a89dadde273ddaffb85c97509134a416eb145a9cdd054792ff94df08e0f393b2c9db15f419346208ca5b338ea3c75d341b8659bda2b0aaf66abbb8
@@ -1,7 +1,7 @@
1
1
  name: Do not edit files in this repository
2
2
 
3
3
  on:
4
- pull_request:
4
+ pull_request_target:
5
5
  types:
6
6
  - opened
7
7
  - synchronize
@@ -21,9 +21,9 @@ jobs:
21
21
  - name: Install Ruby
22
22
  uses: ruby/setup-ruby@v1
23
23
  with:
24
- ruby-version: 3.2.2
24
+ ruby-version: 3.3.6
25
25
  bundler-cache: true
26
26
 
27
- - uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31
27
+ - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32
28
28
  with:
29
29
  await-release: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ ## [3.10.2](https://github.com/algolia/algoliasearch-client-ruby/compare/3.10.1...3.10.2)
2
+
3
+ - [0481473fe0](https://github.com/algolia/api-clients-automation/commit/0481473fe0) chore: trigger auto close pr ([#4250](https://github.com/algolia/api-clients-automation/pull/4250)) by [@shortcuts](https://github.com/shortcuts/)
4
+ - [2856fa34a3](https://github.com/algolia/api-clients-automation/commit/2856fa34a3) fix(ruby): Set default hits_per_page for SearchClient#browse_objects using accessor ([#4253](https://github.com/algolia/api-clients-automation/pull/4253)) by [@dtyoung](https://github.com/dtyoung/)
5
+ - [bc8939f542](https://github.com/algolia/api-clients-automation/commit/bc8939f542) fix(clients): support dict in helpers ([#4254](https://github.com/algolia/api-clients-automation/pull/4254)) by [@shortcuts](https://github.com/shortcuts/)
6
+ - [679a8cdb60](https://github.com/algolia/api-clients-automation/commit/679a8cdb60) fix(specs): endpoint level timeout for ingestion ([#4251](https://github.com/algolia/api-clients-automation/pull/4251)) by [@shortcuts](https://github.com/shortcuts/)
7
+
8
+ ## [3.10.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.10.0...3.10.1)
9
+
10
+ - [6fb57f9ba](https://github.com/algolia/api-clients-automation/commit/6fb57f9ba) fix(clients): lock version ([#4228](https://github.com/algolia/api-clients-automation/pull/4228)) by [@millotp](https://github.com/millotp/)
11
+ - [3f5ceb540](https://github.com/algolia/api-clients-automation/commit/3f5ceb540) fix(ruby): handle unknown attributes in index_exists ([#4231](https://github.com/algolia/api-clients-automation/pull/4231)) by [@millotp](https://github.com/millotp/)
12
+ - [cd59f445e](https://github.com/algolia/api-clients-automation/commit/cd59f445e) fix(specs): enable watcher for push ([#4229](https://github.com/algolia/api-clients-automation/pull/4229)) by [@shortcuts](https://github.com/shortcuts/)
13
+ - [baf7d6f4d](https://github.com/algolia/api-clients-automation/commit/baf7d6f4d) fix(specs): add `ignoreConjugations` to `AlternativesAsExact` ([#4230](https://github.com/algolia/api-clients-automation/pull/4230)) by [@shortcuts](https://github.com/shortcuts/)
14
+
15
+ ## [3.10.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.9.0...3.10.0)
16
+
17
+ - [866d859f8](https://github.com/algolia/api-clients-automation/commit/866d859f8) fix(specs): different summaries for saveObject/addOrUpdate methods ([#4223](https://github.com/algolia/api-clients-automation/pull/4223)) by [@kai687](https://github.com/kai687/)
18
+ - [baf16c689](https://github.com/algolia/api-clients-automation/commit/baf16c689) feat(specs): add `watch` to `pushTask` ingestion ([#4224](https://github.com/algolia/api-clients-automation/pull/4224)) by [@shortcuts](https://github.com/shortcuts/)
19
+
20
+ ## [3.9.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.8.2...3.9.0)
21
+
22
+ - [068fdacb5](https://github.com/algolia/api-clients-automation/commit/068fdacb5) feat(specs): add info and link about indexing rate limits ([#4136](https://github.com/algolia/api-clients-automation/pull/4136)) by [@kai687](https://github.com/kai687/)
23
+ - [9e0235697](https://github.com/algolia/api-clients-automation/commit/9e0235697) fix(specs): `nb_api_calls` in `getLogs` response is optional ([#4142](https://github.com/algolia/api-clients-automation/pull/4142)) by [@shortcuts](https://github.com/shortcuts/)
24
+ - [56fd73fb6](https://github.com/algolia/api-clients-automation/commit/56fd73fb6) chore(deps): dependencies 2024-11-25 ([#4145](https://github.com/algolia/api-clients-automation/pull/4145)) by [@algolia-bot](https://github.com/algolia-bot/)
25
+ - [b728c5f25](https://github.com/algolia/api-clients-automation/commit/b728c5f25) fix(specs): `consequence` is required when saving rules ([#4146](https://github.com/algolia/api-clients-automation/pull/4146)) by [@shortcuts](https://github.com/shortcuts/)
26
+ - [afd94fac8](https://github.com/algolia/api-clients-automation/commit/afd94fac8) fix(specs): `saveRule` response type ([#4170](https://github.com/algolia/api-clients-automation/pull/4170)) by [@shortcuts](https://github.com/shortcuts/)
27
+ - [2325c61b8](https://github.com/algolia/api-clients-automation/commit/2325c61b8) feat(clients): allow batch size on objects helper ([#4172](https://github.com/algolia/api-clients-automation/pull/4172)) by [@shortcuts](https://github.com/shortcuts/)
28
+ - [aae74cb38](https://github.com/algolia/api-clients-automation/commit/aae74cb38) fix(specs): remove SFCC source type ([#4190](https://github.com/algolia/api-clients-automation/pull/4190)) by [@millotp](https://github.com/millotp/)
29
+ - [b4809e789](https://github.com/algolia/api-clients-automation/commit/b4809e789) fix(ruby): expose static helper ([#4191](https://github.com/algolia/api-clients-automation/pull/4191)) by [@millotp](https://github.com/millotp/)
30
+ - [254052857](https://github.com/algolia/api-clients-automation/commit/254052857) fix(specs): add sourceType to listTasks ([#4193](https://github.com/algolia/api-clients-automation/pull/4193)) by [@millotp](https://github.com/millotp/)
31
+ - [106d64313](https://github.com/algolia/api-clients-automation/commit/106d64313) feat(generators): allow per-spec timeouts ([#4173](https://github.com/algolia/api-clients-automation/pull/4173)) by [@shortcuts](https://github.com/shortcuts/)
32
+ - [9e1e60f9e](https://github.com/algolia/api-clients-automation/commit/9e1e60f9e) chore(deps): dependencies 2024-12-09 ([#4197](https://github.com/algolia/api-clients-automation/pull/4197)) by [@algolia-bot](https://github.com/algolia-bot/)
33
+
1
34
  ## [3.8.2](https://github.com/algolia/algoliasearch-client-ruby/compare/3.8.1...3.8.2)
2
35
 
3
36
  - [f97e44ce0](https://github.com/algolia/api-clients-automation/commit/f97e44ce0) fix(cts): add tests for HTML error ([#4097](https://github.com/algolia/api-clients-automation/pull/4097)) by [@millotp](https://github.com/millotp/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.8.2)
4
+ algolia (3.10.2)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -12,21 +12,23 @@ GEM
12
12
  specs:
13
13
  base64 (0.2.0)
14
14
  connection_pool (2.4.1)
15
- faraday (2.11.0)
16
- faraday-net_http (>= 2.0, < 3.4)
15
+ faraday (2.12.2)
16
+ faraday-net_http (>= 2.0, < 3.5)
17
+ json
17
18
  logger
18
- faraday-net_http (3.3.0)
19
- net-http
20
- faraday-net_http_persistent (2.1.0)
19
+ faraday-net_http (3.4.0)
20
+ net-http (>= 0.5.0)
21
+ faraday-net_http_persistent (2.3.0)
21
22
  faraday (~> 2.5)
22
- net-http-persistent (~> 4.0)
23
- logger (1.6.1)
24
- net-http (0.4.1)
23
+ net-http-persistent (>= 4.0.4, < 5)
24
+ json (2.9.0)
25
+ logger (1.6.2)
26
+ net-http (0.6.0)
25
27
  uri
26
- net-http-persistent (4.0.4)
28
+ net-http-persistent (4.0.5)
27
29
  connection_pool (~> 2.2)
28
30
  rake (13.2.1)
29
- uri (0.13.1)
31
+ uri (1.0.2)
30
32
 
31
33
  PLATFORMS
32
34
  aarch64-linux
@@ -34,7 +36,7 @@ PLATFORMS
34
36
 
35
37
  DEPENDENCIES
36
38
  algolia!
37
- bundler
39
+ bundler (>= 2.4.10)
38
40
  rake
39
41
 
40
42
  BUNDLED WITH
data/algolia.gemspec CHANGED
@@ -30,6 +30,6 @@ Gem::Specification.new do |s|
30
30
 
31
31
  s.add_dependency 'net-http-persistent'
32
32
 
33
- s.add_development_dependency 'bundler'
33
+ s.add_development_dependency 'bundler', '>= 2.4.10'
34
34
  s.add_development_dependency 'rake'
35
35
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 2000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 5000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 30000
34
+ end
35
+
24
36
  if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
25
37
  raise "`region` must be one of the following: #{regions.join(", ")}"
26
38
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 2000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 5000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 30000
34
+ end
35
+
24
36
  if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
25
37
  raise "`region` must be one of the following: #{regions.join(", ")}"
26
38
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 25000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 25000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 25000
34
+ end
35
+
24
36
  if region.nil? || !region.is_a?(String) || !regions.include?(region)
25
37
  raise "`region` is required and must be one of the following: #{regions.join(", ")}"
26
38
  end
@@ -1847,6 +1859,7 @@ module Algolia
1847
1859
  # @param action [Array<ActionType>] Actions for filtering the list of tasks.
1848
1860
  # @param enabled [Boolean] Whether to filter the list of tasks by the `enabled` status.
1849
1861
  # @param source_id [Array<String>] Source IDs for filtering the list of tasks.
1862
+ # @param source_type [Array<SourceType>] Filters the tasks with the specified source type.
1850
1863
  # @param destination_id [Array<String>] Destination IDs for filtering the list of tasks.
1851
1864
  # @param trigger_type [Array<TriggerType>] Type of task trigger for filtering the list of tasks.
1852
1865
  # @param sort [TaskSortKeys] Property by which to sort the list of tasks. (default to 'createdAt')
@@ -1859,6 +1872,7 @@ module Algolia
1859
1872
  action = nil,
1860
1873
  enabled = nil,
1861
1874
  source_id = nil,
1875
+ source_type = nil,
1862
1876
  destination_id = nil,
1863
1877
  trigger_type = nil,
1864
1878
  sort = nil,
@@ -1872,6 +1886,7 @@ module Algolia
1872
1886
  query_params[:action] = @api_client.build_collection_param(action, :csv) unless action.nil?
1873
1887
  query_params[:enabled] = enabled unless enabled.nil?
1874
1888
  query_params[:sourceID] = @api_client.build_collection_param(source_id, :csv) unless source_id.nil?
1889
+ query_params[:sourceType] = @api_client.build_collection_param(source_type, :csv) unless source_type.nil?
1875
1890
  unless destination_id.nil?
1876
1891
  query_params[:destinationID] = @api_client.build_collection_param(destination_id, :csv)
1877
1892
  end
@@ -1907,6 +1922,7 @@ module Algolia
1907
1922
  # @param action [Array<ActionType>] Actions for filtering the list of tasks.
1908
1923
  # @param enabled [Boolean] Whether to filter the list of tasks by the `enabled` status.
1909
1924
  # @param source_id [Array<String>] Source IDs for filtering the list of tasks.
1925
+ # @param source_type [Array<SourceType>] Filters the tasks with the specified source type.
1910
1926
  # @param destination_id [Array<String>] Destination IDs for filtering the list of tasks.
1911
1927
  # @param trigger_type [Array<TriggerType>] Type of task trigger for filtering the list of tasks.
1912
1928
  # @param sort [TaskSortKeys] Property by which to sort the list of tasks. (default to 'createdAt')
@@ -1919,6 +1935,7 @@ module Algolia
1919
1935
  action = nil,
1920
1936
  enabled = nil,
1921
1937
  source_id = nil,
1938
+ source_type = nil,
1922
1939
  destination_id = nil,
1923
1940
  trigger_type = nil,
1924
1941
  sort = nil,
@@ -1931,6 +1948,7 @@ module Algolia
1931
1948
  action,
1932
1949
  enabled,
1933
1950
  source_id,
1951
+ source_type,
1934
1952
  destination_id,
1935
1953
  trigger_type,
1936
1954
  sort,
@@ -2114,9 +2132,10 @@ module Algolia
2114
2132
  # - editSettings
2115
2133
  # @param task_id [String] Unique identifier of a task. (required)
2116
2134
  # @param push_task_payload [PushTaskPayload] Request body of a Search API `batch` request that will be pushed in the Connectors pipeline. (required)
2135
+ # @param watch [Boolean] When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2117
2136
  # @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)
2118
2137
  # @return [Http::Response] the response
2119
- def push_task_with_http_info(task_id, push_task_payload, request_options = {})
2138
+ def push_task_with_http_info(task_id, push_task_payload, watch = nil, request_options = {})
2120
2139
  # verify the required parameter 'task_id' is set
2121
2140
  if @api_client.config.client_side_validation && task_id.nil?
2122
2141
  raise ArgumentError, "Parameter `task_id` is required when calling `push_task`."
@@ -2128,9 +2147,11 @@ module Algolia
2128
2147
 
2129
2148
  path = "/2/tasks/{taskID}/push".sub("{" + "taskID" + "}", Transport.encode_uri(task_id.to_s))
2130
2149
  query_params = {}
2150
+ query_params[:watch] = watch unless watch.nil?
2131
2151
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2132
2152
  header_params = {}
2133
2153
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2154
+ request_options[:timeout] ||= 180000
2134
2155
 
2135
2156
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(push_task_payload)
2136
2157
 
@@ -2153,11 +2174,12 @@ module Algolia
2153
2174
  # - editSettings
2154
2175
  # @param task_id [String] Unique identifier of a task. (required)
2155
2176
  # @param push_task_payload [PushTaskPayload] Request body of a Search API `batch` request that will be pushed in the Connectors pipeline. (required)
2177
+ # @param watch [Boolean] When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2156
2178
  # @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)
2157
- # @return [RunResponse]
2158
- def push_task(task_id, push_task_payload, request_options = {})
2159
- response = push_task_with_http_info(task_id, push_task_payload, request_options)
2160
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::RunResponse")
2179
+ # @return [WatchResponse]
2180
+ def push_task(task_id, push_task_payload, watch = nil, request_options = {})
2181
+ response = push_task_with_http_info(task_id, push_task_payload, watch, request_options)
2182
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
2161
2183
  end
2162
2184
 
2163
2185
  # Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
@@ -2614,6 +2636,7 @@ module Algolia
2614
2636
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2615
2637
  header_params = {}
2616
2638
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2639
+ request_options[:timeout] ||= 180000
2617
2640
 
2618
2641
  post_body = request_options[:debug_body]
2619
2642
 
@@ -2636,10 +2659,10 @@ module Algolia
2636
2659
  # - editSettings
2637
2660
  # @param source_id [String] Unique identifier of a source. (required)
2638
2661
  # @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)
2639
- # @return [SourceWatchResponse]
2662
+ # @return [WatchResponse]
2640
2663
  def trigger_docker_source_discover(source_id, request_options = {})
2641
2664
  response = trigger_docker_source_discover_with_http_info(source_id, request_options)
2642
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::SourceWatchResponse")
2665
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
2643
2666
  end
2644
2667
 
2645
2668
  # Try a transformation before creating it.
@@ -3092,6 +3115,7 @@ module Algolia
3092
3115
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
3093
3116
  header_params = {}
3094
3117
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3118
+ request_options[:timeout] ||= 180000
3095
3119
 
3096
3120
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_create)
3097
3121
 
@@ -3114,10 +3138,10 @@ module Algolia
3114
3138
  # - editSettings
3115
3139
  # @param source_create [SourceCreate]
3116
3140
  # @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)
3117
- # @return [SourceWatchResponse]
3141
+ # @return [WatchResponse]
3118
3142
  def validate_source(source_create = nil, request_options = {})
3119
3143
  response = validate_source_with_http_info(source_create, request_options)
3120
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::SourceWatchResponse")
3144
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
3121
3145
  end
3122
3146
 
3123
3147
  # Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
@@ -3145,6 +3169,7 @@ module Algolia
3145
3169
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
3146
3170
  header_params = {}
3147
3171
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3172
+ request_options[:timeout] ||= 180000
3148
3173
 
3149
3174
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_update)
3150
3175
 
@@ -3168,10 +3193,10 @@ module Algolia
3168
3193
  # @param source_id [String] Unique identifier of a source. (required)
3169
3194
  # @param source_update [SourceUpdate] (required)
3170
3195
  # @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)
3171
- # @return [SourceWatchResponse]
3196
+ # @return [WatchResponse]
3172
3197
  def validate_source_before_update(source_id, source_update, request_options = {})
3173
3198
  response = validate_source_before_update_with_http_info(source_id, source_update, request_options)
3174
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::SourceWatchResponse")
3199
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
3175
3200
  end
3176
3201
 
3177
3202
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 2000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 5000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 30000
34
+ end
35
+
24
36
  if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
25
37
  raise "`region` must be one of the following: #{regions.join(", ")}"
26
38
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 2000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 5000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 30000
34
+ end
35
+
24
36
  if region.nil? || !region.is_a?(String) || !regions.include?(region)
25
37
  raise "`region` is required and must be one of the following: #{regions.join(", ")}"
26
38
  end
@@ -21,6 +21,18 @@ module Algolia
21
21
  region = nil
22
22
  end
23
23
 
24
+ if opts.nil? || opts[:connect_timeout].nil?
25
+ opts[:connect_timeout] = 2000
26
+ end
27
+
28
+ if opts.nil? || opts[:read_timeout].nil?
29
+ opts[:read_timeout] = 5000
30
+ end
31
+
32
+ if opts.nil? || opts[:write_timeout].nil?
33
+ opts[:write_timeout] = 30000
34
+ end
35
+
24
36
  if region.nil? || !region.is_a?(String) || !regions.include?(region)
25
37
  raise "`region` is required and must be one of the following: #{regions.join(", ")}"
26
38
  end