1616from ._operations import (
1717 _QuestionAnsweringAuthoringClientOperationsMixin as _QuestionAnsweringAuthoringClientOperationsMixinGenerated ,
1818)
19+
1920JSON = MutableMapping [str , Any ]
2021
22+
2123class _QuestionAnsweringAuthoringClientOperationsMixin (_QuestionAnsweringAuthoringClientOperationsMixinGenerated ):
2224 """Mixin class for patching methods with backward compatible parameter names."""
2325
2426 # create_project overloads with 'options' parameter
25- @overload # type: ignore
27+ @overload # type: ignore
2628 async def create_project (
2729 self ,
2830 project_name : str ,
@@ -45,7 +47,7 @@ async def create_project(
4547 :raises ~azure.core.exceptions.HttpResponseError:
4648 """
4749
48- @overload # type: ignore
50+ @overload # type: ignore
4951 async def create_project (
5052 self , project_name : str , options : JSON , * , content_type : str = "application/json" , ** kwargs : Any
5153 ) -> _models .QuestionAnsweringProject :
@@ -64,7 +66,7 @@ async def create_project(
6466 :raises ~azure.core.exceptions.HttpResponseError:
6567 """
6668
67- @overload # type: ignore
69+ @overload # type: ignore
6870 async def create_project (
6971 self , project_name : str , options : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
7072 ) -> _models .QuestionAnsweringProject :
@@ -84,10 +86,8 @@ async def create_project(
8486 """
8587
8688 @distributed_trace_async
87- async def create_project ( # pyright: ignore[reportIncompatibleMethodOverride]
88- self ,
89- project_name : str ,
90- options : Union [_models .QuestionAnsweringProject , JSON , IO [bytes ]], ** kwargs : Any
89+ async def create_project ( # pyright: ignore[reportIncompatibleMethodOverride]
90+ self , project_name : str , options : Union [_models .QuestionAnsweringProject , JSON , IO [bytes ]], ** kwargs : Any
9191 ) -> _models .QuestionAnsweringProject :
9292 """Create or update a project.
9393
@@ -106,9 +106,14 @@ async def create_project( # pyright: ignore[reportIncompatibleMethodOverride]
106106 return await super ().create_project (project_name = project_name , body = options , ** kwargs )
107107
108108 # update_synonyms overloads with 'synonyms' parameter
109- @overload # type: ignore
109+ @overload # type: ignore
110110 async def update_synonyms (
111- self , project_name : str , synonyms : _models .SynonymAssets , * , content_type : str = "application/json" , ** kwargs : Any
111+ self ,
112+ project_name : str ,
113+ synonyms : _models .SynonymAssets ,
114+ * ,
115+ content_type : str = "application/json" ,
116+ ** kwargs : Any
112117 ) -> None :
113118 """Updates all the synonyms of a project.
114119
@@ -124,7 +129,7 @@ async def update_synonyms(
124129 :raises ~azure.core.exceptions.HttpResponseError:
125130 """
126131
127- @overload # type: ignore
132+ @overload # type: ignore
128133 async def update_synonyms (
129134 self , project_name : str , synonyms : JSON , * , content_type : str = "application/json" , ** kwargs : Any
130135 ) -> None :
@@ -142,7 +147,7 @@ async def update_synonyms(
142147 :raises ~azure.core.exceptions.HttpResponseError:
143148 """
144149
145- @overload # type: ignore
150+ @overload # type: ignore
146151 async def update_synonyms (
147152 self , project_name : str , synonyms : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
148153 ) -> None :
@@ -161,7 +166,7 @@ async def update_synonyms(
161166 """
162167
163168 @distributed_trace_async
164- async def update_synonyms ( # pyright: ignore[reportIncompatibleMethodOverride]
169+ async def update_synonyms ( # pyright: ignore[reportIncompatibleMethodOverride]
165170 self , project_name : str , synonyms : Union [_models .SynonymAssets , JSON , IO [bytes ]], ** kwargs : Any
166171 ) -> None :
167172 """Updates all the synonyms of a project.
@@ -180,7 +185,7 @@ async def update_synonyms( # pyright: ignore[reportIncompatibleMethodOverride]
180185 return await super ().update_synonyms (project_name = project_name , body = synonyms , ** kwargs )
181186
182187 # begin_update_qnas overloads with 'qnas' parameter
183- @overload # type: ignore
188+ @overload # type: ignore
184189 async def begin_update_qnas (
185190 self ,
186191 project_name : str ,
@@ -203,7 +208,7 @@ async def begin_update_qnas(
203208 :raises ~azure.core.exceptions.HttpResponseError:
204209 """
205210
206- @overload # type: ignore
211+ @overload # type: ignore
207212 async def begin_update_qnas (
208213 self , project_name : str , qnas : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
209214 ) -> AsyncLROPoller [None ]:
@@ -222,7 +227,7 @@ async def begin_update_qnas(
222227 """
223228
224229 @distributed_trace_async
225- async def begin_update_qnas ( # pyright: ignore[reportIncompatibleMethodOverride]
230+ async def begin_update_qnas ( # pyright: ignore[reportIncompatibleMethodOverride]
226231 self , project_name : str , qnas : Union [list [_models .UpdateQnaRecord ], IO [bytes ]], ** kwargs : Any
227232 ) -> AsyncLROPoller [None ]:
228233 """Updates the QnAs of a project.
@@ -238,12 +243,10 @@ async def begin_update_qnas( # pyright: ignore[reportIncompatibleMethodOverride]
238243 :raises ~azure.core.exceptions.HttpResponseError:
239244 """
240245 # Call the parent implementation with 'body' parameter for backward compatibility
241- return await super ().begin_update_qnas (
242- project_name = project_name , body = qnas , ** kwargs
243- )
246+ return await super ().begin_update_qnas (project_name = project_name , body = qnas , ** kwargs )
244247
245248 # begin_update_sources overloads with 'sources' parameter
246- @overload # type: ignore
249+ @overload # type: ignore
247250 async def begin_update_sources (
248251 self ,
249252 project_name : str ,
@@ -266,7 +269,7 @@ async def begin_update_sources(
266269 :raises ~azure.core.exceptions.HttpResponseError:
267270 """
268271
269- @overload # type: ignore
272+ @overload # type: ignore
270273 async def begin_update_sources (
271274 self , project_name : str , sources : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
272275 ) -> AsyncLROPoller [None ]:
@@ -285,7 +288,7 @@ async def begin_update_sources(
285288 """
286289
287290 @distributed_trace_async
288- async def begin_update_sources ( # pyright: ignore[reportIncompatibleMethodOverride]
291+ async def begin_update_sources ( # pyright: ignore[reportIncompatibleMethodOverride]
289292 self , project_name : str , sources : Union [list [_models .UpdateSourceRecord ], IO [bytes ]], ** kwargs : Any
290293 ) -> AsyncLROPoller [None ]:
291294 """Updates the sources of a project.
@@ -301,9 +304,7 @@ async def begin_update_sources( # pyright: ignore[reportIncompatibleMethodOverri
301304 :raises ~azure.core.exceptions.HttpResponseError:
302305 """
303306 # Call the parent implementation with 'body' parameter for backward compatibility
304- return await super ().begin_update_sources (
305- project_name = project_name , body = sources , ** kwargs
306- )
307+ return await super ().begin_update_sources (project_name = project_name , body = sources , ** kwargs )
307308
308309
309310__all__ : list [str ] = [
@@ -318,3 +319,28 @@ def patch_sdk():
318319 you can't accomplish using the techniques described in
319320 https://aka.ms/azsdk/python/dpcodegen/python/customize
320321 """
322+ # Hide the generated async get_*_status methods (status peek endpoints) without editing
323+ # the generated _operations.py file. Same approach as sync variant.
324+ original_methods : dict [str , Any ] = {}
325+ to_hide = [
326+ "get_delete_status" ,
327+ "get_export_status" ,
328+ "get_import_status" ,
329+ "get_deploy_status" ,
330+ ]
331+ generated_cls = _QuestionAnsweringAuthoringClientOperationsMixinGenerated
332+ for name in to_hide :
333+ if hasattr (generated_cls , name ):
334+ original_methods [name ] = getattr (generated_cls , name )
335+ try :
336+ delattr (generated_cls , name )
337+ except AttributeError :
338+ pass
339+
340+ patch_cls = _QuestionAnsweringAuthoringClientOperationsMixin
341+ for public_name , func in original_methods .items ():
342+ private_name = f"_{ public_name } " # e.g. _get_delete_status
343+ if not hasattr (patch_cls , private_name ):
344+ setattr (patch_cls , private_name , func )
345+
346+ # Do not export these private replicas; __all__ only includes the mixin class currently.
0 commit comments