Skip to content

Commit 1f776c4

Browse files
author
SDKAuto
committed
CodeGen from PR 31387 in Azure/azure-rest-api-specs
Merge 2baa10d4fe86e65db5e9d17481fcbb3c4ffd2667 into 4a34315010d7416991838424bcbbfe0d4f8cea8a
1 parent 67b6cfb commit 1f776c4

File tree

28 files changed

+1403
-863
lines changed

28 files changed

+1403
-863
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "6b9c3af72e8e2b88b4dcb67c3deab5136f7ed9a6",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/ai/HealthInsights/HealthInsights.RadiologyInsights",
5+
"@azure-tools/typespec-python": "0.36.1"
6+
}

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/__init__.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._patch import RadiologyInsightsClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import RadiologyInsightsClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

14-
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
1525
from ._patch import patch_sdk as _patch_sdk
1626

1727
__all__ = [
1828
"RadiologyInsightsClient",
1929
]
20-
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2131

2232
_patch_sdk()

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_client.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@
2020
from ._serialization import Deserializer, Serializer
2121

2222
if TYPE_CHECKING:
23-
# pylint: disable=unused-import,ungrouped-imports
2423
from azure.core.credentials import TokenCredential
2524

2625

27-
class RadiologyInsightsClient(
28-
RadiologyInsightsClientOperationsMixin
29-
): # pylint: disable=client-accepts-api-version-keyword
26+
class RadiologyInsightsClient(RadiologyInsightsClientOperationsMixin):
3027
"""RadiologyInsightsClient.
3128
3229
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
@@ -36,8 +33,9 @@ class RadiologyInsightsClient(
3633
AzureKeyCredential type or a TokenCredential type. Required.
3734
:type credential: ~azure.core.credentials.AzureKeyCredential or
3835
~azure.core.credentials.TokenCredential
39-
:keyword api_version: The API version to use for this operation. Default value is "2024-04-01".
40-
Note that overriding this default value may result in unsupported behavior.
36+
:keyword api_version: The API version to use for this operation. Default value is
37+
"2024-08-01-preview". Note that overriding this default value may result in unsupported
38+
behavior.
4139
:paramtype api_version: str
4240
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4341
Retry-After header is present.

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_configuration.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for RadiologyInsightsClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
@@ -31,13 +30,14 @@ class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance
3130
AzureKeyCredential type or a TokenCredential type. Required.
3231
:type credential: ~azure.core.credentials.AzureKeyCredential or
3332
~azure.core.credentials.TokenCredential
34-
:keyword api_version: The API version to use for this operation. Default value is "2024-04-01".
35-
Note that overriding this default value may result in unsupported behavior.
33+
:keyword api_version: The API version to use for this operation. Default value is
34+
"2024-08-01-preview". Note that overriding this default value may result in unsupported
35+
behavior.
3636
:paramtype api_version: str
3737
"""
3838

3939
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
40-
api_version: str = kwargs.pop("api_version", "2024-04-01")
40+
api_version: str = kwargs.pop("api_version", "2024-08-01-preview")
4141

4242
if endpoint is None:
4343
raise ValueError("Parameter 'endpoint' must not be None.")

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_model_base.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# pylint: disable=too-many-lines
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.
45
# Licensed under the MIT License. See License.txt in the project root for
56
# license information.
67
# --------------------------------------------------------------------------
7-
# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines
8+
# pylint: disable=protected-access, broad-except
89

910
import copy
1011
import calendar
@@ -573,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
573574
def copy(self) -> "Model":
574575
return Model(self.__dict__)
575576

576-
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument
577+
def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
577578
if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated:
578579
# we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping',
579580
# 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object'
@@ -584,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
584585
annotations = {
585586
k: v
586587
for mro_class in mros
587-
if hasattr(mro_class, "__annotations__") # pylint: disable=no-member
588-
for k, v in mro_class.__annotations__.items() # pylint: disable=no-member
588+
if hasattr(mro_class, "__annotations__")
589+
for k, v in mro_class.__annotations__.items()
589590
}
590591
for attr, rf in attr_to_rest_field.items():
591592
rf._module = cls.__module__
@@ -600,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di
600601

601602
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
602603
for base in cls.__bases__:
603-
if hasattr(base, "__mapping__"): # pylint: disable=no-member
604-
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member
604+
if hasattr(base, "__mapping__"):
605+
base.__mapping__[discriminator or cls.__name__] = cls # type: ignore
605606

606607
@classmethod
607608
def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]:
@@ -612,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField
612613

613614
@classmethod
614615
def _deserialize(cls, data, exist_discriminators):
615-
if not hasattr(cls, "__mapping__"): # pylint: disable=no-member
616+
if not hasattr(cls, "__mapping__"):
616617
return cls(data)
617618
discriminator = cls._get_discriminator(exist_discriminators)
618619
if discriminator is None:
@@ -632,11 +633,11 @@ def _deserialize(cls, data, exist_discriminators):
632633
discriminator_value = data.find(xml_name).text # pyright: ignore
633634
else:
634635
discriminator_value = data.get(discriminator._rest_name)
635-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
636+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
636637
return mapped_cls._deserialize(data, exist_discriminators)
637638

638639
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:
639-
"""Return a dict that can be JSONify using json.dump.
640+
"""Return a dict that can be turned into json using json.dump.
640641
641642
:keyword bool exclude_readonly: Whether to remove the readonly properties.
642643
:returns: A dict JSON compatible object
@@ -733,7 +734,7 @@ def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.An
733734
)
734735

735736

736-
def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912
737+
def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches
737738
annotation: typing.Any,
738739
module: typing.Optional[str],
739740
rf: typing.Optional["_RestField"] = None,

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._operations import RadiologyInsightsClientOperationsMixin
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._operations import RadiologyInsightsClientOperationsMixin # type: ignore
1016

1117
from ._patch import __all__ as _patch_all
12-
from ._patch import * # pylint: disable=unused-wildcard-import
18+
from ._patch import *
1319
from ._patch import patch_sdk as _patch_sdk
1420

1521
__all__ = [
1622
"RadiologyInsightsClientOperationsMixin",
1723
]
18-
__all__.extend([p for p in _patch_all if p not in __all__])
24+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
1925
_patch_sdk()

sdk/healthinsights/azure-healthinsights-radiologyinsights/azure/healthinsights/radiologyinsights/_operations/_operations.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pylint: disable=too-many-lines,too-many-statements
21
# coding=utf-8
32
# --------------------------------------------------------------------------
43
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9,7 +8,7 @@
98
from io import IOBase
109
import json
1110
import sys
12-
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Type, TypeVar, Union, cast, overload
11+
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload
1312

1413
from azure.core.exceptions import (
1514
ClientAuthenticationError,
@@ -36,7 +35,7 @@
3635
if sys.version_info >= (3, 9):
3736
from collections.abc import MutableMapping
3837
else:
39-
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
38+
from typing import MutableMapping # type: ignore
4039
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
4140
T = TypeVar("T")
4241
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +51,7 @@ def build_radiology_insights_infer_radiology_insights_request( # pylint: disabl
5251
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
5352

5453
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
55-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
54+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-01-preview"))
5655
accept = _headers.pop("Accept", "application/json")
5756

5857
# Construct URL
@@ -86,7 +85,7 @@ def _infer_radiology_insights_initial(
8685
expand: Optional[List[str]] = None,
8786
**kwargs: Any
8887
) -> Iterator[bytes]:
89-
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
88+
error_map: MutableMapping = {
9089
401: ClientAuthenticationError,
9190
404: ResourceNotFoundError,
9291
409: ResourceExistsError,

0 commit comments

Comments
 (0)