Skip to content

Commit

Permalink
feat(clients): add optionnal scopes to replaceAllObjects [skip-bc] (g…
Browse files Browse the repository at this point in the history
…enerated)

algolia/api-clients-automation#4296

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
algolia-bot and millotp committed Jan 7, 2025
1 parent e561c4e commit 793a39b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions algoliasearch/search/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
from algoliasearch.search.models.rule import Rule
from algoliasearch.search.models.save_object_response import SaveObjectResponse
from algoliasearch.search.models.save_synonym_response import SaveSynonymResponse
from algoliasearch.search.models.scope_type import ScopeType
from algoliasearch.search.models.search_dictionary_entries_params import (
SearchDictionaryEntriesParams,
)
Expand Down Expand Up @@ -611,6 +610,7 @@ async def replace_all_objects(
index_name: str,
objects: List[Dict[str, Any]],
batch_size: int = 1000,
scopes=["settings", "rules", "synonyms"],
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> ReplaceAllObjectsResponse:
"""
Expand All @@ -628,11 +628,7 @@ async def _copy() -> UpdatedAtResponse:
operation_index_params=OperationIndexParams(
operation=OperationType.COPY,
destination=tmp_index_name,
scope=[
ScopeType("settings"),
ScopeType("rules"),
ScopeType("synonyms"),
],
scope=scopes,
),
request_options=request_options,
)
Expand Down Expand Up @@ -5655,6 +5651,7 @@ def replace_all_objects(
index_name: str,
objects: List[Dict[str, Any]],
batch_size: int = 1000,
scopes=["settings", "rules", "synonyms"],
request_options: Optional[Union[dict, RequestOptions]] = None,
) -> ReplaceAllObjectsResponse:
"""
Expand All @@ -5672,11 +5669,7 @@ def _copy() -> UpdatedAtResponse:
operation_index_params=OperationIndexParams(
operation=OperationType.COPY,
destination=tmp_index_name,
scope=[
ScopeType("settings"),
ScopeType("rules"),
ScopeType("synonyms"),
],
scope=scopes,
),
request_options=request_options,
)
Expand Down

0 comments on commit 793a39b

Please sign in to comment.