Skip to content

Commit 3933eae

Browse files
[AutoRelease] t2-healthcareapis-2022-11-22-17015(can only be merged by SDK owner) (Azure#27635)
* code and test * Update CHANGELOG.md * Update _version.py Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <[email protected]>
1 parent 7c1d680 commit 3933eae

File tree

99 files changed

+14682
-6120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+14682
-6120
lines changed

sdk/healthcareapis/azure-mgmt-healthcareapis/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 1.2.0b1 (2022-11-22)
4+
5+
### Features Added
6+
7+
- Model DicomService has a new parameter cors_configuration
8+
- Model FhirService has a new parameter import_configuration
9+
- Model MetricSpecification has a new parameter enable_regional_mdm_account
10+
- Model MetricSpecification has a new parameter is_internal
11+
- Model MetricSpecification has a new parameter metric_filter_pattern
12+
- Model MetricSpecification has a new parameter resource_id_dimension_name_override
13+
- Model MetricSpecification has a new parameter source_mdm_account
14+
- Model ServicesProperties has a new parameter import_configuration
15+
316
## 1.1.0 (2022-03-31)
417

518
**Features**
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include _meta.json
2-
recursive-include tests *.py *.yaml
2+
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py
67
include LICENSE
8+
include azure/mgmt/healthcareapis/py.typed

sdk/healthcareapis/azure-mgmt-healthcareapis/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Health Care Apis Management Client Library.
4-
This package has been tested with Python 3.6+.
4+
This package has been tested with Python 3.7+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313

1414
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
1715

1816
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
1917
Code samples for this package can be found at [Health Care Apis Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "fc0c0316bf5187af413a256c484c1e2a259e18b8",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.12.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.2.7",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "a70086b6711c1058aaf3c5906744a665a492a504",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/healthcareapis/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/healthcareapis/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/healthcareapis/resource-manager/readme.md"
1111
}

sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['HealthcareApisManagementClient']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
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 = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"HealthcareApisManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_configuration.py

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,55 +15,58 @@
1415

1516
from ._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials import TokenCredential
2026

2127

22-
class HealthcareApisManagementClientConfiguration(Configuration):
28+
class HealthcareApisManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2329
"""Configuration for HealthcareApisManagementClient.
2430
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
28-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The subscription identifier.
36+
:param subscription_id: The subscription identifier. Required.
3137
:type subscription_id: str
38+
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
39+
default value may result in unsupported behavior.
40+
:paramtype api_version: str
3241
"""
3342

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
) -> None:
43+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4044
super(HealthcareApisManagementClientConfiguration, self).__init__(**kwargs)
45+
api_version: Literal["2022-06-01"] = kwargs.pop("api_version", "2022-06-01")
46+
4147
if credential is None:
4248
raise ValueError("Parameter 'credential' must not be None.")
4349
if subscription_id is None:
4450
raise ValueError("Parameter 'subscription_id' must not be None.")
4551

4652
self.credential = credential
4753
self.subscription_id = subscription_id
48-
self.api_version = "2021-11-01"
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'mgmt-healthcareapis/{}'.format(VERSION))
54+
self.api_version = api_version
55+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
56+
kwargs.setdefault("sdk_moniker", "mgmt-healthcareapis/{}".format(VERSION))
5157
self._configure(**kwargs)
5258

53-
def _configure(
54-
self,
55-
**kwargs # type: Any
56-
):
57-
# type: (...) -> None
58-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
59-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
60-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
61-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
62-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
63-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
64-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
65-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
66-
self.authentication_policy = kwargs.get('authentication_policy')
59+
def _configure(self, **kwargs: Any) -> None:
60+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
61+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
62+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
63+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
64+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
65+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
66+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
67+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
68+
self.authentication_policy = kwargs.get("authentication_policy")
6769
if self.credential and not self.authentication_policy:
68-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
70+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
71+
self.credential, *self.credential_scopes, **kwargs
72+
)

sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/_healthcare_apis_management_client.py

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,36 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Optional, TYPE_CHECKING
10+
from typing import Any, TYPE_CHECKING
1111

1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
14-
from msrest import Deserializer, Serializer
1514

16-
from . import models
15+
from . import models as _models
1716
from ._configuration import HealthcareApisManagementClientConfiguration
18-
from .operations import DicomServicesOperations, FhirDestinationsOperations, FhirServicesOperations, IotConnectorFhirDestinationOperations, IotConnectorsOperations, OperationResultsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ServicesOperations, WorkspacePrivateEndpointConnectionsOperations, WorkspacePrivateLinkResourcesOperations, WorkspacesOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
DicomServicesOperations,
20+
FhirDestinationsOperations,
21+
FhirServicesOperations,
22+
IotConnectorFhirDestinationOperations,
23+
IotConnectorsOperations,
24+
OperationResultsOperations,
25+
Operations,
26+
PrivateEndpointConnectionsOperations,
27+
PrivateLinkResourcesOperations,
28+
ServicesOperations,
29+
WorkspacePrivateEndpointConnectionsOperations,
30+
WorkspacePrivateLinkResourcesOperations,
31+
WorkspacesOperations,
32+
)
1933

