|
| 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) |
0 commit comments