Skip to content

Commit a4c1461

Browse files
[AutoRelease] t2-datashare-2022-10-31-80652(Do not merge) (Azure#27194)
* code and test * Update CHANGELOG.md * Update _version.py Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <424401670@qq.com>
1 parent 2185de2 commit a4c1461

File tree

115 files changed

+20351
-12741
lines changed

Some content is hidden

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

115 files changed

+20351
-12741
lines changed

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

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

3+
## 1.1.0b1 (2022-10-31)
4+
5+
### Features Added
6+
7+
- Added operation group EmailRegistrationsOperations
8+
39
## 1.0.0 (2021-04-12)
410

511
**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/datashare/py.typed

sdk/datashare/azure-mgmt-datashare/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 Data Share 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 [Data Share 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: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"autorest": "3.0.6369",
3-
"use": "@autorest/python@5.6.2",
4-
"commit": "36084f10aacb98d77af2f67c9d57fca2bbe68e97",
2+
"commit": "5fc05d0f0b15cbf16de942cadce464b495c66a58",
53
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6-
"autorest_command": "autorest specification/datashare/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.2 --version=3.0.6369",
4+
"autorest": "3.9.2",
5+
"use": [
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
8+
],
9+
"autorest_command": "autorest specification/datashare/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/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
710
"readme": "specification/datashare/resource-manager/readme.md"
811
}

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

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

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

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"DataShareManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

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

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

9-
from typing import TYPE_CHECKING
9+
import sys
10+
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
1213
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
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
19-
from typing import Any
20-
2125
from azure.core.credentials import TokenCredential
2226

2327

24-
class DataShareManagementClientConfiguration(Configuration):
28+
class DataShareManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2529
"""Configuration for DataShareManagementClient.
2630
2731
Note that all parameters used to create this instance are saved as instance
2832
attributes.
2933
30-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
3135
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: The subscription identifier.
36+
:param subscription_id: The subscription identifier. Required.
3337
:type subscription_id: str
38+
:keyword api_version: Api Version. Default value is "2020-09-01". Note that overriding this
39+
default value may result in unsupported behavior.
40+
:paramtype api_version: str
3441
"""
3542

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
43+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
44+
super(DataShareManagementClientConfiguration, self).__init__(**kwargs)
45+
api_version = kwargs.pop("api_version", "2020-09-01") # type: Literal["2020-09-01"]
46+
4347
if credential is None:
4448
raise ValueError("Parameter 'credential' must not be None.")
4549
if subscription_id is None:
4650
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(DataShareManagementClientConfiguration, self).__init__(**kwargs)
4851

4952
self.credential = credential
5053
self.subscription_id = subscription_id
51-
self.api_version = "2020-09-01"
52-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53-
kwargs.setdefault('sdk_moniker', 'mgmt-datashare/{}'.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-datashare/{}".format(VERSION))
5457
self._configure(**kwargs)
5558

5659
def _configure(
57-
self,
58-
**kwargs # type: Any
60+
self, **kwargs # type: Any
5961
):
6062
# type: (...) -> None
61-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69-
self.authentication_policy = kwargs.get('authentication_policy')
63+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
64+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
65+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
66+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
67+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
68+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
69+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
70+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
71+
self.authentication_policy = kwargs.get("authentication_policy")
7072
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
74+
self.credential, *self.credential_scopes, **kwargs
75+
)

sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_data_share_management_client.py

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

9-
from typing import TYPE_CHECKING
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
1011

12+
from azure.core.rest import HttpRequest, HttpResponse
1113
from azure.mgmt.core import ARMPipelineClient
12-
from msrest import Deserializer, Serializer
14+
15+
from . import models
16+
from ._configuration import DataShareManagementClientConfiguration
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
AccountsOperations,
20+
ConsumerInvitationsOperations,
21+
ConsumerSourceDataSetsOperations,
22+
DataSetMappingsOperations,
23+
DataSetsOperations,
24+
EmailRegistrationsOperations,
25+
InvitationsOperations,
26+
Operations,
27+
ProviderShareSubscriptionsOperations,
28+
ShareSubscriptionsOperations,
29+
SharesOperations,
30+
SynchronizationSettingsOperations,
31+
TriggersOperations,
32+
)
1333

