From 767906b6a9bcacb09db4f3b13972f98764f60546 Mon Sep 17 00:00:00 2001 From: "Kaihui (Kerwin) Sun" Date: Mon, 1 Feb 2021 15:05:37 +0800 Subject: [PATCH] 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 <70930885+msyyc@users.noreply.github.com> * Fix changelog, setup, version Co-authored-by: SDKAuto Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- sdk/purview/azure-mgmt-purview/CHANGELOG.md | 5 + sdk/purview/azure-mgmt-purview/MANIFEST.in | 5 + sdk/purview/azure-mgmt-purview/README.md | 27 + .../azure-mgmt-purview/azure/__init__.py | 1 + .../azure-mgmt-purview/azure/mgmt/__init__.py | 1 + .../azure/mgmt/purview/__init__.py | 19 + .../azure/mgmt/purview/_configuration.py | 71 + .../azure/mgmt/purview/_metadata.json | 65 + .../purview/_purview_management_client.py | 89 + .../azure/mgmt/purview/_version.py | 9 + .../azure/mgmt/purview/aio/__init__.py | 10 + .../azure/mgmt/purview/aio/_configuration.py | 67 + .../purview/aio/_purview_management_client.py | 83 + .../mgmt/purview/aio/operations/__init__.py | 21 + .../aio/operations/_accounts_operations.py | 752 +++++++++ .../_default_accounts_operations.py | 222 +++ .../purview/aio/operations/_operations.py | 107 ++ ...private_endpoint_connections_operations.py | 386 +++++ .../_private_link_resources_operations.py | 184 ++ .../azure/mgmt/purview/models/__init__.py | 138 ++ .../azure/mgmt/purview/models/_models.py | 1373 +++++++++++++++ .../azure/mgmt/purview/models/_models_py3.py | 1478 +++++++++++++++++ .../_purview_management_client_enums.py | 82 + .../azure/mgmt/purview/operations/__init__.py | 21 + .../operations/_accounts_operations.py | 767 +++++++++ .../_default_accounts_operations.py | 229 +++ .../mgmt/purview/operations/_operations.py | 112 ++ ...private_endpoint_connections_operations.py | 395 +++++ .../_private_link_resources_operations.py | 190 +++ .../azure/mgmt/purview/py.typed | 1 + .../azure-mgmt-purview/sdk_packaging.toml | 7 + sdk/purview/azure-mgmt-purview/setup.cfg | 2 + sdk/purview/azure-mgmt-purview/setup.py | 91 + sdk/purview/ci.yml | 33 + 34 files changed, 7043 insertions(+) create mode 100644 sdk/purview/azure-mgmt-purview/CHANGELOG.md create mode 100644 sdk/purview/azure-mgmt-purview/MANIFEST.in create mode 100644 sdk/purview/azure-mgmt-purview/README.md create mode 100644 sdk/purview/azure-mgmt-purview/azure/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_purview_management_client.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_purview_management_client.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_accounts_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_default_accounts_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models_py3.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_purview_management_client_enums.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/__init__.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_accounts_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_default_accounts_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_link_resources_operations.py create mode 100644 sdk/purview/azure-mgmt-purview/azure/mgmt/purview/py.typed create mode 100644 sdk/purview/azure-mgmt-purview/sdk_packaging.toml create mode 100644 sdk/purview/azure-mgmt-purview/setup.cfg create mode 100644 sdk/purview/azure-mgmt-purview/setup.py create mode 100644 sdk/purview/ci.yml diff --git a/sdk/purview/azure-mgmt-purview/CHANGELOG.md b/sdk/purview/azure-mgmt-purview/CHANGELOG.md new file mode 100644 index 000000000000..e15790ab78c1 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (2021-02-01) + +* Initial Release diff --git a/sdk/purview/azure-mgmt-purview/MANIFEST.in b/sdk/purview/azure-mgmt-purview/MANIFEST.in new file mode 100644 index 000000000000..a3cb07df8765 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/purview/azure-mgmt-purview/README.md b/sdk/purview/azure-mgmt-purview/README.md new file mode 100644 index 000000000000..f502405614de --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Purview Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +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. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-purview%2FREADME.png) diff --git a/sdk/purview/azure-mgmt-purview/azure/__init__.py b/sdk/purview/azure-mgmt-purview/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/__init__.py new file mode 100644 index 000000000000..37b1aa4a9b3b --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._purview_management_client import PurviewManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['PurviewManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py new file mode 100644 index 000000000000..91cb571d92f8 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class PurviewManagementClientConfiguration(Configuration): + """Configuration for PurviewManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PurviewManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-12-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json new file mode 100644 index 000000000000..063b7d675577 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json @@ -0,0 +1,65 @@ +{ + "chosen_version": "2020-12-01-preview", + "total_api_version_list": ["2020-12-01-preview"], + "client": { + "name": "PurviewManagementClient", + "filename": "_purview_management_client", + "description": "Creates a Microsoft.Purview management client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription identifier.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription identifier.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "accounts": "AccountsOperations", + "default_accounts": "DefaultAccountsOperations", + "operations": "Operations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_purview_management_client.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_purview_management_client.py new file mode 100644 index 000000000000..50148e1f1238 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_purview_management_client.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import PurviewManagementClientConfiguration +from .operations import AccountsOperations +from .operations import DefaultAccountsOperations +from .operations import Operations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from . import models + + +class PurviewManagementClient(object): + """Creates a Microsoft.Purview management client. + + :ivar accounts: AccountsOperations operations + :vartype accounts: azure.mgmt.purview.operations.AccountsOperations + :ivar default_accounts: DefaultAccountsOperations operations + :vartype default_accounts: azure.mgmt.purview.operations.DefaultAccountsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.purview.operations.Operations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.purview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.purview.operations.PrivateLinkResourcesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = PurviewManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_accounts = DefaultAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> PurviewManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/__init__.py new file mode 100644 index 000000000000..9dad4e521c35 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._purview_management_client import PurviewManagementClient +__all__ = ['PurviewManagementClient'] diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py new file mode 100644 index 000000000000..9f4350734e62 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class PurviewManagementClientConfiguration(Configuration): + """Configuration for PurviewManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PurviewManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-12-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_purview_management_client.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_purview_management_client.py new file mode 100644 index 000000000000..ef650f5d042a --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_purview_management_client.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import PurviewManagementClientConfiguration +from .operations import AccountsOperations +from .operations import DefaultAccountsOperations +from .operations import Operations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .. import models + + +class PurviewManagementClient(object): + """Creates a Microsoft.Purview management client. + + :ivar accounts: AccountsOperations operations + :vartype accounts: azure.mgmt.purview.aio.operations.AccountsOperations + :ivar default_accounts: DefaultAccountsOperations operations + :vartype default_accounts: azure.mgmt.purview.aio.operations.DefaultAccountsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.purview.aio.operations.Operations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.purview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.purview.aio.operations.PrivateLinkResourcesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = PurviewManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_accounts = DefaultAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "PurviewManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/__init__.py new file mode 100644 index 000000000000..8a9b4793901f --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._accounts_operations import AccountsOperations +from ._default_accounts_operations import DefaultAccountsOperations +from ._operations import Operations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations + +__all__ = [ + 'AccountsOperations', + 'DefaultAccountsOperations', + 'Operations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', +] diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_accounts_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_accounts_operations.py new file mode 100644 index 000000000000..9faa886a3e52 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_accounts_operations.py @@ -0,0 +1,752 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AccountsOperations: + """AccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.AccountList"]: + """Gets the accounts resources by resource group. + + List accounts in ResourceGroup. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts'} # type: ignore + + def list_by_subscription( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.AccountList"]: + """Gets the accounts resources by subscription. + + List accounts in Subscription. + + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/accounts'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.Account": + """Gets the account resource. + + Get an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + account: "_models.Account", + **kwargs + ) -> "_models.Account": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account, 'Account') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + account: "_models.Account", + **kwargs + ) -> AsyncLROPoller["_models.Account"]: + """Create or update an account resource. + + Creates or updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account: The account. + :type account: ~azure.mgmt.purview.models.Account + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the account resource. + + Deletes an account resource. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + account_name: str, + account_update_parameters: "_models.AccountUpdateParameters", + **kwargs + ) -> "_models.Account": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + account_name: str, + account_update_parameters: "_models.AccountUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.Account"]: + """Patches the account resource. + + Updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account_update_parameters: The account update parameters. + :type account_update_parameters: ~azure.mgmt.purview.models.AccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.AccessKeys": + """Lists the keys asynchronous. + + List the authorization keys associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + + async def check_name_availability( + self, + check_name_availability_request: "_models.CheckNameAvailabilityRequest", + **kwargs + ) -> "_models.CheckNameAvailabilityResult": + """Checks the account name availability. + + Checks if account name is available. + + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: ~azure.mgmt.purview.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_default_accounts_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_default_accounts_operations.py new file mode 100644 index 000000000000..3df9a2115bac --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_default_accounts_operations.py @@ -0,0 +1,222 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DefaultAccountsOperations: + """DefaultAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + scope_tenant_id: str, + scope_type: Union[str, "_models.ScopeType"], + scope: Optional[str] = None, + **kwargs + ) -> "_models.DefaultAccountPayload": + """Gets the default account information set for the scope. + + Get the default account for the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Purview/getDefaultAccount'} # type: ignore + + async def set( + self, + default_account_payload: "_models.DefaultAccountPayload", + **kwargs + ) -> "_models.DefaultAccountPayload": + """Sets the default account for the scope. + + Set the default account for the scope. + + :param default_account_payload: The payload containing the default account information and the + scope. + :type default_account_payload: ~azure.mgmt.purview.models.DefaultAccountPayload + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(default_account_payload, 'DefaultAccountPayload') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set.metadata = {'url': '/providers/Microsoft.Purview/setDefaultAccount'} # type: ignore + + async def remove( + self, + scope_tenant_id: str, + scope_type: Union[str, "_models.ScopeType"], + scope: Optional[str] = None, + **kwargs + ) -> None: + """Removes the default account from the scope. + + Remove the default account from the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.remove.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + remove.metadata = {'url': '/providers/Microsoft.Purview/removeDefaultAccount'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_operations.py new file mode 100644 index 000000000000..cbde10d66c08 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.OperationList"]: + """Lists the available operations. + + List of available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Purview/operations'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_endpoint_connections_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..c6563831981f --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,386 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointConnectionList"]: + """Gets private endpoint connections. + + Get private endpoint connections for account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.PrivateEndpointConnectionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Gets private endpoint connection information. + + Get a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + request: "_models.PrivateEndpointConnection", + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Approves/Rejects private endpoint connection request. + + Create or update a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param request: The request. + :type request: ~azure.mgmt.purview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes private endpoint connection. + + Delete a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_link_resources_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..298971badec3 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateLinkResourceList"]: + """Gets a list of privately linkable resources for an account. + + Gets a list of privately linkable resources for an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.PrivateLinkResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources'} # type: ignore + + async def get_by_group_id( + self, + resource_group_name: str, + account_name: str, + group_id: str, + **kwargs + ) -> "_models.PrivateLinkResource": + """Gets a privately linkable resources for an account with given group identifier. + + Gets a privately linkable resources for an account with given group identifier. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param group_id: The group identifier. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_by_group_id.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_group_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py new file mode 100644 index 000000000000..1504d97411a5 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessKeys + from ._models_py3 import Account + from ._models_py3 import AccountEndpoints + from ._models_py3 import AccountList + from ._models_py3 import AccountPropertiesEndpoints + from ._models_py3 import AccountPropertiesManagedResources + from ._models_py3 import AccountSku + from ._models_py3 import AccountUpdateParameters + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudConnectors + from ._models_py3 import DefaultAccountPayload + from ._models_py3 import DeletedAccount + from ._models_py3 import DeletedAccountList + from ._models_py3 import DeletedAccountProperties + from ._models_py3 import DeletedAccountPropertiesAutoGenerated + from ._models_py3 import DimensionProperties + from ._models_py3 import ErrorModel + from ._models_py3 import ErrorResponseModel + from ._models_py3 import ErrorResponseModelError + from ._models_py3 import Identity + from ._models_py3 import ManagedResources + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import OperationMetaLogSpecification + from ._models_py3 import OperationMetaMetricSpecification + from ._models_py3 import OperationMetaServiceSpecification + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionList + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceList + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyResource + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import AccessKeys # type: ignore + from ._models import Account # type: ignore + from ._models import AccountEndpoints # type: ignore + from ._models import AccountList # type: ignore + from ._models import AccountPropertiesEndpoints # type: ignore + from ._models import AccountPropertiesManagedResources # type: ignore + from ._models import AccountSku # type: ignore + from ._models import AccountUpdateParameters # type: ignore + from ._models import CheckNameAvailabilityRequest # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudConnectors # type: ignore + from ._models import DefaultAccountPayload # type: ignore + from ._models import DeletedAccount # type: ignore + from ._models import DeletedAccountList # type: ignore + from ._models import DeletedAccountProperties # type: ignore + from ._models import DeletedAccountPropertiesAutoGenerated # type: ignore + from ._models import DimensionProperties # type: ignore + from ._models import ErrorModel # type: ignore + from ._models import ErrorResponseModel # type: ignore + from ._models import ErrorResponseModelError # type: ignore + from ._models import Identity # type: ignore + from ._models import ManagedResources # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import OperationMetaLogSpecification # type: ignore + from ._models import OperationMetaMetricSpecification # type: ignore + from ._models import OperationMetaServiceSpecification # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionList # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceList # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import TrackedResource # type: ignore + +from ._purview_management_client_enums import ( + Name, + ProvisioningState, + PublicNetworkAccess, + Reason, + ScopeType, + Status, + Type, +) + +__all__ = [ + 'AccessKeys', + 'Account', + 'AccountEndpoints', + 'AccountList', + 'AccountPropertiesEndpoints', + 'AccountPropertiesManagedResources', + 'AccountSku', + 'AccountUpdateParameters', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResult', + 'CloudConnectors', + 'DefaultAccountPayload', + 'DeletedAccount', + 'DeletedAccountList', + 'DeletedAccountProperties', + 'DeletedAccountPropertiesAutoGenerated', + 'DimensionProperties', + 'ErrorModel', + 'ErrorResponseModel', + 'ErrorResponseModelError', + 'Identity', + 'ManagedResources', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'OperationMetaLogSpecification', + 'OperationMetaMetricSpecification', + 'OperationMetaServiceSpecification', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionList', + 'PrivateLinkResource', + 'PrivateLinkResourceList', + 'PrivateLinkServiceConnectionState', + 'ProxyResource', + 'TrackedResource', + 'Name', + 'ProvisioningState', + 'PublicNetworkAccess', + 'Reason', + 'ScopeType', + 'Status', + 'Type', +] diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py new file mode 100644 index 000000000000..9e52cf2abfb5 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py @@ -0,0 +1,1373 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AccessKeys(msrest.serialization.Model): + """The Account access keys. + + :param atlas_kafka_primary_endpoint: Gets or sets the primary connection string. + :type atlas_kafka_primary_endpoint: str + :param atlas_kafka_secondary_endpoint: Gets or sets the secondary connection string. + :type atlas_kafka_secondary_endpoint: str + """ + + _attribute_map = { + 'atlas_kafka_primary_endpoint': {'key': 'atlasKafkaPrimaryEndpoint', 'type': 'str'}, + 'atlas_kafka_secondary_endpoint': {'key': 'atlasKafkaSecondaryEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.atlas_kafka_primary_endpoint = kwargs.get('atlas_kafka_primary_endpoint', None) + self.atlas_kafka_secondary_endpoint = kwargs.get('atlas_kafka_secondary_endpoint', None) + + +class TrackedResource(msrest.serialization.Model): + """Azure ARM Tracked Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + self.name = None + self.tags = kwargs.get('tags', None) + self.type = None + + +class Account(TrackedResource): + """Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + :param sku: Gets or sets the Sku. + :type sku: ~azure.mgmt.purview.models.AccountSku + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AccountSku'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Account, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.cloud_connectors = kwargs.get('cloud_connectors', None) + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = kwargs.get('public_network_access', None) + + +class AccountEndpoints(msrest.serialization.Model): + """The account endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountEndpoints, self).__init__(**kwargs) + self.catalog = None + self.guardian = None + self.scan = None + + +class AccountList(msrest.serialization.Model): + """Paged list of account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class AccountPropertiesEndpoints(AccountEndpoints): + """The URIs that are the public endpoints of the account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesEndpoints, self).__init__(**kwargs) + + +class ManagedResources(msrest.serialization.Model): + """The managed resources in customer subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedResources, self).__init__(**kwargs) + self.event_hub_namespace = None + self.resource_group = None + self.storage_account = None + + +class AccountPropertiesManagedResources(ManagedResources): + """Gets the resource identifiers of the managed resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesManagedResources, self).__init__(**kwargs) + + +class AccountSku(msrest.serialization.Model): + """The Sku. + + :param capacity: Gets or sets the sku capacity. Possible values include: 4, 16. + :type capacity: int + :param name: Gets or sets the sku name. Possible values include: "Standard". + :type name: str or ~azure.mgmt.purview.models.Name + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountSku, self).__init__(**kwargs) + self.capacity = kwargs.get('capacity', None) + self.name = kwargs.get('name', None) + + +class AccountUpdateParameters(msrest.serialization.Model): + """The account update properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.cloud_connectors = kwargs.get('cloud_connectors', None) + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = kwargs.get('public_network_access', None) + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The request payload for CheckNameAvailability API. + + :param name: Resource name to verify for availability. + :type name: str + :param type: Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The response payload for CheckNameAvailability API. + + :param message: Error message. + :type message: str + :param name_available: Indicates if name is valid and available. + :type name_available: bool + :param reason: The reason the name is not available. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.purview.models.Reason + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class CloudConnectors(msrest.serialization.Model): + """Properties for configuring third party cloud connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aws_external_id: AWS external identifier. + Configured in AWS to allow use of the role arn used for scanning. + :vartype aws_external_id: str + """ + + _validation = { + 'aws_external_id': {'readonly': True}, + } + + _attribute_map = { + 'aws_external_id': {'key': 'awsExternalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudConnectors, self).__init__(**kwargs) + self.aws_external_id = None + + +class DefaultAccountPayload(msrest.serialization.Model): + """Payload to get and set the default account in the given scope. + + :param account_name: The name of the account that is set as the default. + :type account_name: str + :param resource_group_name: The resource group name of the account that is set as the default. + :type resource_group_name: str + :param scope: The scope object ID. For example, sub ID or tenant ID. + :type scope: str + :param scope_tenant_id: The scope tenant in which the default account is set. + :type scope_tenant_id: str + :param scope_type: The scope where the default account is set. Possible values include: + "Tenant", "Subscription". + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param subscription_id: The subscription ID of the account that is set as the default. + :type subscription_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'scope_tenant_id': {'key': 'scopeTenantId', 'type': 'str'}, + 'scope_type': {'key': 'scopeType', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultAccountPayload, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.scope = kwargs.get('scope', None) + self.scope_tenant_id = kwargs.get('scope_tenant_id', None) + self.scope_type = kwargs.get('scope_type', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class ProxyResource(msrest.serialization.Model): + """Proxy Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DeletedAccount(ProxyResource): + """Soft Deleted Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'deleted_by': {'key': 'properties.deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.account_id = None + self.deleted_by = None + self.deletion_date = None + self.location = None + self.scheduled_purge_date = None + self.tags = None + + +class DeletedAccountList(msrest.serialization.Model): + """Paged list of soft deleted account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.DeletedAccount] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class DeletedAccountProperties(msrest.serialization.Model): + """The soft deleted account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountProperties, self).__init__(**kwargs) + self.account_id = None + self.deleted_by = None + self.deletion_date = None + self.location = None + self.scheduled_purge_date = None + self.tags = None + + +class DeletedAccountPropertiesAutoGenerated(DeletedAccountProperties): + """Gets or sets the properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountPropertiesAutoGenerated, self).__init__(**kwargs) + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + :param to_be_exported_for_customer: flag indicating whether this dimension should be included + to the customer in Azure Monitor logs (aka Shoebox). + :type to_be_exported_for_customer: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'to_be_exported_for_customer': {'key': 'toBeExportedForCustomer', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + self.to_be_exported_for_customer = kwargs.get('to_be_exported_for_customer', None) + + +class ErrorModel(msrest.serialization.Model): + """Default error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorModel, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorResponseModel(msrest.serialization.Model): + """Default error response model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Gets or sets the error. + :vartype error: ~azure.mgmt.purview.models.ErrorModel + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorModel'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModel, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseModelError(ErrorModel): + """Gets or sets the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModelError, self).__init__(**kwargs) + + +class Identity(msrest.serialization.Model): + """The Managed Identity of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Service principal object Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: Identity Type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.purview.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class Operation(msrest.serialization.Model): + """Operation resource. + + :param display: Properties on the operation. + :type display: ~azure.mgmt.purview.models.OperationDisplay + :param is_data_action: Whether operation is a data action. + :type is_data_action: bool + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: ~azure.mgmt.purview.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get('name', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """The response model for get operation properties. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class OperationList(msrest.serialization.Model): + """Paged list of operation resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = kwargs.get('blob_duration', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~azure.mgmt.purview.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param source_mdm_namespace: Metric namespace. + Only set the namespace if different from the default value, + leaving it empty makes it use the value from the ARM manifest. + :type source_mdm_namespace: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.display_description = kwargs.get('display_description', None) + self.display_name = kwargs.get('display_name', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + self.name = kwargs.get('name', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.unit = kwargs.get('unit', None) + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: list[~azure.mgmt.purview.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: list[~azure.mgmt.purview.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """A private endpoint class. + + :param id: The private endpoint identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :param private_endpoint: The private endpoint information. + :type private_endpoint: ~azure.mgmt.purview.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service connection state. + :type private_link_service_connection_state: + ~azure.mgmt.purview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionList(msrest.serialization.Model): + """Paged list of private endpoint connections. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateEndpointConnection] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class PrivateLinkResource(ProxyResource): + """A privately linkable resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :ivar group_id: The private link resource group identifier. + :vartype group_id: str + :ivar required_members: This translates to how many Private IPs should be created for each + privately linkable resource. + :vartype required_members: list[str] + :ivar required_zone_names: The required zone names for private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourceList(msrest.serialization.Model): + """Paged list of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The private link service connection state. + + :param actions_required: The required actions. + :type actions_required: str + :param description: The description. + :type description: str + :param status: The status. Possible values include: "Unknown", "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.purview.models.Status + """ + + _attribute_map = { + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.actions_required = kwargs.get('actions_required', None) + self.description = kwargs.get('description', None) + self.status = kwargs.get('status', None) diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models_py3.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models_py3.py new file mode 100644 index 000000000000..43cbc94109bb --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models_py3.py @@ -0,0 +1,1478 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._purview_management_client_enums import * + + +class AccessKeys(msrest.serialization.Model): + """The Account access keys. + + :param atlas_kafka_primary_endpoint: Gets or sets the primary connection string. + :type atlas_kafka_primary_endpoint: str + :param atlas_kafka_secondary_endpoint: Gets or sets the secondary connection string. + :type atlas_kafka_secondary_endpoint: str + """ + + _attribute_map = { + 'atlas_kafka_primary_endpoint': {'key': 'atlasKafkaPrimaryEndpoint', 'type': 'str'}, + 'atlas_kafka_secondary_endpoint': {'key': 'atlasKafkaSecondaryEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + atlas_kafka_primary_endpoint: Optional[str] = None, + atlas_kafka_secondary_endpoint: Optional[str] = None, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.atlas_kafka_primary_endpoint = atlas_kafka_primary_endpoint + self.atlas_kafka_secondary_endpoint = atlas_kafka_secondary_endpoint + + +class TrackedResource(msrest.serialization.Model): + """Azure ARM Tracked Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.identity = identity + self.location = location + self.name = None + self.tags = tags + self.type = None + + +class Account(TrackedResource): + """Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + :param sku: Gets or sets the Sku. + :type sku: ~azure.mgmt.purview.models.AccountSku + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AccountSku'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["AccountSku"] = None, + cloud_connectors: Optional["CloudConnectors"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + super(Account, self).__init__(identity=identity, location=location, tags=tags, **kwargs) + self.sku = sku + self.cloud_connectors = cloud_connectors + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = public_network_access + + +class AccountEndpoints(msrest.serialization.Model): + """The account endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountEndpoints, self).__init__(**kwargs) + self.catalog = None + self.guardian = None + self.scan = None + + +class AccountList(msrest.serialization.Model): + """Paged list of account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + *, + value: List["Account"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class AccountPropertiesEndpoints(AccountEndpoints): + """The URIs that are the public endpoints of the account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesEndpoints, self).__init__(**kwargs) + + +class ManagedResources(msrest.serialization.Model): + """The managed resources in customer subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedResources, self).__init__(**kwargs) + self.event_hub_namespace = None + self.resource_group = None + self.storage_account = None + + +class AccountPropertiesManagedResources(ManagedResources): + """Gets the resource identifiers of the managed resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesManagedResources, self).__init__(**kwargs) + + +class AccountSku(msrest.serialization.Model): + """The Sku. + + :param capacity: Gets or sets the sku capacity. Possible values include: 4, 16. + :type capacity: int + :param name: Gets or sets the sku name. Possible values include: "Standard". + :type name: str or ~azure.mgmt.purview.models.Name + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + capacity: Optional[int] = None, + name: Optional[Union[str, "Name"]] = None, + **kwargs + ): + super(AccountSku, self).__init__(**kwargs) + self.capacity = capacity + self.name = name + + +class AccountUpdateParameters(msrest.serialization.Model): + """The account update properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + cloud_connectors: Optional["CloudConnectors"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.cloud_connectors = cloud_connectors + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = public_network_access + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The request payload for CheckNameAvailability API. + + :param name: Resource name to verify for availability. + :type name: str + :param type: Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The response payload for CheckNameAvailability API. + + :param message: Error message. + :type message: str + :param name_available: Indicates if name is valid and available. + :type name_available: bool + :param reason: The reason the name is not available. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.purview.models.Reason + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "Reason"]] = None, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.reason = reason + + +class CloudConnectors(msrest.serialization.Model): + """Properties for configuring third party cloud connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aws_external_id: AWS external identifier. + Configured in AWS to allow use of the role arn used for scanning. + :vartype aws_external_id: str + """ + + _validation = { + 'aws_external_id': {'readonly': True}, + } + + _attribute_map = { + 'aws_external_id': {'key': 'awsExternalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudConnectors, self).__init__(**kwargs) + self.aws_external_id = None + + +class DefaultAccountPayload(msrest.serialization.Model): + """Payload to get and set the default account in the given scope. + + :param account_name: The name of the account that is set as the default. + :type account_name: str + :param resource_group_name: The resource group name of the account that is set as the default. + :type resource_group_name: str + :param scope: The scope object ID. For example, sub ID or tenant ID. + :type scope: str + :param scope_tenant_id: The scope tenant in which the default account is set. + :type scope_tenant_id: str + :param scope_type: The scope where the default account is set. Possible values include: + "Tenant", "Subscription". + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param subscription_id: The subscription ID of the account that is set as the default. + :type subscription_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'scope_tenant_id': {'key': 'scopeTenantId', 'type': 'str'}, + 'scope_type': {'key': 'scopeType', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + account_name: Optional[str] = None, + resource_group_name: Optional[str] = None, + scope: Optional[str] = None, + scope_tenant_id: Optional[str] = None, + scope_type: Optional[Union[str, "ScopeType"]] = None, + subscription_id: Optional[str] = None, + **kwargs + ): + super(DefaultAccountPayload, self).__init__(**kwargs) + self.account_name = account_name + self.resource_group_name = resource_group_name + self.scope = scope + self.scope_tenant_id = scope_tenant_id + self.scope_type = scope_type + self.subscription_id = subscription_id + + +class ProxyResource(msrest.serialization.Model): + """Proxy Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DeletedAccount(ProxyResource): + """Soft Deleted Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'deleted_by': {'key': 'properties.deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.account_id = None + self.deleted_by = None + self.deletion_date = None + self.location = None + self.scheduled_purge_date = None + self.tags = None + + +class DeletedAccountList(msrest.serialization.Model): + """Paged list of soft deleted account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.DeletedAccount] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + } + + def __init__( + self, + *, + value: List["DeletedAccount"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(DeletedAccountList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class DeletedAccountProperties(msrest.serialization.Model): + """The soft deleted account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountProperties, self).__init__(**kwargs) + self.account_id = None + self.deleted_by = None + self.deletion_date = None + self.location = None + self.scheduled_purge_date = None + self.tags = None + + +class DeletedAccountPropertiesAutoGenerated(DeletedAccountProperties): + """Gets or sets the properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_id: Gets the account identifier associated with resource. + :vartype account_id: str + :ivar deleted_by: Gets the user identifier that deleted resource. + :vartype deleted_by: str + :ivar deletion_date: Gets the time at which the resource was soft deleted. + :vartype deletion_date: ~datetime.datetime + :ivar location: Gets the resource location. + :vartype location: str + :ivar scheduled_purge_date: Gets the scheduled purge datetime. + :vartype scheduled_purge_date: ~datetime.datetime + :ivar tags: A set of tags. Gets the account tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'account_id': {'readonly': True}, + 'deleted_by': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'location': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountPropertiesAutoGenerated, self).__init__(**kwargs) + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + :param to_be_exported_for_customer: flag indicating whether this dimension should be included + to the customer in Azure Monitor logs (aka Shoebox). + :type to_be_exported_for_customer: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'to_be_exported_for_customer': {'key': 'toBeExportedForCustomer', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + name: Optional[str] = None, + to_be_exported_for_customer: Optional[bool] = None, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.name = name + self.to_be_exported_for_customer = to_be_exported_for_customer + + +class ErrorModel(msrest.serialization.Model): + """Default error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorModel, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorResponseModel(msrest.serialization.Model): + """Default error response model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Gets or sets the error. + :vartype error: ~azure.mgmt.purview.models.ErrorModel + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorModel'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModel, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseModelError(ErrorModel): + """Gets or sets the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModelError, self).__init__(**kwargs) + + +class Identity(msrest.serialization.Model): + """The Managed Identity of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Service principal object Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: Identity Type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.purview.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "Type"]] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class Operation(msrest.serialization.Model): + """Operation resource. + + :param display: Properties on the operation. + :type display: ~azure.mgmt.purview.models.OperationDisplay + :param is_data_action: Whether operation is a data action. + :type is_data_action: bool + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: ~azure.mgmt.purview.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + is_data_action: Optional[bool] = None, + name: Optional[str] = None, + origin: Optional[str] = None, + service_specification: Optional["OperationMetaServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.display = display + self.is_data_action = is_data_action + self.name = name + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """The response model for get operation properties. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + operation: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationList(msrest.serialization.Model): + """Paged list of operation resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: List["Operation"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + blob_duration: Optional[str] = None, + display_name: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = blob_duration + self.display_name = display_name + self.name = name + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~azure.mgmt.purview.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param source_mdm_namespace: Metric namespace. + Only set the namespace if different from the default value, + leaving it empty makes it use the value from the ARM manifest. + :type source_mdm_namespace: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + *, + aggregation_type: Optional[str] = None, + dimensions: Optional[List["DimensionProperties"]] = None, + display_description: Optional[str] = None, + display_name: Optional[str] = None, + enable_regional_mdm_account: Optional[str] = None, + internal_metric_name: Optional[str] = None, + name: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + supported_aggregation_types: Optional[List[str]] = None, + supported_time_grain_types: Optional[List[str]] = None, + unit: Optional[str] = None, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.display_description = display_description + self.display_name = display_name + self.enable_regional_mdm_account = enable_regional_mdm_account + self.internal_metric_name = internal_metric_name + self.name = name + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.source_mdm_namespace = source_mdm_namespace + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.unit = unit + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: list[~azure.mgmt.purview.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: list[~azure.mgmt.purview.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + *, + log_specifications: Optional[List["OperationMetaLogSpecification"]] = None, + metric_specifications: Optional[List["OperationMetaMetricSpecification"]] = None, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class PrivateEndpoint(msrest.serialization.Model): + """A private endpoint class. + + :param id: The private endpoint identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :param private_endpoint: The private endpoint information. + :type private_endpoint: ~azure.mgmt.purview.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service connection state. + :type private_link_service_connection_state: + ~azure.mgmt.purview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionList(msrest.serialization.Model): + """Paged list of private endpoint connections. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateEndpointConnection] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: List["PrivateEndpointConnection"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class PrivateLinkResource(ProxyResource): + """A privately linkable resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :ivar group_id: The private link resource group identifier. + :vartype group_id: str + :ivar required_members: This translates to how many Private IPs should be created for each + privately linkable resource. + :vartype required_members: list[str] + :ivar required_zone_names: The required zone names for private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourceList(msrest.serialization.Model): + """Paged list of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: List["PrivateLinkResource"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateLinkResourceList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The private link service connection state. + + :param actions_required: The required actions. + :type actions_required: str + :param description: The description. + :type description: str + :param status: The status. Possible values include: "Unknown", "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.purview.models.Status + """ + + _attribute_map = { + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + actions_required: Optional[str] = None, + description: Optional[str] = None, + status: Optional[Union[str, "Status"]] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.actions_required = actions_required + self.description = description + self.status = status diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_purview_management_client_enums.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_purview_management_client_enums.py new file mode 100644 index 000000000000..76998be29c9b --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_purview_management_client_enums.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the sku name. + """ + + STANDARD = "Standard" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the state of the provisioning. + """ + + UNKNOWN = "Unknown" + CREATING = "Creating" + MOVING = "Moving" + DELETING = "Deleting" + SOFT_DELETING = "SoftDeleting" + SOFT_DELETED = "SoftDeleted" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the public network access. + """ + + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason the name is not available. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class ScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + TENANT = "Tenant" + SUBSCRIPTION = "Subscription" + +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status. + """ + + UNKNOWN = "Unknown" + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity Type + """ + + SYSTEM_ASSIGNED = "SystemAssigned" diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/__init__.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/__init__.py new file mode 100644 index 000000000000..8a9b4793901f --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._accounts_operations import AccountsOperations +from ._default_accounts_operations import DefaultAccountsOperations +from ._operations import Operations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations + +__all__ = [ + 'AccountsOperations', + 'DefaultAccountsOperations', + 'Operations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', +] diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_accounts_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_accounts_operations.py new file mode 100644 index 000000000000..480df79a5593 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_accounts_operations.py @@ -0,0 +1,767 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AccountsOperations(object): + """AccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AccountList"] + """Gets the accounts resources by resource group. + + List accounts in ResourceGroup. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts'} # type: ignore + + def list_by_subscription( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AccountList"] + """Gets the accounts resources by subscription. + + List accounts in Subscription. + + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/accounts'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Account" + """Gets the account resource. + + Get an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + account, # type: "_models.Account" + **kwargs # type: Any + ): + # type: (...) -> "_models.Account" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account, 'Account') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + account, # type: "_models.Account" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Account"] + """Create or update an account resource. + + Creates or updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account: The account. + :type account: ~azure.mgmt.purview.models.Account + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the account resource. + + Deletes an account resource. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + account_update_parameters, # type: "_models.AccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.Account" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + account_name, # type: str + account_update_parameters, # type: "_models.AccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Account"] + """Patches the account resource. + + Updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account_update_parameters: The account update parameters. + :type account_update_parameters: ~azure.mgmt.purview.models.AccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Lists the keys asynchronous. + + List the authorization keys associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + + def check_name_availability( + self, + check_name_availability_request, # type: "_models.CheckNameAvailabilityRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResult" + """Checks the account name availability. + + Checks if account name is available. + + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: ~azure.mgmt.purview.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_default_accounts_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_default_accounts_operations.py new file mode 100644 index 000000000000..213d47843ac5 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_default_accounts_operations.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DefaultAccountsOperations(object): + """DefaultAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + scope_tenant_id, # type: str + scope_type, # type: Union[str, "_models.ScopeType"] + scope=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DefaultAccountPayload" + """Gets the default account information set for the scope. + + Get the default account for the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Purview/getDefaultAccount'} # type: ignore + + def set( + self, + default_account_payload, # type: "_models.DefaultAccountPayload" + **kwargs # type: Any + ): + # type: (...) -> "_models.DefaultAccountPayload" + """Sets the default account for the scope. + + Set the default account for the scope. + + :param default_account_payload: The payload containing the default account information and the + scope. + :type default_account_payload: ~azure.mgmt.purview.models.DefaultAccountPayload + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(default_account_payload, 'DefaultAccountPayload') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set.metadata = {'url': '/providers/Microsoft.Purview/setDefaultAccount'} # type: ignore + + def remove( + self, + scope_tenant_id, # type: str + scope_type, # type: Union[str, "_models.ScopeType"] + scope=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Removes the default account from the scope. + + Remove the default account from the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.remove.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + remove.metadata = {'url': '/providers/Microsoft.Purview/removeDefaultAccount'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py new file mode 100644 index 000000000000..fd7c0023bb2d --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationList"] + """Lists the available operations. + + List of available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Purview/operations'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_endpoint_connections_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..948ad0930b3f --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,395 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionList"] + """Gets private endpoint connections. + + Get private endpoint connections for account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.PrivateEndpointConnectionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets private endpoint connection information. + + Get a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + request, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Approves/Rejects private endpoint connection request. + + Create or update a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param request: The request. + :type request: ~azure.mgmt.purview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes private endpoint connection. + + Delete a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_link_resources_operations.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..60b056ce9031 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_private_link_resources_operations.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateLinkResourceList"] + """Gets a list of privately linkable resources for an account. + + Gets a list of privately linkable resources for an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.PrivateLinkResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourceList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseModel, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources'} # type: ignore + + def get_by_group_id( + self, + resource_group_name, # type: str + account_name, # type: str + group_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResource" + """Gets a privately linkable resources for an account with given group identifier. + + Gets a privately linkable resources for an account with given group identifier. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param group_id: The group identifier. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_by_group_id.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_group_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/py.typed b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/purview/azure-mgmt-purview/sdk_packaging.toml b/sdk/purview/azure-mgmt-purview/sdk_packaging.toml new file mode 100644 index 000000000000..3c0562c52e57 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-purview" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Purview Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/sdk/purview/azure-mgmt-purview/setup.cfg b/sdk/purview/azure-mgmt-purview/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/purview/azure-mgmt-purview/setup.py b/sdk/purview/azure-mgmt-purview/setup.py new file mode 100644 index 000000000000..58d51701caa9 --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-purview" +PACKAGE_PPRINT_NAME = "Purview Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/purview/ci.yml b/sdk/purview/ci.yml new file mode 100644 index 000000000000..cbca1962b45c --- /dev/null +++ b/sdk/purview/ci.yml @@ -0,0 +1,33 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/purview/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/purview/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: purview + Artifacts: + - name: azure_mgmt_purview + safeName: azuremgmtpurview \ No newline at end of file