Skip to content

Commit 2006915

Browse files
feat(clients): expose waitForTasks to batch helpers [skip-bc] (generated)
algolia/api-clients-automation#4030 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent e8d3af3 commit 2006915

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

algoliasearch/search/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ async def save_objects(
491491
self,
492492
index_name: str,
493493
objects: List[Dict[str, Any]],
494+
wait_for_tasks: bool = False,
494495
request_options: Optional[Union[dict, RequestOptions]] = None,
495496
) -> List[BatchResponse]:
496497
"""
@@ -500,13 +501,15 @@ async def save_objects(
500501
index_name=index_name,
501502
objects=objects,
502503
action=Action.ADDOBJECT,
504+
wait_for_tasks=wait_for_tasks,
503505
request_options=request_options,
504506
)
505507

506508
async def delete_objects(
507509
self,
508510
index_name: str,
509511
object_ids: List[str],
512+
wait_for_tasks: bool = False,
510513
request_options: Optional[Union[dict, RequestOptions]] = None,
511514
) -> List[BatchResponse]:
512515
"""
@@ -516,6 +519,7 @@ async def delete_objects(
516519
index_name=index_name,
517520
objects=[{"objectID": id} for id in object_ids],
518521
action=Action.DELETEOBJECT,
522+
wait_for_tasks=wait_for_tasks,
519523
request_options=request_options,
520524
)
521525

@@ -524,6 +528,7 @@ async def partial_update_objects(
524528
index_name: str,
525529
objects: List[Dict[str, Any]],
526530
create_if_not_exists: bool = False,
531+
wait_for_tasks: bool = False,
527532
request_options: Optional[Union[dict, RequestOptions]] = None,
528533
) -> List[BatchResponse]:
529534
"""
@@ -535,6 +540,7 @@ async def partial_update_objects(
535540
action=Action.PARTIALUPDATEOBJECT
536541
if create_if_not_exists
537542
else Action.PARTIALUPDATEOBJECTNOCREATE,
543+
wait_for_tasks=wait_for_tasks,
538544
request_options=request_options,
539545
)
540546

@@ -5494,6 +5500,7 @@ def save_objects(
54945500
self,
54955501
index_name: str,
54965502
objects: List[Dict[str, Any]],
5503+
wait_for_tasks: bool = False,
54975504
request_options: Optional[Union[dict, RequestOptions]] = None,
54985505
) -> List[BatchResponse]:
54995506
"""
@@ -5503,13 +5510,15 @@ def save_objects(
55035510
index_name=index_name,
55045511
objects=objects,
55055512
action=Action.ADDOBJECT,
5513+
wait_for_tasks=wait_for_tasks,
55065514
request_options=request_options,
55075515
)
55085516

55095517
def delete_objects(
55105518
self,
55115519
index_name: str,
55125520
object_ids: List[str],
5521+
wait_for_tasks: bool = False,
55135522
request_options: Optional[Union[dict, RequestOptions]] = None,
55145523
) -> List[BatchResponse]:
55155524
"""
@@ -5519,6 +5528,7 @@ def delete_objects(
55195528
index_name=index_name,
55205529
objects=[{"objectID": id} for id in object_ids],
55215530
action=Action.DELETEOBJECT,
5531+
wait_for_tasks=wait_for_tasks,
55225532
request_options=request_options,
55235533
)
55245534

@@ -5527,6 +5537,7 @@ def partial_update_objects(
55275537
index_name: str,
55285538
objects: List[Dict[str, Any]],
55295539
create_if_not_exists: bool = False,
5540+
wait_for_tasks: bool = False,
55305541
request_options: Optional[Union[dict, RequestOptions]] = None,
55315542
) -> List[BatchResponse]:
55325543
"""
@@ -5538,6 +5549,7 @@ def partial_update_objects(
55385549
action=Action.PARTIALUPDATEOBJECT
55395550
if create_if_not_exists
55405551
else Action.PARTIALUPDATEOBJECTNOCREATE,
5552+
wait_for_tasks=wait_for_tasks,
55415553
request_options=request_options,
55425554
)
55435555

0 commit comments

Comments
 (0)