Skip to content

Commit ef7f64f

Browse files
authored
Merge branch 'main' into feat/composition-schema-update
2 parents 3b67624 + 9002538 commit ef7f64f

File tree

20 files changed

+239
-35
lines changed

20 files changed

+239
-35
lines changed

clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,15 @@ export function createIngestionClient({
17301730
data: pushTaskPayload,
17311731
};
17321732

1733+
requestOptions = {
1734+
timeouts: {
1735+
connect: 180000,
1736+
read: 180000,
1737+
write: 180000,
1738+
...requestOptions?.timeouts,
1739+
},
1740+
};
1741+
17331742
return transporter.request(request, requestOptions);
17341743
},
17351744

@@ -2075,6 +2084,15 @@ export function createIngestionClient({
20752084
headers,
20762085
};
20772086

2087+
requestOptions = {
2088+
timeouts: {
2089+
connect: 180000,
2090+
read: 180000,
2091+
write: 180000,
2092+
...requestOptions?.timeouts,
2093+
},
2094+
};
2095+
20782096
return transporter.request(request, requestOptions);
20792097
},
20802098

@@ -2427,6 +2445,15 @@ export function createIngestionClient({
24272445
data: sourceCreate ? sourceCreate : {},
24282446
};
24292447

2448+
requestOptions = {
2449+
timeouts: {
2450+
connect: 180000,
2451+
read: 180000,
2452+
write: 180000,
2453+
...requestOptions?.timeouts,
2454+
},
2455+
};
2456+
24302457
return transporter.request(request, requestOptions);
24312458
},
24322459

@@ -2466,6 +2493,15 @@ export function createIngestionClient({
24662493
data: sourceUpdate,
24672494
};
24682495

2496+
requestOptions = {
2497+
timeouts: {
2498+
connect: 180000,
2499+
read: 180000,
2500+
write: 180000,
2501+
...requestOptions?.timeouts,
2502+
},
2503+
};
2504+
24692505
return transporter.request(request, requestOptions);
24702506
},
24712507
};