2034
if TYPE_CHECKING:
2135
# pylint: disable=unused-import,ungrouped-imports
2236
from azure.core.credentials import TokenCredential
2337

24-
class HealthcareApisManagementClient:
38+
39+
class HealthcareApisManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2540
"""Azure Healthcare APIs Client.
2641
2742
:ivar services: ServicesOperations operations
@@ -56,12 +71,15 @@ class HealthcareApisManagementClient:
5671
:vartype operations: azure.mgmt.healthcareapis.operations.Operations
5772
:ivar operation_results: OperationResultsOperations operations
5873
:vartype operation_results: azure.mgmt.healthcareapis.operations.OperationResultsOperations
59-
:param credential: Credential needed for the client to connect to Azure.
74+
:param credential: Credential needed for the client to connect to Azure. Required.
6075
:type credential: ~azure.core.credentials.TokenCredential
61-
:param subscription_id: The subscription identifier.
76+
:param subscription_id: The subscription identifier. Required.
6277
:type subscription_id: str
63-
:param base_url: Service URL. Default value is 'https://management.azure.com'.
78+
:param base_url: Service URL. Default value is "https://management.azure.com".
6479
:type base_url: str
80+
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
81+
default value may result in unsupported behavior.
82+
:paramtype api_version: str
6583
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6684
Retry-After header is present.
6785
"""
@@ -73,33 +91,44 @@ def __init__(
7391
base_url: str = "https://management.azure.com",
7492
**kwargs: Any
7593
) -> None:
76-
self._config = HealthcareApisManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
94+
self._config = HealthcareApisManagementClientConfiguration(
95+
credential=credential, subscription_id=subscription_id, **kwargs
96+
)
7797
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7898

79-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
99+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
80100
self._serialize = Serializer(client_models)
81101
self._deserialize = Deserializer(client_models)
82102
self._serialize.client_side_validation = False
83103
self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize)
84-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
85-
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
104+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
105+
self._client, self._config, self._serialize, self._deserialize
106+
)
107+
self.private_link_resources = PrivateLinkResourcesOperations(
108+
self._client, self._config, self._serialize, self._deserialize
109+
)
86110
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
87111
self.dicom_services = DicomServicesOperations(self._client, self._config, self._serialize, self._deserialize)
88112
self.iot_connectors = IotConnectorsOperations(self._client, self._config, self._serialize, self._deserialize)
89-
self.fhir_destinations = FhirDestinationsOperations(self._client, self._config, self._serialize, self._deserialize)
90-
self.iot_connector_fhir_destination = IotConnectorFhirDestinationOperations(self._client, self._config, self._serialize, self._deserialize)
113+
self.fhir_destinations = FhirDestinationsOperations(
114+
self._client, self._config, self._serialize, self._deserialize
115+
)
116+
self.iot_connector_fhir_destination = IotConnectorFhirDestinationOperations(
117+
self._client, self._config, self._serialize, self._deserialize
118+
)
91119
self.fhir_services = FhirServicesOperations(self._client, self._config, self._serialize, self._deserialize)
92-
self.workspace_private_endpoint_connections = WorkspacePrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
93-
self.workspace_private_link_resources = WorkspacePrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
120+
self.workspace_private_endpoint_connections = WorkspacePrivateEndpointConnectionsOperations(
121+
self._client, self._config, self._serialize, self._deserialize
122+
)
123+
self.workspace_private_link_resources = WorkspacePrivateLinkResourcesOperations(
124+
self._client, self._config, self._serialize, self._deserialize
125+
)
94126
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
95-
self.operation_results = OperationResultsOperations(self._client, self._config, self._serialize, self._deserialize)
96-
127+
self.operation_results = OperationResultsOperations(
128+
self._client, self._config, self._serialize, self._deserialize
129+
)
97130

98-
def _send_request(
99-
self,
100-
request, # type: HttpRequest
101-
**kwargs: Any
102-
) -> HttpResponse:
131+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
103132
"""Runs the network request through the client's chained policies.
104133
105134
>>> from azure.core.rest import HttpRequest
@@ -108,7 +137,7 @@ def _send_request(
108137
>>> response = client._send_request(request)
109138
<HttpResponse: 200 OK>
110139
111-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
140+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
112141
113142
:param request: The network request you want to make. Required.
114143
:type request: ~azure.core.rest.HttpRequest
@@ -121,15 +150,12 @@ def _send_request(
121150
request_copy.url = self._client.format_url(request_copy.url)
122151
return self._client.send_request(request_copy, **kwargs)
123152

124-
def close(self):
125-
# type: () -> None
153+
def close(self) -> None:
126154
self._client.close()
127155

128-
def __enter__(self):
129-
# type: () -> HealthcareApisManagementClient
156+
def __enter__(self) -> "HealthcareApisManagementClient":
130157
self._client.__enter__()
131158
return self
132159

133-
def __exit__(self, *exc_details):
134-
# type: (Any) -> None
160+
def __exit__(self, *exc_details) -> None:
135161
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)