Skip to content

Commit 793a39b

Browse files
algolia-botmillotp
andcommitted
feat(clients): add optionnal scopes to replaceAllObjects [skip-bc] (generated)
algolia/api-clients-automation#4296 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent e561c4e commit 793a39b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

algoliasearch/search/client.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
from algoliasearch.search.models.rule import Rule
9696
from algoliasearch.search.models.save_object_response import SaveObjectResponse
9797
from algoliasearch.search.models.save_synonym_response import SaveSynonymResponse
98-
from algoliasearch.search.models.scope_type import ScopeType
9998
from algoliasearch.search.models.search_dictionary_entries_params import (
10099
SearchDictionaryEntriesParams,
101100
)
@@ -611,6 +610,7 @@ async def replace_all_objects(
611610
index_name: str,
612611
objects: List[Dict[str, Any]],
613612
batch_size: int = 1000,
613+
scopes=["settings", "rules", "synonyms"],
614614
request_options: Optional[Union[dict, RequestOptions]] = None,
615615
) -> ReplaceAllObjectsResponse:
616616
"""
@@ -628,11 +628,7 @@ async def _copy() -> UpdatedAtResponse:
628628
operation_index_params=OperationIndexParams(
629629
operation=OperationType.COPY,
630630
destination=tmp_index_name,
631-
scope=[
632-
ScopeType("settings"),
633-
ScopeType("rules"),
634-
ScopeType("synonyms"),
635-
],
631+
scope=scopes,
636632
),
637633
request_options=request_options,
638634
)
@@ -5655,6 +5651,7 @@ def replace_all_objects(
56555651
index_name: str,
56565652
objects: List[Dict[str, Any]],
56575653
batch_size: int = 1000,
5654+
scopes=["settings", "rules", "synonyms"],
56585655
request_options: Optional[Union[dict, RequestOptions]] = None,
56595656
) -> ReplaceAllObjectsResponse:
56605657
"""
@@ -5672,11 +5669,7 @@ def _copy() -> UpdatedAtResponse:
56725669
operation_index_params=OperationIndexParams(
56735670
operation=OperationType.COPY,
56745671
destination=tmp_index_name,
5675-
scope=[
5676-
ScopeType("settings"),
5677-
ScopeType("rules"),
5678-
ScopeType("synonyms"),
5679-
],
5672+
scope=scopes,
56805673
),
56815674
request_options=request_options,
56825675
)

0 commit comments

Comments
 (0)