1434
if TYPE_CHECKING:
1535
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1836
from azure.core.credentials import TokenCredential
1937

20-
from ._configuration import DataShareManagementClientConfiguration
21-
from .operations import AccountsOperations
22-
from .operations import ConsumerInvitationsOperations
23-
from .operations import DataSetsOperations
24-
from .operations import DataSetMappingsOperations
25-
from .operations import InvitationsOperations
26-
from .operations import Operations
27-
from .operations import SharesOperations
28-
from .operations import ProviderShareSubscriptionsOperations
29-
from .operations import ShareSubscriptionsOperations
30-
from .operations import ConsumerSourceDataSetsOperations
31-
from .operations import SynchronizationSettingsOperations
32-
from .operations import TriggersOperations
33-
from . import models
3438

35-
36-
class DataShareManagementClient(object):
39+
class DataShareManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3740
"""Creates a Microsoft.DataShare management client.
3841
3942
:ivar accounts: AccountsOperations operations
@@ -44,72 +47,105 @@ class DataShareManagementClient(object):
4447
:vartype data_sets: azure.mgmt.datashare.operations.DataSetsOperations
4548
:ivar data_set_mappings: DataSetMappingsOperations operations
4649
:vartype data_set_mappings: azure.mgmt.datashare.operations.DataSetMappingsOperations
50+
:ivar email_registrations: EmailRegistrationsOperations operations
51+
:vartype email_registrations: azure.mgmt.datashare.operations.EmailRegistrationsOperations
4752
:ivar invitations: InvitationsOperations operations
4853
:vartype invitations: azure.mgmt.datashare.operations.InvitationsOperations
4954
:ivar operations: Operations operations
5055
:vartype operations: azure.mgmt.datashare.operations.Operations
5156
:ivar shares: SharesOperations operations
5257
:vartype shares: azure.mgmt.datashare.operations.SharesOperations
5358
:ivar provider_share_subscriptions: ProviderShareSubscriptionsOperations operations
54-
:vartype provider_share_subscriptions: azure.mgmt.datashare.operations.ProviderShareSubscriptionsOperations
59+
:vartype provider_share_subscriptions:
60+
azure.mgmt.datashare.operations.ProviderShareSubscriptionsOperations
5561
:ivar share_subscriptions: ShareSubscriptionsOperations operations
5662
:vartype share_subscriptions: azure.mgmt.datashare.operations.ShareSubscriptionsOperations
5763
:ivar consumer_source_data_sets: ConsumerSourceDataSetsOperations operations
58-
:vartype consumer_source_data_sets: azure.mgmt.datashare.operations.ConsumerSourceDataSetsOperations
64+
:vartype consumer_source_data_sets:
65+
azure.mgmt.datashare.operations.ConsumerSourceDataSetsOperations
5966
:ivar synchronization_settings: SynchronizationSettingsOperations operations
60-
:vartype synchronization_settings: azure.mgmt.datashare.operations.SynchronizationSettingsOperations
67+
:vartype synchronization_settings:
68+
azure.mgmt.datashare.operations.SynchronizationSettingsOperations
6169
:ivar triggers: TriggersOperations operations
6270
:vartype triggers: azure.mgmt.datashare.operations.TriggersOperations
63-
:param credential: Credential needed for the client to connect to Azure.
71+
:param credential: Credential needed for the client to connect to Azure. Required.
6472
:type credential: ~azure.core.credentials.TokenCredential
65-
:param subscription_id: The subscription identifier.
73+
:param subscription_id: The subscription identifier. Required.
6674
:type subscription_id: str
67-
:param str base_url: Service URL
68-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
75+
:param base_url: Service URL. Default value is "https://management.azure.com".
76+
:type base_url: str
77+
:keyword api_version: Api Version. Default value is "2020-09-01". Note that overriding this
78+
default value may result in unsupported behavior.
79+
:paramtype api_version: str
80+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
81+
Retry-After header is present.
6982
"""
7083

7184
def __init__(
7285
self,
73-
credential, # type: "TokenCredential"
74-
subscription_id, # type: str
75-
base_url=None, # type: Optional[str]
76-
**kwargs # type: Any
77-
):
78-
# type: (...) -> None
79-
if not base_url:
80-
base_url = 'https://management.azure.com'
81-
self._config = DataShareManagementClientConfiguration(credential, subscription_id, **kwargs)
86+
credential: "TokenCredential",
87+
subscription_id: str,
88+
base_url: str = "https://management.azure.com",
89+
**kwargs: Any
90+
) -> None:
91+
self._config = DataShareManagementClientConfiguration(
92+
credential=credential, subscription_id=subscription_id, **kwargs
93+
)
8294
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8395

8496
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8597
self._serialize = Serializer(client_models)
86-
self._serialize.client_side_validation = False
8798
self._deserialize = Deserializer(client_models)
88-
89-
self.accounts = AccountsOperations(
90-
self._client, self._config, self._serialize, self._deserialize)
99+
self._serialize.client_side_validation = False
100+
self.accounts = AccountsOperations(self._client, self._config, self._serialize, self._deserialize)
91101
self.consumer_invitations = ConsumerInvitationsOperations(
92-
self._client, self._config, self._serialize, self._deserialize)
93-
self.data_sets = DataSetsOperations(
94-
self._client, self._config, self._serialize, self._deserialize)
102+
self._client, self._config, self._serialize, self._deserialize
103+
)
104+
self.data_sets = DataSetsOperations(self._client, self._config, self._serialize, self._deserialize)
95105
self.data_set_mappings = DataSetMappingsOperations(
96-
self._client, self._config, self._serialize, self._deserialize)
97-
self.invitations = InvitationsOperations(
98-
self._client, self._config, self._serialize, self._deserialize)
99-
self.operations = Operations(
100-
self._client, self._config, self._serialize, self._deserialize)
101-
self.shares = SharesOperations(
102-
self._client, self._config, self._serialize, self._deserialize)
106+
self._client, self._config, self._serialize, self._deserialize
107+
)
108+
self.email_registrations = EmailRegistrationsOperations(
109+
self._client, self._config, self._serialize, self._deserialize
110+
)
111+
self.invitations = InvitationsOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
113+
self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize)
103114
self.provider_share_subscriptions = ProviderShareSubscriptionsOperations(
104-
self._client, self._config, self._serialize, self._deserialize)
115+
self._client, self._config, self._serialize, self._deserialize
116+
)
105117
self.share_subscriptions = ShareSubscriptionsOperations(
106-
self._client, self._config, self._serialize, self._deserialize)
118+
self._client, self._config, self._serialize, self._deserialize
119+
)
107120
self.consumer_source_data_sets = ConsumerSourceDataSetsOperations(
108-
self._client, self._config, self._serialize, self._deserialize)
121+
self._client, self._config, self._serialize, self._deserialize
122+
)
109123
self.synchronization_settings = SynchronizationSettingsOperations(
110-
self._client, self._config, self._serialize, self._deserialize)
111-
self.triggers = TriggersOperations(
112-
self._client, self._config, self._serialize, self._deserialize)
124+
self._client, self._config, self._serialize, self._deserialize
125+
)
126+
self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize)
127+
128+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
129+
"""Runs the network request through the client's chained policies.
130+
131+
>>> from azure.core.rest import HttpRequest
132+
>>> request = HttpRequest("GET", "https://www.example.org/")
133+
<HttpRequest [GET], url: 'https://www.example.org/'>
134+
>>> response = client._send_request(request)
135+
<HttpResponse: 200 OK>
136+
137+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
138+
139+
:param request: The network request you want to make. Required.
140+
:type request: ~azure.core.rest.HttpRequest
141+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
142+
:return: The response of your network call. Does not do error handling on your response.
143+
:rtype: ~azure.core.rest.HttpResponse
144+
"""
145+
146+
request_copy = deepcopy(request)
147+
request_copy.url = self._client.format_url(request_copy.url)
148+
return self._client.send_request(request_copy, **kwargs)
113149

114150
def close(self):
115151
# type: () -> None

0 commit comments

Comments
 (0)