clients/algoliasearch-client-python/algoliasearch/http/request_options.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def merge(
5858
query_parameters: Optional[Dict[str, Any]] = None,
5959
headers: Optional[Dict[str, str]] = None,
6060
data: Optional[str] = None,
61+
timeouts: Dict[str, int] = {},
6162
user_request_options: Optional[Union[Self, Dict[str, Any]]] = None,
6263
) -> Self:
6364
"""
@@ -74,9 +75,9 @@ def merge(
7475
"headers": headers,
7576
"query_parameters": query_parameters,
7677
"timeouts": {
77-
"read": self._config.read_timeout,
78-
"write": self._config.write_timeout,
79-
"connect": self._config.connect_timeout,
78+
"read": timeouts.get("read", self._config.read_timeout),
79+
"write": timeouts.get("write", self._config.write_timeout),
80+
"connect": timeouts.get("connect", self._config.connect_timeout),
8081
},
8182
"data": data,
8283
}

clients/algoliasearch-client-python/algoliasearch/ingestion/client.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,11 @@ async def push_task_with_http_info(
35123512
request_options=self._request_options.merge(
35133513
query_parameters=_query_parameters,
35143514
data=dumps(body_serializer(_data)),
3515+
timeouts={
3516+
"read": 180000,
3517+
"write": 180000,
3518+
"connect": 180000,
3519+
},
35153520
user_request_options=request_options,
35163521
),
35173522
use_read_transporter=False,
@@ -4144,6 +4149,11 @@ async def trigger_docker_source_discover_with_http_info(
41444149
"{sourceID}", quote(str(source_id), safe="")
41454150
),
41464151
request_options=self._request_options.merge(
4152+
timeouts={
4153+
"read": 180000,
4154+
"write": 180000,
4155+
"connect": 180000,
4156+
},
41474157
user_request_options=request_options,
41484158
),
41494159
use_read_transporter=False,
@@ -4783,6 +4793,11 @@ async def validate_source_with_http_info(
47834793
path="/1/sources/validate",
47844794
request_options=self._request_options.merge(
47854795
data=dumps(body_serializer(_data)),
4796+
timeouts={
4797+
"read": 180000,
4798+
"write": 180000,
4799+
"connect": 180000,
4800+
},
47864801
user_request_options=request_options,
47874802
),
47884803
use_read_transporter=False,
@@ -4854,6 +4869,11 @@ async def validate_source_before_update_with_http_info(
48544869
),
48554870
request_options=self._request_options.merge(
48564871
data=dumps(body_serializer(_data)),
4872+
timeouts={
4873+
"read": 180000,
4874+
"write": 180000,
4875+
"connect": 180000,
4876+
},
48574877
user_request_options=request_options,
48584878
),
48594879
use_read_transporter=False,
@@ -8267,6 +8287,11 @@ def push_task_with_http_info(
82678287
request_options=self._request_options.merge(
82688288
query_parameters=_query_parameters,
82698289
data=dumps(body_serializer(_data)),
8290+
timeouts={
8291+
"read": 180000,
8292+
"write": 180000,
8293+
"connect": 180000,
8294+
},
82708295
user_request_options=request_options,
82718296
),
82728297
use_read_transporter=False,
@@ -8899,6 +8924,11 @@ def trigger_docker_source_discover_with_http_info(
88998924
"{sourceID}", quote(str(source_id), safe="")
89008925
),
89018926
request_options=self._request_options.merge(
8927+
timeouts={
8928+
"read": 180000,
8929+
"write": 180000,
8930+
"connect": 180000,
8931+
},
89028932
user_request_options=request_options,
89038933
),
89048934
use_read_transporter=False,
@@ -9534,6 +9564,11 @@ def validate_source_with_http_info(
95349564
path="/1/sources/validate",
95359565
request_options=self._request_options.merge(
95369566
data=dumps(body_serializer(_data)),
9567+
timeouts={
9568+
"read": 180000,
9569+
"write": 180000,
9570+
"connect": 180000,
9571+
},
95379572
user_request_options=request_options,
95389573
),
95399574
use_read_transporter=False,
@@ -9605,6 +9640,11 @@ def validate_source_before_update_with_http_info(
96059640
),
96069641
request_options=self._request_options.merge(
96079642
data=dumps(body_serializer(_data)),
9643+
timeouts={
9644+
"read": 180000,
9645+
"write": 180000,
9646+
"connect": 180000,
9647+
},
96089648
user_request_options=request_options,
96099649
),
96109650
use_read_transporter=False,

clients/algoliasearch-client-python/algoliasearch/search/client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ async def browse_objects(
354354
"""
355355
Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
356356
"""
357+
if isinstance(browse_params, dict):
358+
browse_params = BrowseParamsObject().from_dict(browse_params)
359+
357360
if browse_params is None:
358361
browse_params = BrowseParamsObject(hits_per_page=1000)
359362

@@ -385,6 +388,9 @@ async def browse_rules(
385388
"""
386389
Helper: Iterate on the `search_rules` method of the client to allow aggregating rules of an index.
387390
"""
391+
if isinstance(search_rules_params, dict):
392+
search_rules_params = SearchRulesParams().from_dict(search_rules_params)
393+
388394
if search_rules_params is None:
389395
search_rules_params = SearchRulesParams(hits_per_page=1000)
390396

@@ -418,6 +424,11 @@ async def browse_synonyms(
418424
"""
419425
Helper: Iterate on the `search_synonyms` method of the client to allow aggregating synonyms of an index.
420426
"""
427+
if isinstance(search_synonyms_params, dict):
428+
search_synonyms_params = SearchSynonymsParams().from_dict(
429+
search_synonyms_params
430+
)
431+
421432
if search_synonyms_params is None:
422433
search_synonyms_params = SearchSynonymsParams(hits_per_page=1000, page=0)
423434
hits_per_page = 1000
@@ -453,6 +464,7 @@ async def generate_secured_api_key(
453464
"""
454465
if restrictions is None:
455466
restrictions = SecuredApiKeyRestrictions()
467+
456468
restrictions_dict = {}
457469
if isinstance(restrictions, SecuredApiKeyRestrictions):
458470
restrictions_dict = restrictions.to_dict()
@@ -5384,6 +5396,9 @@ def browse_objects(
53845396
"""
53855397
Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
53865398
"""
5399+
if isinstance(browse_params, dict):
5400+
browse_params = BrowseParamsObject().from_dict(browse_params)
5401+
53875402
if browse_params is None:
53885403
browse_params = BrowseParamsObject(hits_per_page=1000)
53895404

@@ -5415,6 +5430,9 @@ def browse_rules(
54155430
"""
54165431
Helper: Iterate on the `search_rules` method of the client to allow aggregating rules of an index.
54175432
"""
5433+
if isinstance(search_rules_params, dict):
5434+
search_rules_params = SearchRulesParams().from_dict(search_rules_params)
5435+
54185436
if search_rules_params is None:
54195437
search_rules_params = SearchRulesParams(hits_per_page=1000)
54205438

@@ -5448,6 +5466,11 @@ def browse_synonyms(
54485466
"""
54495467
Helper: Iterate on the `search_synonyms` method of the client to allow aggregating synonyms of an index.
54505468
"""
5469+
if isinstance(search_synonyms_params, dict):
5470+
search_synonyms_params = SearchSynonymsParams().from_dict(
5471+
search_synonyms_params
5472+
)
5473+
54515474
if search_synonyms_params is None:
54525475
search_synonyms_params = SearchSynonymsParams(hits_per_page=1000, page=0)
54535476
hits_per_page = 1000
@@ -5481,6 +5504,7 @@ def generate_secured_api_key(
54815504
"""
54825505
if restrictions is None:
54835506
restrictions = SecuredApiKeyRestrictions()
5507+
54845508
restrictions_dict = {}
54855509
if isinstance(restrictions, SecuredApiKeyRestrictions):
54865510
restrictions_dict = restrictions.to_dict()

clients/algoliasearch-client-ruby/lib/algolia/api/ingestion_client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,7 @@ def push_task_with_http_info(task_id, push_task_payload, watch = nil, request_op
21512151
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
21522152
header_params = {}
21532153
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2154+
request_options[:timeout] ||= 180000
21542155

21552156
post_body = request_options[:debug_body] || @api_client.object_to_http_body(push_task_payload)
21562157

@@ -2635,6 +2636,7 @@ def trigger_docker_source_discover_with_http_info(source_id, request_options = {
26352636
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
26362637
header_params = {}
26372638
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2639+
request_options[:timeout] ||= 180000
26382640

26392641
post_body = request_options[:debug_body]
26402642

@@ -3113,6 +3115,7 @@ def validate_source_with_http_info(source_create = nil, request_options = {})
31133115
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
31143116
header_params = {}
31153117
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3118+
request_options[:timeout] ||= 180000
31163119

31173120
post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_create)
31183121

@@ -3166,6 +3169,7 @@ def validate_source_before_update_with_http_info(source_id, source_update, reque
31663169
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
31673170
header_params = {}
31683171
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3172+
request_options[:timeout] ||= 180000
31693173

31703174
post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_update)
31713175

0 commit comments

Comments
 (0)