Skip to content

Commit b052c52

Browse files
author
SDKAuto
committed
CodeGen from PR 3559 in test-repo-billy/azure-rest-api-specs
Merge 060e30d7a05928d0442267354fe4ccf0740e37ef into a1ece0d8092cbabd104c6a090519eb102db0c350
1 parent b2b0c35 commit b052c52

File tree

19 files changed

+1088
-571
lines changed

19 files changed

+1088
-571
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "9458b84485608b75bb0aa3057a951e41102c6f40",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
4+
"typespec_src": "specification/ai/HealthInsights/HealthInsights.RadiologyInsights",
5+
"@azure-tools/typespec-python": "0.31.1"
6+
}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._patch import RadiologyInsightsClient
9+
from ._client import RadiologyInsightsClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
1313

14-
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
1519
from ._patch import patch_sdk as _patch_sdk
1620

1721
__all__ = [
1822
"RadiologyInsightsClient",
1923
]
20-
24+
__all__.extend([p for p in _patch_all if p not in __all__])
2125

2226
_patch_sdk()

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class RadiologyInsightsClient(
3636
AzureKeyCredential type or a TokenCredential type. Required.
3737
:type credential: ~azure.core.credentials.AzureKeyCredential or
3838
~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.
39+
:keyword api_version: The API version to use for this operation. Default value is
40+
"2024-08-01-preview". Note that overriding this default value may result in unsupported
41+
behavior.
4142
:paramtype api_version: str
4243
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4344
Retry-After header is present.

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ class RadiologyInsightsClientConfiguration: # pylint: disable=too-many-instance
3131
AzureKeyCredential type or a TokenCredential type. Required.
3232
:type credential: ~azure.core.credentials.AzureKeyCredential or
3333
~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.
34+
:keyword api_version: The API version to use for this operation. Default value is
35+
"2024-08-01-preview". Note that overriding this default value may result in unsupported
36+
behavior.
3637
:paramtype api_version: str
3738
"""
3839

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def build_radiology_insights_infer_radiology_insights_request( # pylint: disabl
5252
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
5353

5454
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"))
55+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-01-preview"))
5656
accept = _headers.pop("Accept", "application/json")
5757

5858
# Construct URL

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

Lines changed: 2 additions & 258 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pylint: disable=protected-access
21
# ------------------------------------
32
# Copyright (c) Microsoft Corporation.
43
# Licensed under the MIT License.
@@ -7,264 +6,9 @@
76
87
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
98
"""
10-
from typing import (
11-
Any,
12-
IO,
13-
Optional,
14-
Dict,
15-
Union,
16-
cast,
17-
overload,
18-
List,
19-
MutableMapping,
20-
TypeVar,
21-
Callable,
22-
TYPE_CHECKING,
23-
) # pylint: disable=line-too-long
24-
from azure.core.credentials import AzureKeyCredential
25-
from azure.core.rest import HttpRequest, HttpResponse
26-
from azure.core.pipeline import PipelineResponse
27-
from azure.core.polling import LROPoller, NoPolling, PollingMethod
28-
from azure.core.polling.base_polling import LROBasePolling
29-
from azure.core.tracing.decorator import distributed_trace
30-
from azure.core.utils import case_insensitive_dict
9+
from typing import List
3110

32-
from . import models as _models
33-
from ._model_base import _deserialize
34-
from ._client import RadiologyInsightsClient as _RadiologyInsightsClient
35-
36-
37-
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
38-
T = TypeVar("T")
39-
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
40-
41-
if TYPE_CHECKING:
42-
# pylint: disable=unused-import,ungrouped-imports
43-
from azure.core.credentials import TokenCredential
44-
45-
46-
class RadiologyInsightsClient: # pylint: disable=client-accepts-api-version-keyword
47-
"""RadiologyInsightsClient.
48-
49-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
50-
https://westus2.api.cognitive.microsoft.com). Required.
51-
:type endpoint: str
52-
:param credential: Credential used to authenticate requests to the service. Is either a
53-
AzureKeyCredential type or a TokenCredential type. Required.
54-
:type credential: ~azure.core.credentials.AzureKeyCredential or
55-
~azure.core.credentials.TokenCredential
56-
:keyword api_version: The API version to use for this operation. Default value is "2024-04-01".
57-
Note that overriding this default value may result in unsupported behavior.
58-
:paramtype api_version: str
59-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
60-
Retry-After header is present.
61-
"""
62-
63-
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
64-
self._client = _RadiologyInsightsClient(endpoint=endpoint, credential=credential, **kwargs)
65-
66-
@overload
67-
def begin_infer_radiology_insights(
68-
self,
69-
id: str,
70-
resource: _models.RadiologyInsightsJob,
71-
*,
72-
expand: Optional[List[str]] = None,
73-
content_type: str = "application/json",
74-
**kwargs: Any
75-
) -> LROPoller[_models.RadiologyInsightsInferenceResult]:
76-
# pylint: disable=line-too-long
77-
"""Create Radiology Insights inference result.
78-
79-
Creates a Radiology Insights inference result with the given request body.
80-
81-
:param id: The unique ID of the inference result. Required.
82-
:type id: str
83-
:param resource: The resource instance. Required.
84-
:type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob
85-
:keyword expand: Expand the indicated resources into the response. Default value is None.
86-
:paramtype expand: list[str]
87-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json".
88-
:paramtype content_type: str
89-
:return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping
90-
:rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsResult]
91-
:raises ~azure.core.exceptions.HttpResponseError:"""
92-
93-
@overload
94-
def begin_infer_radiology_insights(
95-
self,
96-
id: str,
97-
resource: JSON,
98-
*,
99-
expand: Optional[List[str]] = None,
100-
content_type: str = "application/json",
101-
**kwargs: Any
102-
) -> LROPoller[_models.RadiologyInsightsInferenceResult]:
103-
# pylint: disable=line-too-long
104-
"""Create Radiology Insights inference result.
105-
106-
Creates a Radiology Insights inference result with the given request body.
107-
108-
:param id: The unique ID of the inference result. Required.
109-
:type id: str
110-
:param resource: The resource instance. Required.
111-
:type resource: JSON
112-
:keyword expand: Expand the indicated resources into the response. Default value is None.
113-
:paramtype expand: list[str]
114-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json".
115-
:paramtype content_type: str
116-
:return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping
117-
:rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult]
118-
:raises ~azure.core.exceptions.HttpResponseError:"""
119-
120-
@overload
121-
def begin_infer_radiology_insights(
122-
self,
123-
id: str,
124-
resource: IO[bytes],
125-
*,
126-
expand: Optional[List[str]] = None,
127-
content_type: str = "application/json",
128-
**kwargs: Any
129-
) -> LROPoller[_models.RadiologyInsightsInferenceResult]:
130-
# pylint: disable=line-too-long
131-
"""Create Radiology Insights inference result.
132-
133-
Creates a Radiology Insights inference result with the given request body.
134-
135-
:param id: The unique ID of the inference result. Required.
136-
:type id: str
137-
:param resource: The resource instance. Required.
138-
:type resource: IO[bytes]
139-
:keyword expand: Expand the indicated resources into the response. Default value is None.
140-
:paramtype expand: list[str]
141-
:keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json".
142-
:paramtype content_type: str
143-
:return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping
144-
:rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult]
145-
:raises ~azure.core.exceptions.HttpResponseError:"""
146-
147-
@distributed_trace
148-
def begin_infer_radiology_insights(
149-
self,
150-
id: str,
151-
resource: Union[_models.RadiologyInsightsJob, JSON, IO[bytes]],
152-
*,
153-
expand: Optional[List[str]] = None,
154-
**kwargs: Any
155-
) -> LROPoller[_models.RadiologyInsightsInferenceResult]:
156-
# pylint: disable=line-too-long
157-
"""Create Radiology Insights inference result.
158-
159-
Creates a Radiology Insights inference result with the given request body.
160-
161-
:param id: The unique ID of the inference result. Required.
162-
:type id: str
163-
:param resource: The resource instance. Is one of the following types: RadiologyInsightsJob, JSON, IO[bytes] Required.
164-
:type resource: ~azure.healthinsights.radiologyinsights.models.RadiologyInsightsJob or JSON or IO[bytes]
165-
:keyword expand: Expand the indicated resources into the response. Default value is None.
166-
:paramtype expand: list[str]
167-
:return: An instance of LROPoller that returns RadiologyInsightsInferenceResult. The RadiologyInsightsInferenceResult is compatible with MutableMapping
168-
:rtype: ~azure.core.polling.LROPoller[~azure.healthinsights.radiologyinsights.models.RadiologyInsightsInferenceResult]
169-
:raises ~azure.core.exceptions.HttpResponseError:"""
170-
171-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
172-
_params = kwargs.pop("params", {}) or {}
173-
174-
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
175-
cls: ClsType[_models.RadiologyInsightsJob] = kwargs.pop("cls", None)
176-
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
177-
lro_delay = kwargs.pop(
178-
"polling_interval", self._client._config.polling_interval # pylint: disable=protected-access
179-
)
180-
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
181-
if cont_token is None:
182-
raw_result = self._client._infer_radiology_insights_initial( # pylint: disable=protected-access
183-
id=id,
184-
resource=resource,
185-
expand=expand,
186-
content_type=content_type,
187-
cls=lambda x, y, z: x,
188-
headers=_headers,
189-
params=_params,
190-
**kwargs
191-
)
192-
raw_result.http_response.read() # type: ignore
193-
kwargs.pop("error_map", None)
194-
195-
def get_long_running_output(pipeline_response):
196-
response_headers = {}
197-
response = pipeline_response.http_response
198-
response_headers["x-ms-request-id"] = self._client._deserialize( # pylint: disable=protected-access
199-
"str", response.headers.get("x-ms-request-id")
200-
)
201-
response_headers["Operation-Location"] = self._client._deserialize( # pylint: disable=protected-access
202-
"str", response.headers.get("Operation-Location")
203-
)
204-
deserialized = _deserialize(_models.RadiologyInsightsInferenceResult, response.json().get("result"))
205-
if cls:
206-
return cls(pipeline_response, deserialized, response_headers) # type: ignore
207-
return deserialized
208-
209-
path_format_arguments = {
210-
"endpoint": self._client._serialize.url( # pylint: disable=protected-access
211-
"self._client._config.endpoint", self._client._config.endpoint, "str", skip_quote=True
212-
),
213-
}
214-
215-
if polling is True:
216-
polling_method: PollingMethod = cast(
217-
PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
218-
)
219-
elif polling is False:
220-
polling_method = cast(PollingMethod, NoPolling())
221-
else:
222-
polling_method = polling
223-
if cont_token:
224-
return LROPoller[_models.RadiologyInsightsInferenceResult].from_continuation_token(
225-
polling_method=polling_method,
226-
continuation_token=cont_token,
227-
client=self._client._client, # pylint: disable=protected-access
228-
deserialization_callback=get_long_running_output,
229-
)
230-
return LROPoller[_models.RadiologyInsightsInferenceResult](
231-
self._client._client, raw_result, get_long_running_output, polling_method # type: ignore # pylint: disable=protected-access
232-
)
233-
234-
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
235-
"""Runs the network request through the client's chained policies.
236-
237-
>>> from azure.core.rest import HttpRequest
238-
>>> request = HttpRequest("GET", "https://www.example.org/")
239-
<HttpRequest [GET], url: 'https://www.example.org/'>
240-
>>> response = client.send_request(request)
241-
<HttpResponse: 200 OK>
242-
243-
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
244-
245-
:param request: The network request you want to make. Required.
246-
:type request: ~azure.core.rest.HttpRequest
247-
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
248-
:return: The response of your network call. Does not do error handling on your response.
249-
:rtype: ~azure.core.rest.HttpResponse
250-
"""
251-
252-
return self._client.send_request(request, stream=stream, **kwargs) # type: ignore
253-
254-
def close(self) -> None:
255-
self._client.close()
256-
257-
def __enter__(self) -> "RadiologyInsightsClient":
258-
self._client.__enter__()
259-
return self
260-
261-
def __exit__(self, *exc_details: Any) -> None:
262-
self._client.__exit__(*exc_details)
263-
264-
265-
__all__: List[str] = [
266-
"RadiologyInsightsClient"
267-
] # Add all objects you want publicly available to users at this package level # pylint: disable=line-too-long
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
26812

26913

27014
def patch_sdk():

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._patch import RadiologyInsightsClient
10-
9+
from ._client import RadiologyInsightsClient
1110

11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
1216
from ._patch import patch_sdk as _patch_sdk
1317

1418
__all__ = [
1519
"RadiologyInsightsClient",
1620
]
17-
21+
__all__.extend([p for p in _patch_all if p not in __all__])
1822

1923
_patch_sdk()

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class RadiologyInsightsClient(
3636
AzureKeyCredential type or a TokenCredential type. Required.
3737
:type credential: ~azure.core.credentials.AzureKeyCredential or
3838
~azure.core.credentials_async.AsyncTokenCredential
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.
39+
:keyword api_version: The API version to use for this operation. Default value is
40+
"2024-08-01-preview". Note that overriding this default value may result in unsupported
41+
behavior.
4142
:paramtype api_version: str
4243
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4344
Retry-After header is present.

0 commit comments

Comments
 (0)