From 793a39b50870f4feb293dad746329175fc33fd89 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Tue, 7 Jan 2025 09:20:33 +0000 Subject: [PATCH] feat(clients): add optionnal scopes to replaceAllObjects [skip-bc] (generated) https://github.com/algolia/api-clients-automation/pull/4296 Co-authored-by: algolia-bot Co-authored-by: Pierre Millot --- algoliasearch/search/client.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/algoliasearch/search/client.py b/algoliasearch/search/client.py index d811244d9..766f542d4 100644 --- a/algoliasearch/search/client.py +++ b/algoliasearch/search/client.py @@ -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, ) @@ -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: """ @@ -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, ) @@ -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: """ @@ -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, )