1- # pylint: disable=line-too-long,useless-suppression
1+ # pylint: disable=line-too-long,useless-suppression,duplicate-code,arguments-renamed
22# coding=utf-8
33# --------------------------------------------------------------------------
44# Copyright (c) Microsoft Corporation. All rights reserved.
88
99Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
1010"""
11- from __future__ import annotations
1211from collections .abc import MutableMapping
13- from typing import Any , Union , overload , IO , Any , TYPE_CHECKING
12+ from typing import Any , Union , overload , IO
1413from azure .core .polling import LROPoller
1514from azure .core .tracing .decorator import distributed_trace
1615
17- # Import specific model types only for static type checking to avoid runtime circular imports.
18- if TYPE_CHECKING :
19- from ..models import _models
16+ from .. import models as _models
2017
2118from ._operations import (
2219 _QuestionAnsweringAuthoringClientOperationsMixin as _QuestionAnsweringAuthoringClientOperationsMixinGenerated ,
@@ -45,7 +42,8 @@ def create_project(
4542 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
4643 Default value is "application/json".
4744 :paramtype content_type: str
48- :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with MutableMapping
45+ :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with
46+ MutableMapping
4947 :rtype: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject
5048 :raises ~azure.core.exceptions.HttpResponseError:
5149 """
@@ -63,7 +61,8 @@ def create_project(
6361 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
6462 Default value is "application/json".
6563 :paramtype content_type: str
66- :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with MutableMapping
64+ :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with
65+ MutableMapping
6766 :rtype: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject
6867 :raises ~azure.core.exceptions.HttpResponseError:
6968 """
@@ -81,44 +80,36 @@ def create_project(
8180 :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
8281 Default value is "application/json".
8382 :paramtype content_type: str
84- :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with MutableMapping
83+ :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with
84+ MutableMapping
8585 :rtype: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject
8686 :raises ~azure.core.exceptions.HttpResponseError:
8787 """
8888
8989 @distributed_trace
90- def create_project (
91- self ,
92- project_name : str ,
93- options : Union [_models .QuestionAnsweringProject , JSON , IO [bytes ]],
94- * ,
95- content_type : str = "application/json" ,
96- ** kwargs : Any
90+ def create_project ( # pyright: ignore[reportIncompatibleMethodOverride]
91+ self , project_name : str , options : Union [_models .QuestionAnsweringProject , JSON , IO [bytes ]], ** kwargs : Any
9792 ) -> _models .QuestionAnsweringProject :
9893 """Create or update a project.
9994
10095 :param project_name: Name of the project. Required.
10196 :type project_name: str
102- :param options: The resource instance. Is either a QuestionAnsweringProject, JSON, or IO[bytes] type. Required.
103- :type options: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject or JSON or IO[bytes]
104- :keyword content_type: Body Parameter content-type. Default value is "application/json".
105- :paramtype content_type: str
106- :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with MutableMapping
97+ :param options: The resource instance. Is one of the following types: QuestionAnsweringProject,
98+ JSON, IO[bytes] Required.
99+ :type options: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject or
100+ JSON or IO[bytes]
101+ :return: QuestionAnsweringProject. The QuestionAnsweringProject is compatible with
102+ MutableMapping
107103 :rtype: ~azure.ai.language.questionanswering.authoring.models.QuestionAnsweringProject
108104 :raises ~azure.core.exceptions.HttpResponseError:
109105 """
110106 # Call the parent implementation with 'body' parameter for backward compatibility
111- return super ().create_project (project_name = project_name , body = options , content_type = content_type , ** kwargs )
107+ return super ().create_project (project_name = project_name , body = options , ** kwargs )
112108
113109 # update_synonyms overloads with 'synonyms' parameter
114110 @overload # type: ignore
115111 def update_synonyms (
116- self ,
117- project_name : str ,
118- synonyms : _models .SynonymAssets ,
119- * ,
120- content_type : str = "application/json" ,
121- ** kwargs : Any
112+ self , project_name : str , synonyms : _models .SynonymAssets , * , content_type : str = "application/json" , ** kwargs : Any
122113 ) -> None :
123114 """Updates all the synonyms of a project.
124115
@@ -171,28 +162,23 @@ def update_synonyms(
171162 """
172163
173164 @distributed_trace
174- def update_synonyms (
175- self ,
176- project_name : str ,
177- synonyms : Union [_models .SynonymAssets , JSON , IO [bytes ]],
178- * ,
179- content_type : str = "application/json" ,
180- ** kwargs : Any
165+ def update_synonyms ( # pyright: ignore[reportIncompatibleMethodOverride]
166+ self , project_name : str , synonyms : Union [_models .SynonymAssets , JSON , IO [bytes ]], ** kwargs : Any
181167 ) -> None :
182168 """Updates all the synonyms of a project.
183169
184170 :param project_name: The name of the project to use. Required.
185171 :type project_name: str
186- :param synonyms: All the synonyms of a project. Is either a SynonymAssets, JSON, or IO[bytes] type. Required.
187- :type synonyms: ~azure.ai.language.questionanswering.authoring.models.SynonymAssets or JSON or IO[bytes]
188- :keyword content_type: Body Parameter content-type. Default value is "application/json".
189- :paramtype content_type: str
172+ :param synonyms: All the synonyms of a project. Is one of the following types: SynonymAssets, JSON,
173+ IO[bytes] Required.
174+ :type synonyms: ~azure.ai.language.questionanswering.authoring.models.SynonymAssets or JSON or
175+ IO[bytes]
190176 :return: None
191177 :rtype: None
192178 :raises ~azure.core.exceptions.HttpResponseError:
193179 """
194180 # Call the parent implementation with 'body' parameter for backward compatibility
195- return super ().update_synonyms (project_name = project_name , body = synonyms , content_type = content_type , ** kwargs )
181+ return super ().update_synonyms (project_name = project_name , body = synonyms , ** kwargs )
196182
197183 # begin_update_qnas overloads with 'qnas' parameter
198184 @overload # type: ignore
@@ -218,24 +204,6 @@ def begin_update_qnas(
218204 :raises ~azure.core.exceptions.HttpResponseError:
219205 """
220206
221- @overload # type: ignore
222- def begin_update_qnas (
223- self , project_name : str , qnas : JSON , * , content_type : str = "application/json" , ** kwargs : Any
224- ) -> LROPoller [None ]:
225- """Updates the QnAs of a project.
226-
227- :param project_name: The name of the project to use. Required.
228- :type project_name: str
229- :param qnas: Update QnAs parameters of a project. Required.
230- :type qnas: JSON
231- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
232- Default value is "application/json".
233- :paramtype content_type: str
234- :return: An instance of LROPoller that returns None
235- :rtype: ~azure.core.polling.LROPoller[None]
236- :raises ~azure.core.exceptions.HttpResponseError:
237- """
238-
239207 @overload # type: ignore
240208 def begin_update_qnas (
241209 self , project_name : str , qnas : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
@@ -255,28 +223,23 @@ def begin_update_qnas(
255223 """
256224
257225 @distributed_trace
258- def begin_update_qnas (
259- self ,
260- project_name : str ,
261- qnas : Union [list [_models .UpdateQnaRecord ], JSON , IO [bytes ]],
262- * ,
263- content_type : str = "application/json" ,
264- ** kwargs : Any
226+ def begin_update_qnas ( # pyright: ignore[reportIncompatibleMethodOverride]
227+ self , project_name : str , qnas : Union [list [_models .UpdateQnaRecord ], IO [bytes ]], ** kwargs : Any
265228 ) -> LROPoller [None ]:
266229 """Updates the QnAs of a project.
267230
268231 :param project_name: The name of the project to use. Required.
269232 :type project_name: str
270- :param qnas: Update QnAs parameters of a project. Is either a list of UpdateQnaRecord, JSON, or IO[bytes ] type. Required.
271- :type qnas: list[~azure.ai.language.questionanswering.authoring.models.UpdateQnaRecord] or JSON or IO[bytes]
272- :keyword content_type: Body Parameter content-type. Default value is "application/json".
273- :paramtype content_type: str
233+ :param qnas: Update QnAs parameters of a project. Is either a [UpdateQnaRecord ] type or a
234+ IO[bytes] type. Required.
235+ :type qnas: list[~azure.ai.language.questionanswering.authoring.models.UpdateQnaRecord] or
236+ IO[bytes]
274237 :return: An instance of LROPoller that returns None
275238 :rtype: ~azure.core.polling.LROPoller[None]
276239 :raises ~azure.core.exceptions.HttpResponseError:
277240 """
278241 # Call the parent implementation with 'body' parameter for backward compatibility
279- return super ().begin_update_qnas (project_name = project_name , body = qnas , content_type = content_type , ** kwargs )
242+ return super ().begin_update_qnas (project_name = project_name , body = qnas , ** kwargs )
280243
281244 # begin_update_sources overloads with 'sources' parameter
282245 @overload # type: ignore
@@ -302,24 +265,6 @@ def begin_update_sources(
302265 :raises ~azure.core.exceptions.HttpResponseError:
303266 """
304267
305- @overload # type: ignore
306- def begin_update_sources (
307- self , project_name : str , sources : JSON , * , content_type : str = "application/json" , ** kwargs : Any
308- ) -> LROPoller [None ]:
309- """Updates the sources of a project.
310-
311- :param project_name: The name of the project to use. Required.
312- :type project_name: str
313- :param sources: Update sources parameters of a project. Required.
314- :type sources: JSON
315- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
316- Default value is "application/json".
317- :paramtype content_type: str
318- :return: An instance of LROPoller that returns None
319- :rtype: ~azure.core.polling.LROPoller[None]
320- :raises ~azure.core.exceptions.HttpResponseError:
321- """
322-
323268 @overload # type: ignore
324269 def begin_update_sources (
325270 self , project_name : str , sources : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
@@ -339,29 +284,24 @@ def begin_update_sources(
339284 """
340285
341286 @distributed_trace
342- def begin_update_sources (
343- self ,
344- project_name : str ,
345- sources : Union [list [_models .UpdateSourceRecord ], JSON , IO [bytes ]],
346- * ,
347- content_type : str = "application/json" ,
348- ** kwargs : Any
287+ def begin_update_sources ( # pyright: ignore[reportIncompatibleMethodOverride]
288+ self , project_name : str , sources : Union [list [_models .UpdateSourceRecord ], IO [bytes ]], ** kwargs : Any
349289 ) -> LROPoller [None ]:
350290 """Updates the sources of a project.
351291
352292 :param project_name: The name of the project to use. Required.
353293 :type project_name: str
354- :param sources: Update sources parameters of a project. Is either a list of UpdateSourceRecord, JSON, or IO[bytes ] type. Required.
355- :type sources: list[~azure.ai.language.questionanswering.authoring.models.UpdateSourceRecord] or JSON or IO[bytes]
356- :keyword content_type: Body Parameter content-type. Default value is "application/json".
357- :paramtype content_type: str
294+ :param sources: Update sources parameters of a project. Is either a [UpdateSourceRecord ] type or a
295+ IO[bytes] type. Required.
296+ :type sources: list[~azure.ai.language.questionanswering.authoring.models.UpdateSourceRecord] or
297+ IO[bytes]
358298 :return: An instance of LROPoller that returns None
359299 :rtype: ~azure.core.polling.LROPoller[None]
360300 :raises ~azure.core.exceptions.HttpResponseError:
361301 """
362302 # Call the parent implementation with 'body' parameter for backward compatibility
363303 return super ().begin_update_sources (
364- project_name = project_name , body = sources , content_type = content_type , ** kwargs
304+ project_name = project_name , body = sources , ** kwargs
365305 )
366306
367307
0 commit comments