diff --git a/sdk/purview/azure-mgmt-purview/CHANGELOG.md b/sdk/purview/azure-mgmt-purview/CHANGELOG.md index e15790ab78c1..4f99ca595fec 100644 --- a/sdk/purview/azure-mgmt-purview/CHANGELOG.md +++ b/sdk/purview/azure-mgmt-purview/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 1.0.0 (2021-08-13) + +**Features** + + - Model Account has a new parameter managed_resource_group_name + - Model Account has a new parameter system_data + - Model TrackedResource has a new parameter system_data + - Model PrivateLinkResource has a new parameter properties + - Added operation AccountsOperations.add_root_collection_admin + - Added operation PrivateEndpointConnectionsOperations.begin_create_or_update + +**Breaking changes** + + - Model PrivateLinkResource no longer has parameter required_zone_names + - Model PrivateLinkResource no longer has parameter group_id + - Model PrivateLinkResource no longer has parameter required_members + - Model AccountUpdateParameters has a new signature + - Removed operation PrivateEndpointConnectionsOperations.create_or_update + ## 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 index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/purview/azure-mgmt-purview/MANIFEST.in +++ b/sdk/purview/azure-mgmt-purview/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/purview/azure-mgmt-purview/_meta.json b/sdk/purview/azure-mgmt-purview/_meta.json new file mode 100644 index 000000000000..8f43a3a92d0a --- /dev/null +++ b/sdk/purview/azure-mgmt-purview/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "ebe90b1dfef9ec9706dee06e84676a6c6979ab53", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/purview/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/purview/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py index 91cb571d92f8..19097948256d 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-01-preview" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) self._configure(**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 index 063b7d675577..96fa45190246 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2020-12-01-preview", - "total_api_version_list": ["2020-12-01-preview"], + "chosen_version": "2021-07-01", + "total_api_version_list": ["2021-07-01"], "client": { "name": "PurviewManagementClient", "filename": "_purview_management_client", @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"PurviewManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"PurviewManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"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", + "signature": "subscription_id: str,", "description": "The subscription identifier.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "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 + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "accounts": "AccountsOperations", @@ -57,9 +103,5 @@ "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 index 50148e1f1238..0c4cbaf22df6 100644 --- 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 @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import PurviewManagementClientConfiguration from .operations import AccountsOperations @@ -62,6 +63,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.accounts = AccountsOperations( @@ -75,6 +77,24 @@ def __init__( self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py index e5754a47ce68..c47f66669f1b 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" 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 index 9f4350734e62..0fe146e261e7 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-01-preview" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) self._configure(**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 index ef650f5d042a..7d856ac75df6 100644 --- 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 @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -59,6 +60,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.accounts = AccountsOperations( @@ -72,6 +74,23 @@ def __init__( self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() 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 index 9faa886a3e52..6a8a8f6bae95 100644 --- 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 @@ -47,7 +47,7 @@ def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AccountList"]: """Gets the accounts resources by resource group. @@ -67,7 +67,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -110,7 +110,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -124,7 +124,7 @@ async def get_next(next_link=None): def list_by_subscription( self, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AccountList"]: """Gets the accounts resources by subscription. @@ -142,7 +142,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -184,7 +184,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -199,7 +199,7 @@ async def get( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.Account": """Gets the account resource. @@ -219,7 +219,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -245,7 +245,7 @@ async def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) @@ -261,14 +261,14 @@ async def _create_or_update_initial( resource_group_name: str, account_name: str, account: "_models.Account", - **kwargs + **kwargs: Any ) -> "_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" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -299,7 +299,7 @@ async def _create_or_update_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -319,7 +319,7 @@ async def begin_create_or_update( resource_group_name: str, account_name: str, account: "_models.Account", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Account"]: """Create or update an account resource. @@ -333,8 +333,8 @@ async def begin_create_or_update( :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 + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -391,14 +391,14 @@ async def _delete_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> 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" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -424,7 +424,7 @@ async def _delete_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -436,7 +436,7 @@ async def begin_delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the account resource. @@ -448,8 +448,8 @@ async def begin_delete( :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 + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -503,14 +503,14 @@ async def _update_initial( resource_group_name: str, account_name: str, account_update_parameters: "_models.AccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_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" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -541,7 +541,7 @@ async def _update_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -561,7 +561,7 @@ async def begin_update( resource_group_name: str, account_name: str, account_update_parameters: "_models.AccountUpdateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Account"]: """Patches the account resource. @@ -575,8 +575,8 @@ async def begin_update( :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 + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -633,7 +633,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessKeys": """Lists the keys asynchronous. @@ -653,7 +653,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -679,7 +679,7 @@ async def list_keys( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -690,10 +690,76 @@ async def list_keys( return deserialized list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + async def add_root_collection_admin( + self, + resource_group_name: str, + account_name: str, + collection_admin_update: "_models.CollectionAdminUpdate", + **kwargs: Any + ) -> None: + """Add the administrator for root collection. + + Add the administrator for root collection 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 + :param collection_admin_update: The collection admin update payload. + :type collection_admin_update: ~azure.mgmt.purview.models.CollectionAdminUpdate + :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 = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_root_collection_admin.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(collection_admin_update, 'CollectionAdminUpdate') + 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.failsafe_deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + add_root_collection_admin.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/addRootCollectionAdmin'} # type: ignore + async def check_name_availability( self, check_name_availability_request: "_models.CheckNameAvailabilityRequest", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks the account name availability. @@ -711,7 +777,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -740,7 +806,7 @@ async def check_name_availability( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) 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 index 3df9a2115bac..2035ebb4737f 100644 --- 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 @@ -45,7 +45,7 @@ async def get( scope_tenant_id: str, scope_type: Union[str, "_models.ScopeType"], scope: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.DefaultAccountPayload": """Gets the default account information set for the scope. @@ -68,7 +68,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -92,7 +92,7 @@ async def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) @@ -106,11 +106,11 @@ async def get( async def set( self, default_account_payload: "_models.DefaultAccountPayload", - **kwargs + **kwargs: Any ) -> "_models.DefaultAccountPayload": """Sets the default account for the scope. - Set the default account for the scope. + Sets the default account for the scope. :param default_account_payload: The payload containing the default account information and the scope. @@ -125,7 +125,7 @@ async def set( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -150,7 +150,7 @@ async def set( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) @@ -166,11 +166,11 @@ async def remove( scope_tenant_id: str, scope_type: Union[str, "_models.ScopeType"], scope: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Removes the default account from the scope. - Remove the default account from the scope. + Removes the default account from the scope. :param scope_tenant_id: The tenant ID. :type scope_tenant_id: str @@ -189,7 +189,7 @@ async def remove( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -213,7 +213,7 @@ async def remove( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 index cbde10d66c08..6a19ac9e24db 100644 --- 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 @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """Lists the available operations. @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -95,7 +95,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) 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 index c6563831981f..9e91fc476e11 100644 --- 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 @@ -48,7 +48,7 @@ def list_by_account( resource_group_name: str, account_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionList"]: """Gets private endpoint connections. @@ -70,7 +70,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -114,7 +114,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -130,7 +130,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets private endpoint connection information. @@ -152,7 +152,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -179,7 +179,7 @@ async def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -190,42 +190,25 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - async def create_or_update( + async def _create_or_update_initial( self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, request: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_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" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + 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'), @@ -252,7 +235,7 @@ async def create_or_update( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -265,21 +248,99 @@ async def create_or_update( 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + request: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> AsyncLROPoller["_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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + 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, + private_endpoint_connection_name=private_endpoint_connection_name, + request=request, + 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('PrivateEndpointConnection', 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'), + '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_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 + **kwargs: Any ) -> 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" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -306,7 +367,7 @@ async def _delete_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -319,7 +380,7 @@ async def begin_delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes private endpoint connection. @@ -333,8 +394,8 @@ async def begin_delete( :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 + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) 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 index 298971badec3..9a2669ee2ccb 100644 --- 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 @@ -45,7 +45,7 @@ def list_by_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateLinkResourceList"]: """Gets a list of privately linkable resources for an account. @@ -65,7 +65,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -123,7 +123,7 @@ async def get_by_group_id( resource_group_name: str, account_name: str, group_id: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResource": """Gets a privately linkable resources for an account with given group identifier. @@ -145,7 +145,7 @@ async def get_by_group_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -172,7 +172,7 @@ async def get_by_group_id( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResource', pipeline_response) 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 index 1504d97411a5..e958a3eaf6e1 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/__init__.py @@ -11,6 +11,7 @@ from ._models_py3 import Account from ._models_py3 import AccountEndpoints from ._models_py3 import AccountList + from ._models_py3 import AccountProperties from ._models_py3 import AccountPropertiesEndpoints from ._models_py3 import AccountPropertiesManagedResources from ._models_py3 import AccountSku @@ -18,11 +19,8 @@ from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResult from ._models_py3 import CloudConnectors + from ._models_py3 import CollectionAdminUpdate 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 @@ -40,14 +38,18 @@ from ._models_py3 import PrivateEndpointConnectionList from ._models_py3 import PrivateLinkResource from ._models_py3 import PrivateLinkResourceList + from ._models_py3 import PrivateLinkResourceProperties from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource + from ._models_py3 import SystemData from ._models_py3 import TrackedResource + from ._models_py3 import TrackedResourceSystemData 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 AccountProperties # type: ignore from ._models import AccountPropertiesEndpoints # type: ignore from ._models import AccountPropertiesManagedResources # type: ignore from ._models import AccountSku # type: ignore @@ -55,11 +57,8 @@ from ._models import CheckNameAvailabilityRequest # type: ignore from ._models import CheckNameAvailabilityResult # type: ignore from ._models import CloudConnectors # type: ignore + from ._models import CollectionAdminUpdate # 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 @@ -77,11 +76,16 @@ from ._models import PrivateEndpointConnectionList # type: ignore from ._models import PrivateLinkResource # type: ignore from ._models import PrivateLinkResourceList # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore from ._models import PrivateLinkServiceConnectionState # type: ignore from ._models import ProxyResource # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore + from ._models import TrackedResourceSystemData # type: ignore from ._purview_management_client_enums import ( + CreatedByType, + LastModifiedByType, Name, ProvisioningState, PublicNetworkAccess, @@ -96,6 +100,7 @@ 'Account', 'AccountEndpoints', 'AccountList', + 'AccountProperties', 'AccountPropertiesEndpoints', 'AccountPropertiesManagedResources', 'AccountSku', @@ -103,11 +108,8 @@ 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResult', 'CloudConnectors', + 'CollectionAdminUpdate', 'DefaultAccountPayload', - 'DeletedAccount', - 'DeletedAccountList', - 'DeletedAccountProperties', - 'DeletedAccountPropertiesAutoGenerated', 'DimensionProperties', 'ErrorModel', 'ErrorResponseModel', @@ -125,9 +127,14 @@ 'PrivateEndpointConnectionList', 'PrivateLinkResource', 'PrivateLinkResourceList', + 'PrivateLinkResourceProperties', 'PrivateLinkServiceConnectionState', 'ProxyResource', + 'SystemData', 'TrackedResource', + 'TrackedResourceSystemData', + 'CreatedByType', + 'LastModifiedByType', 'Name', 'ProvisioningState', 'PublicNetworkAccess', 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 index 9e52cf2abfb5..b0e8450b34b1 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/models/_models.py @@ -46,6 +46,8 @@ class TrackedResource(msrest.serialization.Model): :type location: str :ivar name: Gets or sets the name. :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.TrackedResourceSystemData :param tags: A set of tags. Tags on the azure resource. :type tags: dict[str, str] :ivar type: Gets or sets the type. @@ -55,6 +57,7 @@ class TrackedResource(msrest.serialization.Model): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'system_data': {'readonly': True}, 'type': {'readonly': True}, } @@ -63,6 +66,7 @@ class TrackedResource(msrest.serialization.Model): 'identity': {'key': 'identity', 'type': 'Identity'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'TrackedResourceSystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -76,6 +80,7 @@ def __init__( self.identity = kwargs.get('identity', None) self.location = kwargs.get('location', None) self.name = None + self.system_data = None self.tags = kwargs.get('tags', None) self.type = None @@ -93,6 +98,8 @@ class Account(TrackedResource): :type location: str :ivar name: Gets or sets the name. :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.TrackedResourceSystemData :param tags: A set of tags. Tags on the azure resource. :type tags: dict[str, str] :ivar type: Gets or sets the type. @@ -109,26 +116,29 @@ class Account(TrackedResource): :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 + :vartype endpoints: ~azure.mgmt.purview.models.AccountPropertiesEndpoints :ivar friendly_name: Gets or sets the friendly name. :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str :ivar managed_resources: Gets the resource identifiers of the managed resources. - :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :vartype managed_resources: ~azure.mgmt.purview.models.AccountPropertiesManagedResources :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". + "Succeeded", "Canceled". :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". + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'system_data': {'readonly': True}, 'type': {'readonly': True}, 'created_at': {'readonly': True}, 'created_by': {'readonly': True}, @@ -145,6 +155,7 @@ class Account(TrackedResource): 'identity': {'key': 'identity', 'type': 'Identity'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'TrackedResourceSystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AccountSku'}, @@ -152,9 +163,10 @@ class Account(TrackedResource): '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'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountPropertiesEndpoints'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'AccountPropertiesManagedResources'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, @@ -172,10 +184,11 @@ def __init__( self.created_by_object_id = None self.endpoints = None self.friendly_name = None + self.managed_resource_group_name = kwargs.get('managed_resource_group_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) + self.public_network_access = kwargs.get('public_network_access', "Enabled") class AccountEndpoints(msrest.serialization.Model): @@ -246,6 +259,83 @@ def __init__( self.value = kwargs['value'] +class AccountProperties(msrest.serialization.Model): + """The account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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.AccountPropertiesEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.AccountPropertiesManagedResources + :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", "Canceled". + :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". Default value: "Enabled". + :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 = { + 'cloud_connectors': {'key': 'cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'AccountPropertiesEndpoints'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'managedResources', 'type': 'AccountPropertiesManagedResources'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountProperties, self).__init__(**kwargs) + 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_resource_group_name = kwargs.get('managed_resource_group_name', None) + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = kwargs.get('public_network_access', "Enabled") + + class AccountPropertiesEndpoints(AccountEndpoints): """The URIs that are the public endpoints of the account. @@ -373,60 +463,15 @@ def __init__( 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 properties: The account properties. + :type properties: ~azure.mgmt.purview.models.AccountProperties :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 = { + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, '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__( @@ -434,17 +479,8 @@ def __init__( **kwargs ): super(AccountUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) 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): @@ -499,7 +535,7 @@ def __init__( class CloudConnectors(msrest.serialization.Model): - """Properties for configuring third party cloud connections. + """CloudConnectors. Variables are only populated by the server, and will be ignored when sending a request. @@ -524,6 +560,25 @@ def __init__( self.aws_external_id = None +class CollectionAdminUpdate(msrest.serialization.Model): + """Collection administrator update. + + :param object_id: Gets or sets the object identifier of the admin. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CollectionAdminUpdate, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) + + class DefaultAccountPayload(msrest.serialization.Model): """Payload to get and set the default account in the given scope. @@ -564,230 +619,6 @@ def __init__( 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. @@ -862,7 +693,7 @@ class ErrorResponseModel(msrest.serialization.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 + :vartype error: ~azure.mgmt.purview.models.ErrorResponseModelError """ _validation = { @@ -870,7 +701,7 @@ class ErrorResponseModel(msrest.serialization.Model): } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorModel'}, + 'error': {'key': 'error', 'type': 'ErrorResponseModelError'}, } def __init__( @@ -1185,6 +1016,41 @@ def __init__( self.id = kwargs.get('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 PrivateEndpointConnection(ProxyResource): """A private endpoint connection class. @@ -1264,42 +1130,33 @@ def __init__( self.value = kwargs['value'] -class PrivateLinkResource(ProxyResource): +class PrivateLinkResource(msrest.serialization.Model): """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. + :ivar id: The private link resource identifier. :vartype id: str - :ivar name: Gets or sets the name. + :ivar name: The private link resource name. :vartype name: str - :ivar type: Gets or sets the type. + :ivar properties: The private link resource properties. + :vartype properties: ~azure.mgmt.purview.models.PrivateLinkResourceProperties + :ivar type: The private link resource 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}, + 'properties': {'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'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, '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__( @@ -1307,9 +1164,10 @@ def __init__( **kwargs ): super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None + self.id = None + self.name = None + self.properties = None + self.type = None class PrivateLinkResourceList(msrest.serialization.Model): @@ -1345,6 +1203,42 @@ def __init__( self.value = kwargs['value'] +class PrivateLinkResourceProperties(msrest.serialization.Model): + """A privately linkable resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The private link service connection state. @@ -1371,3 +1265,101 @@ def __init__( self.actions_required = kwargs.get('actions_required', None) self.description = kwargs.get('description', None) self.status = kwargs.get('status', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + self.last_modified_by = None + self.last_modified_by_type = None + + +class TrackedResourceSystemData(SystemData): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResourceSystemData, self).__init__(**kwargs) 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 index 43cbc94109bb..53e98175c4f4 100644 --- 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 @@ -53,6 +53,8 @@ class TrackedResource(msrest.serialization.Model): :type location: str :ivar name: Gets or sets the name. :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.TrackedResourceSystemData :param tags: A set of tags. Tags on the azure resource. :type tags: dict[str, str] :ivar type: Gets or sets the type. @@ -62,6 +64,7 @@ class TrackedResource(msrest.serialization.Model): _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'system_data': {'readonly': True}, 'type': {'readonly': True}, } @@ -70,6 +73,7 @@ class TrackedResource(msrest.serialization.Model): 'identity': {'key': 'identity', 'type': 'Identity'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'TrackedResourceSystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -87,6 +91,7 @@ def __init__( self.identity = identity self.location = location self.name = None + self.system_data = None self.tags = tags self.type = None @@ -104,6 +109,8 @@ class Account(TrackedResource): :type location: str :ivar name: Gets or sets the name. :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.TrackedResourceSystemData :param tags: A set of tags. Tags on the azure resource. :type tags: dict[str, str] :ivar type: Gets or sets the type. @@ -120,26 +127,29 @@ class Account(TrackedResource): :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 + :vartype endpoints: ~azure.mgmt.purview.models.AccountPropertiesEndpoints :ivar friendly_name: Gets or sets the friendly name. :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str :ivar managed_resources: Gets the resource identifiers of the managed resources. - :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :vartype managed_resources: ~azure.mgmt.purview.models.AccountPropertiesManagedResources :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". + "Succeeded", "Canceled". :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". + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, + 'system_data': {'readonly': True}, 'type': {'readonly': True}, 'created_at': {'readonly': True}, 'created_by': {'readonly': True}, @@ -156,6 +166,7 @@ class Account(TrackedResource): 'identity': {'key': 'identity', 'type': 'Identity'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'TrackedResourceSystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'AccountSku'}, @@ -163,9 +174,10 @@ class Account(TrackedResource): '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'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountPropertiesEndpoints'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'AccountPropertiesManagedResources'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, @@ -179,7 +191,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["AccountSku"] = None, cloud_connectors: Optional["CloudConnectors"] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + managed_resource_group_name: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = "Enabled", **kwargs ): super(Account, self).__init__(identity=identity, location=location, tags=tags, **kwargs) @@ -190,6 +203,7 @@ def __init__( self.created_by_object_id = None self.endpoints = None self.friendly_name = None + self.managed_resource_group_name = managed_resource_group_name self.managed_resources = None self.private_endpoint_connections = None self.provisioning_state = None @@ -268,6 +282,87 @@ def __init__( self.value = value +class AccountProperties(msrest.serialization.Model): + """The account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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.AccountPropertiesEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.AccountPropertiesManagedResources + :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", "Canceled". + :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". Default value: "Enabled". + :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 = { + 'cloud_connectors': {'key': 'cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'AccountPropertiesEndpoints'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'managedResources', 'type': 'AccountPropertiesManagedResources'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + cloud_connectors: Optional["CloudConnectors"] = None, + managed_resource_group_name: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = "Enabled", + **kwargs + ): + super(AccountProperties, self).__init__(**kwargs) + 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_resource_group_name = managed_resource_group_name + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = public_network_access + + class AccountPropertiesEndpoints(AccountEndpoints): """The URIs that are the public endpoints of the account. @@ -398,82 +493,27 @@ def __init__( 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 properties: The account properties. + :type properties: ~azure.mgmt.purview.models.AccountProperties :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 = { + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, '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, *, + properties: Optional["AccountProperties"] = None, 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.properties = properties 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): @@ -535,7 +575,7 @@ def __init__( class CloudConnectors(msrest.serialization.Model): - """Properties for configuring third party cloud connections. + """CloudConnectors. Variables are only populated by the server, and will be ignored when sending a request. @@ -560,6 +600,27 @@ def __init__( self.aws_external_id = None +class CollectionAdminUpdate(msrest.serialization.Model): + """Collection administrator update. + + :param object_id: Gets or sets the object identifier of the admin. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + object_id: Optional[str] = None, + **kwargs + ): + super(CollectionAdminUpdate, self).__init__(**kwargs) + self.object_id = object_id + + class DefaultAccountPayload(msrest.serialization.Model): """Payload to get and set the default account in the given scope. @@ -607,234 +668,6 @@ def __init__( 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. @@ -913,7 +746,7 @@ class ErrorResponseModel(msrest.serialization.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 + :vartype error: ~azure.mgmt.purview.models.ErrorResponseModelError """ _validation = { @@ -921,7 +754,7 @@ class ErrorResponseModel(msrest.serialization.Model): } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorModel'}, + 'error': {'key': 'error', 'type': 'ErrorResponseModelError'}, } def __init__( @@ -1275,6 +1108,41 @@ def __init__( self.id = 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 PrivateEndpointConnection(ProxyResource): """A private endpoint connection class. @@ -1361,42 +1229,33 @@ def __init__( self.value = value -class PrivateLinkResource(ProxyResource): +class PrivateLinkResource(msrest.serialization.Model): """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. + :ivar id: The private link resource identifier. :vartype id: str - :ivar name: Gets or sets the name. + :ivar name: The private link resource name. :vartype name: str - :ivar type: Gets or sets the type. + :ivar properties: The private link resource properties. + :vartype properties: ~azure.mgmt.purview.models.PrivateLinkResourceProperties + :ivar type: The private link resource 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}, + 'properties': {'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'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, '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__( @@ -1404,9 +1263,10 @@ def __init__( **kwargs ): super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None + self.id = None + self.name = None + self.properties = None + self.type = None class PrivateLinkResourceList(msrest.serialization.Model): @@ -1446,6 +1306,42 @@ def __init__( self.value = value +class PrivateLinkResourceProperties(msrest.serialization.Model): + """A privately linkable resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The private link service connection state. @@ -1476,3 +1372,101 @@ def __init__( self.actions_required = actions_required self.description = description self.status = status + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + self.last_modified_by = None + self.last_modified_by_type = None + + +class TrackedResourceSystemData(SystemData): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResourceSystemData, self).__init__(**kwargs) 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 index 76998be29c9b..f017663e5f5c 100644 --- 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 @@ -26,6 +26,24 @@ def __getattr__(cls, name): raise AttributeError(name) +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class LastModifiedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that last modified the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the sku name. """ @@ -44,6 +62,7 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SOFT_DELETED = "SoftDeleted" FAILED = "Failed" SUCCEEDED = "Succeeded" + CANCELED = "Canceled" class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the public network access. @@ -61,6 +80,8 @@ class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALREADY_EXISTS = "AlreadyExists" class ScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The scope where the default account is set. + """ TENANT = "Tenant" SUBSCRIPTION = "Subscription" 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 index 480df79a5593..94752f3fd608 100644 --- 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 @@ -72,7 +72,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -115,7 +115,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -148,7 +148,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -190,7 +190,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -226,7 +226,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -252,7 +252,7 @@ def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) @@ -276,7 +276,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -307,7 +307,7 @@ def _create_or_update_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -342,8 +342,8 @@ def begin_create_or_update( :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 + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -408,7 +408,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -434,7 +434,7 @@ def _delete_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -459,8 +459,8 @@ def begin_delete( :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 + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -522,7 +522,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -553,7 +553,7 @@ def _update_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -588,8 +588,8 @@ def begin_update( :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 + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) @@ -667,7 +667,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -693,7 +693,7 @@ def list_keys( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -704,6 +704,73 @@ def list_keys( return deserialized list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + def add_root_collection_admin( + self, + resource_group_name, # type: str + account_name, # type: str + collection_admin_update, # type: "_models.CollectionAdminUpdate" + **kwargs # type: Any + ): + # type: (...) -> None + """Add the administrator for root collection. + + Add the administrator for root collection 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 + :param collection_admin_update: The collection admin update payload. + :type collection_admin_update: ~azure.mgmt.purview.models.CollectionAdminUpdate + :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 = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_root_collection_admin.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(collection_admin_update, 'CollectionAdminUpdate') + 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.failsafe_deserialize(_models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + add_root_collection_admin.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/addRootCollectionAdmin'} # type: ignore + def check_name_availability( self, check_name_availability_request, # type: "_models.CheckNameAvailabilityRequest" @@ -726,7 +793,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -755,7 +822,7 @@ def check_name_availability( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) 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 index 213d47843ac5..b6bbf95a34c7 100644 --- 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 @@ -73,7 +73,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -97,7 +97,7 @@ def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) @@ -116,7 +116,7 @@ def set( # type: (...) -> "_models.DefaultAccountPayload" """Sets the default account for the scope. - Set the default account for the scope. + Sets the default account for the scope. :param default_account_payload: The payload containing the default account information and the scope. @@ -131,7 +131,7 @@ def set( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -156,7 +156,7 @@ def set( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) @@ -177,7 +177,7 @@ def remove( # type: (...) -> None """Removes the default account from the scope. - Remove the default account from the scope. + Removes the default account from the scope. :param scope_tenant_id: The tenant ID. :type scope_tenant_id: str @@ -196,7 +196,7 @@ def remove( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -220,7 +220,7 @@ def remove( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 index fd7c0023bb2d..1a77ad29b801 100644 --- a/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py +++ b/sdk/purview/azure-mgmt-purview/azure/mgmt/purview/operations/_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -100,7 +100,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) 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 index 948ad0930b3f..18fe2b9411e3 100644 --- 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 @@ -75,7 +75,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -119,7 +119,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -158,7 +158,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -185,7 +185,7 @@ def get( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -196,7 +196,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - def create_or_update( + def _create_or_update_initial( self, resource_group_name, # type: str account_name, # type: str @@ -205,34 +205,17 @@ def create_or_update( **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" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + 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'), @@ -259,7 +242,7 @@ def create_or_update( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,7 +255,86 @@ def create_or_update( 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_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: (...) -> LROPoller["_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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.purview.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + 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, + private_endpoint_connection_name=private_endpoint_connection_name, + request=request, + 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('PrivateEndpointConnection', 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'), + '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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore def _delete_initial( self, @@ -287,7 +349,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -314,7 +376,7 @@ def _delete_initial( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -342,8 +404,8 @@ def begin_delete( :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 + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a 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) 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 index 60b056ce9031..15acb10923c1 100644 --- 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 @@ -70,7 +70,7 @@ def list_by_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseModel, response) + error = self._deserialize.failsafe_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) @@ -151,7 +151,7 @@ def get_by_group_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ def get_by_group_id( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseModel, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResource', pipeline_response) diff --git a/sdk/purview/azure-mgmt-purview/setup.py b/sdk/purview/azure-mgmt-purview/setup.py index 58d51701caa9..14752522605e 100644 --- a/sdk/purview/azure-mgmt-purview/setup.py +++ b/sdk/purview/azure-mgmt-purview/setup.py @@ -81,7 +81,7 @@ 'azure.mgmt', ]), install_requires=[ - 'msrest>=0.5.0', + 'msrest>=0.6.21', 'azure-common~=1.1', 'azure-mgmt-core>=1.2.0,<2.0.0', ], diff --git a/shared_requirements.txt b/shared_requirements.txt index 7d966ae7b825..11da8a8a9fa8 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -329,6 +329,7 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-mgmt-guestconfig msrest>=0.6.21 #override azure-mgmt-recoveryservices msrest>=0.6.21 #override azure-mgmt-avs msrest>=0.6.21 +#override azure-mgmt-purview msrest>=0.6.21 #override azure-mgmt-datafactory msrest>=0.6.21 #override azure-mgmt-containerinstance msrest>=0.6.21 #override azure-mgmt-recoveryservicessiterecovery msrest>=0.6.21