Skip to content

Commit 767906b

Browse files
00Kai0SDKAutomsyyc
authored
First release purview (#16440)
* CodeGen from PR 12634 in Azure/azure-rest-api-specs Upgrade to python track2 sdk for purview (#12634) * upgrade to python track2 sdk for purview * Update readme.md * Update readme.md * fix Co-authored-by: msyyc <[email protected]> * Fix changelog, setup, version Co-authored-by: SDKAuto <[email protected]> Co-authored-by: msyyc <[email protected]>
1 parent 8e28ce6 commit 767906b

34 files changed

+7043
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (2021-02-01)
4+
5+
* Initial Release
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
recursive-include tests *.py *.yaml
2+
include *.md
3+
include azure/__init__.py
4+
include azure/mgmt/__init__.py
5+
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Purview Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
8+
# Usage
9+
10+
11+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
12+
13+
14+
15+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
16+
Code samples for this package can be found at [Purview Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
17+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
18+
19+
20+
# Provide Feedback
21+
22+
If you encounter any bugs or have suggestions, please file an issue in the
23+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
24+
section of the project.
25+
26+
27+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-purview%2FREADME.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._purview_management_client import PurviewManagementClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['PurviewManagementClient']
14+
15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class PurviewManagementClientConfiguration(Configuration):
25+
"""Configuration for PurviewManagementClient.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: The subscription identifier.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(PurviewManagementClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2020-12-01-preview"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# 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')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"chosen_version": "2020-12-01-preview",
3+
"total_api_version_list": ["2020-12-01-preview"],
4+
"client": {
5+
"name": "PurviewManagementClient",
6+
"filename": "_purview_management_client",
7+
"description": "Creates a Microsoft.Purview management client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "The subscription identifier.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "The subscription identifier.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"accounts": "AccountsOperations",
56+
"default_accounts": "DefaultAccountsOperations",
57+
"operations": "Operations",
58+
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
59+
"private_link_resources": "PrivateLinkResourcesOperations"
60+
},
61+
"operation_mixins": {
62+
},
63+
"sync_imports": "None",
64+
"async_imports": "None"
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
20+
from ._configuration import PurviewManagementClientConfiguration
21+
from .operations import AccountsOperations
22+
from .operations import DefaultAccountsOperations
23+
from .operations import Operations
24+
from .operations import PrivateEndpointConnectionsOperations
25+
from .operations import PrivateLinkResourcesOperations
26+
from . import models
27+
28+
29+
class PurviewManagementClient(object):
30+
"""Creates a Microsoft.Purview management client.
31+
32+
:ivar accounts: AccountsOperations operations
33+
:vartype accounts: azure.mgmt.purview.operations.AccountsOperations
34+
:ivar default_accounts: DefaultAccountsOperations operations
35+
:vartype default_accounts: azure.mgmt.purview.operations.DefaultAccountsOperations
36+
:ivar operations: Operations operations
37+
:vartype operations: azure.mgmt.purview.operations.Operations
38+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
39+
:vartype private_endpoint_connections: azure.mgmt.purview.operations.PrivateEndpointConnectionsOperations
40+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
41+
:vartype private_link_resources: azure.mgmt.purview.operations.PrivateLinkResourcesOperations
42+
:param credential: Credential needed for the client to connect to Azure.
43+
:type credential: ~azure.core.credentials.TokenCredential
44+
:param subscription_id: The subscription identifier.
45+
:type subscription_id: str
46+
:param str base_url: Service URL
47+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
48+
"""
49+
50+
def __init__(
51+
self,
52+
credential, # type: "TokenCredential"
53+
subscription_id, # type: str
54+
base_url=None, # type: Optional[str]
55+
**kwargs # type: Any
56+
):
57+
# type: (...) -> None
58+
if not base_url:
59+
base_url = 'https://management.azure.com'
60+
self._config = PurviewManagementClientConfiguration(credential, subscription_id, **kwargs)
61+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
62+
63+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
64+
self._serialize = Serializer(client_models)
65+
self._deserialize = Deserializer(client_models)
66+
67+
self.accounts = AccountsOperations(
68+
self._client, self._config, self._serialize, self._deserialize)
69+
self.default_accounts = DefaultAccountsOperations(
70+
self._client, self._config, self._serialize, self._deserialize)
71+
self.operations = Operations(
72+
self._client, self._config, self._serialize, self._deserialize)
73+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
74+
self._client, self._config, self._serialize, self._deserialize)
75+
self.private_link_resources = PrivateLinkResourcesOperations(
76+
self._client, self._config, self._serialize, self._deserialize)
77+
78+
def close(self):
79+
# type: () -> None
80+
self._client.close()
81+
82+
def __enter__(self):
83+
# type: () -> PurviewManagementClient
84+
self._client.__enter__()
85+
return self
86+
87+
def __exit__(self, *exc_details):
88+
# type: (Any) -> None
89+
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
VERSION = "1.0.0b1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._purview_management_client import PurviewManagementClient
10+
__all__ = ['PurviewManagementClient']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from .._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from azure.core.credentials_async import AsyncTokenCredential
20+
21+
22+
class PurviewManagementClientConfiguration(Configuration):
23+
"""Configuration for PurviewManagementClient.
24+
25+
Note that all parameters used to create this instance are saved as instance
26+
attributes.
27+
28+
:param credential: Credential needed for the client to connect to Azure.
29+
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
30+
:param subscription_id: The subscription identifier.
31+
:type subscription_id: str
32+
"""
33+
34+
def __init__(
35+
self,
36+
credential: "AsyncTokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
if credential is None:
41+
raise ValueError("Parameter 'credential' must not be None.")
42+
if subscription_id is None:
43+
raise ValueError("Parameter 'subscription_id' must not be None.")
44+
super(PurviewManagementClientConfiguration, self).__init__(**kwargs)
45+
46+
self.credential = credential
47+
self.subscription_id = subscription_id
48+
self.api_version = "2020-12-01-preview"
49+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50+
kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION))
51+
self._configure(**kwargs)
52+
53+
def _configure(
54+
self,
55+
**kwargs: Any
56+
) -> None:
57+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
58+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
59+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
60+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
61+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
62+
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
63+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
64+
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
65+
self.authentication_policy = kwargs.get('authentication_policy')
66+
if self.credential and not self.authentication_policy:
67+
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)