Skip to content

Commit

Permalink
feat(clients): allow batch size on objects helper [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4172

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed Nov 29, 2024
1 parent 1cf0d00 commit db6922d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions algoliasearch/search/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ async def save_objects(
index_name: str,
objects: List[Dict[str, Any]],
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -514,6 +515,7 @@ async def save_objects(
objects=objects,
action=Action.ADDOBJECT,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand All @@ -522,6 +524,7 @@ async def delete_objects(
index_name: str,
object_ids: List[str],
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -532,6 +535,7 @@ async def delete_objects(
objects=[{"objectID": id} for id in object_ids],
action=Action.DELETEOBJECT,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand All @@ -541,6 +545,7 @@ async def partial_update_objects(
objects: List[Dict[str, Any]],
create_if_not_exists: bool = False,
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -553,6 +558,7 @@ async def partial_update_objects(
if create_if_not_exists
else Action.PARTIALUPDATEOBJECTNOCREATE,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand Down Expand Up @@ -5526,6 +5532,7 @@ def save_objects(
index_name: str,
objects: List[Dict[str, Any]],
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -5536,6 +5543,7 @@ def save_objects(
objects=objects,
action=Action.ADDOBJECT,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand All @@ -5544,6 +5552,7 @@ def delete_objects(
index_name: str,
object_ids: List[str],
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -5554,6 +5563,7 @@ def delete_objects(
objects=[{"objectID": id} for id in object_ids],
action=Action.DELETEOBJECT,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand All @@ -5563,6 +5573,7 @@ def partial_update_objects(
objects: List[Dict[str, Any]],
create_if_not_exists: bool = False,
wait_for_tasks: bool = False,
batch_size: int = 1000,
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> List[BatchResponse]:
"""
Expand All @@ -5575,6 +5586,7 @@ def partial_update_objects(
if create_if_not_exists
else Action.PARTIALUPDATEOBJECTNOCREATE,
wait_for_tasks=wait_for_tasks,
batch_size=batch_size,
request_options=request_options,
)

Expand Down

0 comments on commit db6922d

Please sign in to comment.