From eadfc7d219212b5837f6b82016ef7efb447a70ea Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 10 Nov 2021 03:33:43 +0000 Subject: [PATCH] CodeGen from PR 16355 in Azure/azure-rest-api-specs attestation: fixing the segment `attestationProvider` to be `attestationProvider` which matches the API (#16355) Using the API Version in the Portal (2020-10-01): Using API Version 2020-10-01 and a valid AttestationProvider with this endpoint returns an error that the `attestationProvider` resource type cannot be found: ``` $ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProvider/tomdevaccprov/privateEndpointConnections?api-version=2020-10-01" Not Found({"error":{"code":"InvalidResourceType","message":"The resource type could not be found in the namespace 'Microsoft.Attestation' for api version '2020-10-01'."}}) ``` Updating this to `attestationProviders` fixes this (and correctly returns a 404 that there is no PrivateEndpointConnection for this Attestation Provider): ``` $ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProviders/tomdevaccprov/privateEndpointConnections?api-version=2020-10-01" Not Found({"error":{"code":"InvalidOperation","message":"PrivateEndpointConnection is not found."}}) ``` --- Using API Version 2021-06-01-preview and a valid AttestationProvider with this endpoint returns an error that the `attestationProvider` resource type cannot be found: ``` $ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProvider/tomdevaccprov/privateEndpointConnections?api-version=2021-06-01-preview" Not Found({"error":{"code":"InvalidResourceType","message":"The resource type could not be found in the namespace 'Microsoft.Attestation' for api version '2021-06-01-preview'."}}) ``` Updating this to `attestationProviders` fixes this (and correctly returns a 404 that there is no PrivateEndpointConnection for this Attestation Provider): ``` $ az rest --method get --uri "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tom-dev/providers/Microsoft.Attestation/attestationProviders/tomdevaccprov/privateEndpointConnections?api-version=2021-06-01-preview" Not Found({"error":{"code":"InvalidOperation","message":"PrivateEndpointConnection is not found."}}) ``` --- .../azure-mgmt-attestation/MANIFEST.in | 1 + .../azure-mgmt-attestation/_meta.json | 11 + .../_attestation_management_client.py | 26 +- .../azure/mgmt/attestation/_configuration.py | 2 +- .../azure/mgmt/attestation/_metadata.json | 105 ++++++ .../azure/mgmt/attestation/_version.py | 2 +- .../aio/_attestation_management_client.py | 25 +- .../mgmt/attestation/aio/_configuration.py | 2 +- .../attestation/aio/operations/__init__.py | 2 + .../_attestation_providers_operations.py | 50 +-- .../attestation/aio/operations/_operations.py | 4 +- ...private_endpoint_connections_operations.py | 311 +++++++++++++++++ .../azure/mgmt/attestation/models/__init__.py | 21 ++ .../_attestation_management_client_enums.py | 26 ++ .../azure/mgmt/attestation/models/_models.py | 234 +++++++++++-- .../mgmt/attestation/models/_models_py3.py | 252 ++++++++++++-- .../mgmt/attestation/operations/__init__.py | 2 + .../_attestation_providers_operations.py | 34 +- .../attestation/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 319 ++++++++++++++++++ 20 files changed, 1336 insertions(+), 95 deletions(-) create mode 100644 sdk/attestation/azure-mgmt-attestation/_meta.json create mode 100644 sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_metadata.json create mode 100644 sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py diff --git a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in +++ b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/attestation/azure-mgmt-attestation/_meta.json b/sdk/attestation/azure-mgmt-attestation/_meta.json new file mode 100644 index 0000000000000..be3447ed6d5c1 --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "9903ac0d18bab43964f5c216b7638bd2964eaac5", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/attestation/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/attestation/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_attestation_management_client.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_attestation_management_client.py index 4a95dd2d17c98..649db986f20c1 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_attestation_management_client.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_attestation_management_client.py @@ -16,20 +16,24 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import AttestationManagementClientConfiguration from .operations import Operations from .operations import AttestationProvidersOperations +from .operations import PrivateEndpointConnectionsOperations from . import models class AttestationManagementClient(object): - """Various APIs for managing resources in attestation service. This primarily encompasses per-tenant instance management. + """Various APIs for managing resources in attestation service. This primarily encompasses per-provider management. :ivar operations: Operations operations :vartype operations: azure.mgmt.attestation.operations.Operations :ivar attestation_providers: AttestationProvidersOperations operations :vartype attestation_providers: azure.mgmt.attestation.operations.AttestationProvidersOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.attestation.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -59,6 +63,26 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.attestation_providers = AttestationProvidersOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + 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', min_length=1), + } + 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 diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_configuration.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_configuration.py index ff25016c47f9b..e25687fba9df8 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_configuration.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-09-01-preview" + self.api_version = "2020-10-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-attestation/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_metadata.json b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_metadata.json new file mode 100644 index 0000000000000..2697dc1fdedcc --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_metadata.json @@ -0,0 +1,105 @@ +{ + "chosen_version": "2020-10-01", + "total_api_version_list": ["2020-10-01"], + "client": { + "name": "AttestationManagementClient", + "filename": "_attestation_management_client", + "description": "Various APIs for managing resources in attestation service. This primarily encompasses per-provider management.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "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\": [\"AttestationManagementClientConfiguration\"]}}, \"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\": [\"AttestationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "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: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "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, + "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": { + "operations": "Operations", + "attestation_providers": "AttestationProvidersOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations" + } +} \ No newline at end of file diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_version.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_version.py index c47f66669f1bf..eae7c95b6fbdb 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_version.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.1.0" diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_attestation_management_client.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_attestation_management_client.py index 382f63c038653..c60f6852f720c 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_attestation_management_client.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_attestation_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 @@ -18,16 +19,19 @@ from ._configuration import AttestationManagementClientConfiguration from .operations import Operations from .operations import AttestationProvidersOperations +from .operations import PrivateEndpointConnectionsOperations from .. import models class AttestationManagementClient(object): - """Various APIs for managing resources in attestation service. This primarily encompasses per-tenant instance management. + """Various APIs for managing resources in attestation service. This primarily encompasses per-provider management. :ivar operations: Operations operations :vartype operations: azure.mgmt.attestation.aio.operations.Operations :ivar attestation_providers: AttestationProvidersOperations operations :vartype attestation_providers: azure.mgmt.attestation.aio.operations.AttestationProvidersOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.attestation.aio.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -56,6 +60,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.attestation_providers = AttestationProvidersOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + 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', min_length=1), + } + 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/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_configuration.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_configuration.py index 2b7705caf6275..e597b38d22c6a 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_configuration.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-09-01-preview" + self.api_version = "2020-10-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-attestation/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/__init__.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/__init__.py index fe9ce6fc7a082..81a65fb9726b0 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/__init__.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/__init__.py @@ -8,8 +8,10 @@ from ._operations import Operations from ._attestation_providers_operations import AttestationProvidersOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations __all__ = [ 'Operations', 'AttestationProvidersOperations', + 'PrivateEndpointConnectionsOperations', ] diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_attestation_providers_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_attestation_providers_operations.py index d76e7e1fc8052..12920d7cf7ab3 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_attestation_providers_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_attestation_providers_operations.py @@ -44,13 +44,13 @@ async def get( self, resource_group_name: str, provider_name: str, - **kwargs + **kwargs: Any ) -> "_models.AttestationProvider": """Get the status of Attestation Provider. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AttestationProvider, or the result of cls(response) @@ -62,14 +62,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -103,13 +103,13 @@ async def create( resource_group_name: str, provider_name: str, creation_params: "_models.AttestationServiceCreationParams", - **kwargs + **kwargs: Any ) -> "_models.AttestationProvider": - """Creates or updates the Attestation Provider. + """Creates a new Attestation Provider. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :param creation_params: Client supplied parameters. :type creation_params: ~azure.mgmt.attestation.models.AttestationServiceCreationParams @@ -123,7 +123,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -131,7 +131,7 @@ async def create( url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -173,13 +173,13 @@ async def update( resource_group_name: str, provider_name: str, update_params: "_models.AttestationServicePatchParams", - **kwargs + **kwargs: Any ) -> "_models.AttestationProvider": """Updates the Attestation Provider. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :param update_params: Client supplied parameters. :type update_params: ~azure.mgmt.attestation.models.AttestationServicePatchParams @@ -193,7 +193,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -201,7 +201,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -238,7 +238,7 @@ async def delete( self, resource_group_name: str, provider_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete Attestation Service. @@ -256,14 +256,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -291,7 +291,7 @@ async def delete( async def list( self, - **kwargs + **kwargs: Any ) -> "_models.AttestationProviderListResult": """Returns a list of attestation providers in a subscription. @@ -305,7 +305,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL @@ -342,7 +342,7 @@ async def list( async def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> "_models.AttestationProviderListResult": """Returns attestation providers list in a resource group. @@ -358,13 +358,13 @@ async def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -395,7 +395,7 @@ async def list_by_resource_group( async def list_default( self, - **kwargs + **kwargs: Any ) -> "_models.AttestationProviderListResult": """Get the default provider. @@ -409,7 +409,7 @@ async def list_default( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL @@ -446,7 +446,7 @@ async def list_default( async def get_default_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> "_models.AttestationProvider": """Get the default provider by location. @@ -462,7 +462,7 @@ async def get_default_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_operations.py index 1d5bf1265c89b..5750e2c4c7ca9 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.OperationList": """Lists all of the available Azure attestation operations. @@ -56,7 +56,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_private_endpoint_connections_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..9c37357cd08fa --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,311 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.attestation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + provider_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """List all the private endpoint connections associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.attestation.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + provider_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.attestation.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-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + provider_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the attestation + provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.attestation.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.attestation.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-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + provider_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + """Deletes the specified private endpoint connection associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py index 752684408fddf..b205f05e70fbe 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py @@ -18,7 +18,12 @@ from ._models_py3 import OperationList from ._models_py3 import OperationsDefinition from ._models_py3 import OperationsDisplayDefinition + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import Resource + from ._models_py3 import SystemData from ._models_py3 import TrackedResource except (SyntaxError, ImportError): from ._models import AttestationProvider # type: ignore @@ -32,11 +37,19 @@ from ._models import OperationList # type: ignore from ._models import OperationsDefinition # type: ignore from ._models import OperationsDisplayDefinition # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore from ._models import Resource # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore from ._attestation_management_client_enums import ( AttestationServiceStatus, + CreatedByType, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, ) __all__ = [ @@ -51,7 +64,15 @@ 'OperationList', 'OperationsDefinition', 'OperationsDisplayDefinition', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkServiceConnectionState', 'Resource', + 'SystemData', 'TrackedResource', 'AttestationServiceStatus', + 'CreatedByType', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', ] diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py index 69819cfa98dc3..a77fd5200a0f0 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py @@ -33,3 +33,29 @@ class AttestationServiceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu READY = "Ready" NOT_READY = "NotReady" ERROR = "Error" + +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 PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py index e76043fd1c3e8..9f59f9121bf26 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py @@ -110,13 +110,19 @@ class AttestationProvider(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param trust_model: Trust model for the attestation service instance. + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData + :param trust_model: Trust model for the attestation provider. :type trust_model: str :param status: Status of attestation service. Possible values include: "Ready", "NotReady", "Error". :type status: str or ~azure.mgmt.attestation.models.AttestationServiceStatus :param attest_uri: Gets the uri of attestation service. :type attest_uri: str + :ivar private_endpoint_connections: List of private endpoint connections associated with the + attestation provider. + :vartype private_endpoint_connections: + list[~azure.mgmt.attestation.models.PrivateEndpointConnection] """ _validation = { @@ -124,6 +130,8 @@ class AttestationProvider(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -132,9 +140,11 @@ class AttestationProvider(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'trust_model': {'key': 'properties.trustModel', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'attest_uri': {'key': 'properties.attestUri', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -142,19 +152,30 @@ def __init__( **kwargs ): super(AttestationProvider, self).__init__(**kwargs) + self.system_data = None self.trust_model = kwargs.get('trust_model', None) self.status = kwargs.get('status', None) self.attest_uri = kwargs.get('attest_uri', None) + self.private_endpoint_connections = None class AttestationProviderListResult(msrest.serialization.Model): """Attestation Providers List. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData :param value: Attestation Provider array. :type value: list[~azure.mgmt.attestation.models.AttestationProvider] """ + _validation = { + 'system_data': {'readonly': True}, + } + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'value', 'type': '[AttestationProvider]'}, } @@ -163,20 +184,21 @@ def __init__( **kwargs ): super(AttestationProviderListResult, self).__init__(**kwargs) + self.system_data = None self.value = kwargs.get('value', None) class AttestationServiceCreationParams(msrest.serialization.Model): - """Parameters for creating an attestation service instance. + """Parameters for creating an attestation provider. All required parameters must be populated in order to send to Azure. - :param location: Required. The supported Azure location where the attestation service instance - should be created. + :param location: Required. The supported Azure location where the attestation provider should + be created. :type location: str - :param tags: A set of tags. The tags that will be assigned to the attestation service instance. + :param tags: A set of tags. The tags that will be assigned to the attestation provider. :type tags: dict[str, str] - :param properties: Required. Properties of the attestation service instance. + :param properties: Required. Properties of the attestation provider. :type properties: ~azure.mgmt.attestation.models.AttestationServiceCreationSpecificParams """ @@ -202,17 +224,14 @@ def __init__( class AttestationServiceCreationSpecificParams(msrest.serialization.Model): - """Client supplied parameters used to create a new attestation service instance. + """Client supplied parameters used to create a new attestation provider. - :param attestation_policy: Name of attestation policy. - :type attestation_policy: str :param policy_signing_certificates: JSON Web Key Set defining a set of X.509 Certificates that will represent the parent certificate for the signing certificate used for policy operations. :type policy_signing_certificates: ~azure.mgmt.attestation.models.JSONWebKeySet """ _attribute_map = { - 'attestation_policy': {'key': 'attestationPolicy', 'type': 'str'}, 'policy_signing_certificates': {'key': 'policySigningCertificates', 'type': 'JSONWebKeySet'}, } @@ -221,14 +240,13 @@ def __init__( **kwargs ): super(AttestationServiceCreationSpecificParams, self).__init__(**kwargs) - self.attestation_policy = kwargs.get('attestation_policy', None) self.policy_signing_certificates = kwargs.get('policy_signing_certificates', None) class AttestationServicePatchParams(msrest.serialization.Model): - """Parameters for patching an attestation service instance. + """Parameters for patching an attestation provider. - :param tags: A set of tags. The tags that will be assigned to the attestation service instance. + :param tags: A set of tags. The tags that will be assigned to the attestation provider. :type tags: dict[str, str] """ @@ -274,7 +292,7 @@ class JSONWebKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param alg: Required. The "alg" (algorithm) parameter identifies the algorithm intended for + :param alg: The "alg" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA "JSON Web Signature and Encryption Algorithms" registry established by [JWA] or be a value that contains a Collision- @@ -292,7 +310,7 @@ class JSONWebKey(msrest.serialization.Model): :type e: str :param k: Symmetric key. :type k: str - :param kid: Required. The "kid" (key ID) parameter is used to match a specific key. This + :param kid: The "kid" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the "kid" value is unspecified. When "kid" values are used within a JWK Set, different @@ -316,7 +334,7 @@ class JSONWebKey(msrest.serialization.Model): :type q: str :param qi: RSA Private Key Parameter. :type qi: str - :param use: Required. Use ("public key use") identifies the intended use of + :param use: Use ("public key use") identifies the intended use of the public key. The "use" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly "sig" (signature) or "enc" (encryption). @@ -336,10 +354,7 @@ class JSONWebKey(msrest.serialization.Model): """ _validation = { - 'alg': {'required': True}, - 'kid': {'required': True}, 'kty': {'required': True}, - 'use': {'required': True}, } _attribute_map = { @@ -367,20 +382,20 @@ def __init__( **kwargs ): super(JSONWebKey, self).__init__(**kwargs) - self.alg = kwargs['alg'] + self.alg = kwargs.get('alg', None) self.crv = kwargs.get('crv', None) self.d = kwargs.get('d', None) self.dp = kwargs.get('dp', None) self.dq = kwargs.get('dq', None) self.e = kwargs.get('e', None) self.k = kwargs.get('k', None) - self.kid = kwargs['kid'] + self.kid = kwargs.get('kid', None) self.kty = kwargs['kty'] self.n = kwargs.get('n', None) self.p = kwargs.get('p', None) self.q = kwargs.get('q', None) self.qi = kwargs.get('qi', None) - self.use = kwargs['use'] + self.use = kwargs.get('use', None) self.x = kwargs.get('x', None) self.x5_c = kwargs.get('x5_c', None) self.y = kwargs.get('y', None) @@ -412,11 +427,20 @@ def __init__( class OperationList(msrest.serialization.Model): """List of supported operations. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData :param value: List of supported operations. :type value: list[~azure.mgmt.attestation.models.OperationsDefinition] """ + _validation = { + 'system_data': {'readonly': True}, + } + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'value', 'type': '[OperationsDefinition]'}, } @@ -425,6 +449,7 @@ def __init__( **kwargs ): super(OperationList, self).__init__(**kwargs) + self.system_data = None self.value = kwargs.get('value', None) @@ -480,3 +505,168 @@ def __init__( self.resource = kwargs.get('resource', None) self.operation = kwargs.get('operation', None) self.description = kwargs.get('description', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.attestation.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.attestation.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py index f0ef448e6cb8f..724edfa44b7b3 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union import msrest.serialization @@ -117,13 +118,19 @@ class AttestationProvider(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param trust_model: Trust model for the attestation service instance. + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData + :param trust_model: Trust model for the attestation provider. :type trust_model: str :param status: Status of attestation service. Possible values include: "Ready", "NotReady", "Error". :type status: str or ~azure.mgmt.attestation.models.AttestationServiceStatus :param attest_uri: Gets the uri of attestation service. :type attest_uri: str + :ivar private_endpoint_connections: List of private endpoint connections associated with the + attestation provider. + :vartype private_endpoint_connections: + list[~azure.mgmt.attestation.models.PrivateEndpointConnection] """ _validation = { @@ -131,6 +138,8 @@ class AttestationProvider(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -139,9 +148,11 @@ class AttestationProvider(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'trust_model': {'key': 'properties.trustModel', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'attest_uri': {'key': 'properties.attestUri', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -155,19 +166,30 @@ def __init__( **kwargs ): super(AttestationProvider, self).__init__(tags=tags, location=location, **kwargs) + self.system_data = None self.trust_model = trust_model self.status = status self.attest_uri = attest_uri + self.private_endpoint_connections = None class AttestationProviderListResult(msrest.serialization.Model): """Attestation Providers List. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData :param value: Attestation Provider array. :type value: list[~azure.mgmt.attestation.models.AttestationProvider] """ + _validation = { + 'system_data': {'readonly': True}, + } + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'value', 'type': '[AttestationProvider]'}, } @@ -178,20 +200,21 @@ def __init__( **kwargs ): super(AttestationProviderListResult, self).__init__(**kwargs) + self.system_data = None self.value = value class AttestationServiceCreationParams(msrest.serialization.Model): - """Parameters for creating an attestation service instance. + """Parameters for creating an attestation provider. All required parameters must be populated in order to send to Azure. - :param location: Required. The supported Azure location where the attestation service instance - should be created. + :param location: Required. The supported Azure location where the attestation provider should + be created. :type location: str - :param tags: A set of tags. The tags that will be assigned to the attestation service instance. + :param tags: A set of tags. The tags that will be assigned to the attestation provider. :type tags: dict[str, str] - :param properties: Required. Properties of the attestation service instance. + :param properties: Required. Properties of the attestation provider. :type properties: ~azure.mgmt.attestation.models.AttestationServiceCreationSpecificParams """ @@ -221,36 +244,31 @@ def __init__( class AttestationServiceCreationSpecificParams(msrest.serialization.Model): - """Client supplied parameters used to create a new attestation service instance. + """Client supplied parameters used to create a new attestation provider. - :param attestation_policy: Name of attestation policy. - :type attestation_policy: str :param policy_signing_certificates: JSON Web Key Set defining a set of X.509 Certificates that will represent the parent certificate for the signing certificate used for policy operations. :type policy_signing_certificates: ~azure.mgmt.attestation.models.JSONWebKeySet """ _attribute_map = { - 'attestation_policy': {'key': 'attestationPolicy', 'type': 'str'}, 'policy_signing_certificates': {'key': 'policySigningCertificates', 'type': 'JSONWebKeySet'}, } def __init__( self, *, - attestation_policy: Optional[str] = None, policy_signing_certificates: Optional["JSONWebKeySet"] = None, **kwargs ): super(AttestationServiceCreationSpecificParams, self).__init__(**kwargs) - self.attestation_policy = attestation_policy self.policy_signing_certificates = policy_signing_certificates class AttestationServicePatchParams(msrest.serialization.Model): - """Parameters for patching an attestation service instance. + """Parameters for patching an attestation provider. - :param tags: A set of tags. The tags that will be assigned to the attestation service instance. + :param tags: A set of tags. The tags that will be assigned to the attestation provider. :type tags: dict[str, str] """ @@ -301,7 +319,7 @@ class JSONWebKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param alg: Required. The "alg" (algorithm) parameter identifies the algorithm intended for + :param alg: The "alg" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA "JSON Web Signature and Encryption Algorithms" registry established by [JWA] or be a value that contains a Collision- @@ -319,7 +337,7 @@ class JSONWebKey(msrest.serialization.Model): :type e: str :param k: Symmetric key. :type k: str - :param kid: Required. The "kid" (key ID) parameter is used to match a specific key. This + :param kid: The "kid" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the "kid" value is unspecified. When "kid" values are used within a JWK Set, different @@ -343,7 +361,7 @@ class JSONWebKey(msrest.serialization.Model): :type q: str :param qi: RSA Private Key Parameter. :type qi: str - :param use: Required. Use ("public key use") identifies the intended use of + :param use: Use ("public key use") identifies the intended use of the public key. The "use" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly "sig" (signature) or "enc" (encryption). @@ -363,10 +381,7 @@ class JSONWebKey(msrest.serialization.Model): """ _validation = { - 'alg': {'required': True}, - 'kid': {'required': True}, 'kty': {'required': True}, - 'use': {'required': True}, } _attribute_map = { @@ -392,20 +407,20 @@ class JSONWebKey(msrest.serialization.Model): def __init__( self, *, - alg: str, - kid: str, kty: str, - use: str, + alg: Optional[str] = None, crv: Optional[str] = None, d: Optional[str] = None, dp: Optional[str] = None, dq: Optional[str] = None, e: Optional[str] = None, k: Optional[str] = None, + kid: Optional[str] = None, n: Optional[str] = None, p: Optional[str] = None, q: Optional[str] = None, qi: Optional[str] = None, + use: Optional[str] = None, x: Optional[str] = None, x5_c: Optional[List[str]] = None, y: Optional[str] = None, @@ -459,11 +474,20 @@ def __init__( class OperationList(msrest.serialization.Model): """List of supported operations. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.attestation.models.SystemData :param value: List of supported operations. :type value: list[~azure.mgmt.attestation.models.OperationsDefinition] """ + _validation = { + 'system_data': {'readonly': True}, + } + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'value', 'type': '[OperationsDefinition]'}, } @@ -474,6 +498,7 @@ def __init__( **kwargs ): super(OperationList, self).__init__(**kwargs) + self.system_data = None self.value = value @@ -537,3 +562,184 @@ def __init__( self.resource = resource self.operation = operation self.description = description + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.attestation.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.attestation.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/__init__.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/__init__.py index fe9ce6fc7a082..81a65fb9726b0 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/__init__.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/__init__.py @@ -8,8 +8,10 @@ from ._operations import Operations from ._attestation_providers_operations import AttestationProvidersOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations __all__ = [ 'Operations', 'AttestationProvidersOperations', + 'PrivateEndpointConnectionsOperations', ] diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py index 9e2d5da51d0bd..55e7fa97bd30b 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py @@ -55,7 +55,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AttestationProvider, or the result of cls(response) @@ -67,14 +67,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -111,11 +111,11 @@ def create( **kwargs # type: Any ): # type: (...) -> "_models.AttestationProvider" - """Creates or updates the Attestation Provider. + """Creates a new Attestation Provider. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :param creation_params: Client supplied parameters. :type creation_params: ~azure.mgmt.attestation.models.AttestationServiceCreationParams @@ -129,7 +129,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -137,7 +137,7 @@ def create( url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -186,7 +186,7 @@ def update( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param provider_name: Name of the attestation service instance. + :param provider_name: Name of the attestation provider. :type provider_name: str :param update_params: Client supplied parameters. :type update_params: ~azure.mgmt.attestation.models.AttestationServicePatchParams @@ -200,7 +200,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -208,7 +208,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -264,14 +264,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -314,7 +314,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL @@ -368,13 +368,13 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -420,7 +420,7 @@ def list_default( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL @@ -474,7 +474,7 @@ def get_default_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_operations.py index aaade27566ad3..6a8b0f3e3b0f9 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_operations.py @@ -61,7 +61,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-01-preview" + api_version = "2020-10-01" accept = "application/json" # Construct URL diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..1da3061848fab --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,319 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.attestation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + provider_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """List all the private endpoint connections associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.attestation.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + provider_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets the specified private endpoint connection associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.attestation.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-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + provider_name, # type: str + private_endpoint_connection_name, # type: str + properties, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the attestation + provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.attestation.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.attestation.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-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + provider_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the specified private endpoint connection associated with the attestation provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param provider_name: The name of the attestation provider. + :type provider_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore