diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/_meta.json b/sdk/deviceupdate/azure-mgmt-deviceupdate/_meta.json index 3f36cd80b970..fdacae68240d 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/_meta.json +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "2d2fdb419b42ad00df574946ea195fd1cd5ae226", + "commit": "2c59c559d6804068f72b8ead08d287c4f6e48fc0", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/deviceupdate/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/deviceupdate/resource-manager/readme.md" diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_device_update.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_device_update.py index d17c61f76c08..d7cc717614c9 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_device_update.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_device_update.py @@ -24,6 +24,7 @@ from .operations import InstancesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionProxiesOperations from .operations import Operations from . import models @@ -39,6 +40,8 @@ class DeviceUpdate(DeviceUpdateOperationsMixin): :vartype private_endpoint_connections: device_update.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: device_update.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations operations + :vartype private_endpoint_connection_proxies: device_update.operations.PrivateEndpointConnectionProxiesOperations :ivar operations: Operations operations :vartype operations: device_update.operations.Operations :param credential: Credential needed for the client to connect to Azure. @@ -75,6 +78,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations( + self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_metadata.json b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_metadata.json index cc25f1fbd315..d0ebd400713f 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_metadata.json +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_metadata.json @@ -102,6 +102,7 @@ "instances": "InstancesOperations", "private_endpoint_connections": "PrivateEndpointConnectionsOperations", "private_link_resources": "PrivateLinkResourcesOperations", + "private_endpoint_connection_proxies": "PrivateEndpointConnectionProxiesOperations", "operations": "Operations" }, "operation_mixins": { diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_version.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_version.py index 20971492f129..e5754a47ce68 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_version.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/_device_update.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/_device_update.py index 79594d8a10d4..abf0e8c7dc37 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/_device_update.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/_device_update.py @@ -22,6 +22,7 @@ from .operations import InstancesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionProxiesOperations from .operations import Operations from .. import models @@ -37,6 +38,8 @@ class DeviceUpdate(DeviceUpdateOperationsMixin): :vartype private_endpoint_connections: device_update.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: device_update.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations operations + :vartype private_endpoint_connection_proxies: device_update.aio.operations.PrivateEndpointConnectionProxiesOperations :ivar operations: Operations operations :vartype operations: device_update.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. @@ -72,6 +75,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations( + self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/__init__.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/__init__.py index 146a4bd8cde2..39c22b434362 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/__init__.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/__init__.py @@ -11,6 +11,7 @@ from ._instances_operations import InstancesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connection_proxies_operations import PrivateEndpointConnectionProxiesOperations from ._operations import Operations __all__ = [ @@ -19,5 +20,6 @@ 'InstancesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionProxiesOperations', 'Operations', ] diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/_private_endpoint_connection_proxies_operations.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/_private_endpoint_connection_proxies_operations.py new file mode 100644 index 000000000000..65656cc080d2 --- /dev/null +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/operations/_private_endpoint_connection_proxies_operations.py @@ -0,0 +1,508 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionProxiesOperations: + """PrivateEndpointConnectionProxiesOperations 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: ~device_update.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionProxyListResult"]: + """(INTERNAL - DO NOT USE) List all private endpoint connection proxies in a device update + account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionProxyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~device_update.models.PrivateEndpointConnectionProxyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + } + 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('PrivateEndpointConnectionProxyListResult', 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]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies'} # type: ignore + + async def validate( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + private_endpoint_connection_proxy: "_models.PrivateEndpointConnectionProxy", + **kwargs: Any + ) -> None: + """(INTERNAL - DO NOT USE) Validates a private endpoint connection proxy object. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :param private_endpoint_connection_proxy: The parameters for creating a private endpoint + connection proxy. + :type private_endpoint_connection_proxy: ~device_update.models.PrivateEndpointConnectionProxy + :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-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection_proxy, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}/validate'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionProxy": + """(INTERNAL - DO NOT USE) Get the specified private endpoint connection proxy associated with the + device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~device_update.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + private_endpoint_connection_proxy: "_models.PrivateEndpointConnectionProxy", + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionProxy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection_proxy, 'PrivateEndpointConnectionProxy') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + private_endpoint_connection_proxy: "_models.PrivateEndpointConnectionProxy", + **kwargs: Any + ) -> AsyncLROPoller["_models.PrivateEndpointConnectionProxy"]: + """(INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy + resource associated with the device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :param private_endpoint_connection_proxy: The parameters for creating a private endpoint + connection proxy. + :type private_endpoint_connection_proxy: ~device_update.models.PrivateEndpointConnectionProxy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnectionProxy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~device_update.models.PrivateEndpointConnectionProxy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_proxy_id=private_endpoint_connection_proxy_id, + private_endpoint_connection_proxy=private_endpoint_connection_proxy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_proxy_id: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """(INTERNAL - DO NOT USE) Deletes the specified private endpoint connection proxy associated with + the device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_proxy_id=private_endpoint_connection_proxy_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/__init__.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/__init__.py index ad1ef395528f..ad461e0c730b 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/__init__.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/__init__.py @@ -12,10 +12,12 @@ from ._models_py3 import AccountUpdate from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse + from ._models_py3 import ConnectionDetails from ._models_py3 import DiagnosticStorageProperties from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import GroupConnectivityInformation from ._models_py3 import GroupInformation from ._models_py3 import GroupInformationProperties from ._models_py3 import Instance @@ -28,10 +30,18 @@ from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateEndpointConnectionProxy + from ._models_py3 import PrivateEndpointConnectionProxyListResult + from ._models_py3 import PrivateEndpointConnectionProxyProperties from ._models_py3 import PrivateLinkResourceListResult from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkServiceConnection from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import PrivateLinkServiceProxy + from ._models_py3 import PrivateLinkServiceProxyRemotePrivateEndpointConnection from ._models_py3 import ProxyResource + from ._models_py3 import RemotePrivateEndpoint + from ._models_py3 import RemotePrivateEndpointConnection from ._models_py3 import Resource from ._models_py3 import SystemData from ._models_py3 import TagUpdate @@ -43,10 +53,12 @@ from ._models import AccountUpdate # type: ignore from ._models import CheckNameAvailabilityRequest # type: ignore from ._models import CheckNameAvailabilityResponse # type: ignore + from ._models import ConnectionDetails # type: ignore from ._models import DiagnosticStorageProperties # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import GroupConnectivityInformation # type: ignore from ._models import GroupInformation # type: ignore from ._models import GroupInformationProperties # type: ignore from ._models import Instance # type: ignore @@ -59,10 +71,18 @@ from ._models import PrivateEndpoint # type: ignore from ._models import PrivateEndpointConnection # type: ignore from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateEndpointConnectionProxy # type: ignore + from ._models import PrivateEndpointConnectionProxyListResult # type: ignore + from ._models import PrivateEndpointConnectionProxyProperties # type: ignore from ._models import PrivateLinkResourceListResult # type: ignore from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkServiceConnection # type: ignore from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import PrivateLinkServiceProxy # type: ignore + from ._models import PrivateLinkServiceProxyRemotePrivateEndpointConnection # type: ignore from ._models import ProxyResource # type: ignore + from ._models import RemotePrivateEndpoint # type: ignore + from ._models import RemotePrivateEndpointConnection # type: ignore from ._models import Resource # type: ignore from ._models import SystemData # type: ignore from ._models import TagUpdate # type: ignore @@ -78,6 +98,7 @@ ManagedServiceIdentityType, Origin, PrivateEndpointConnectionProvisioningState, + PrivateEndpointConnectionProxyProvisioningState, PrivateEndpointServiceConnectionStatus, ProvisioningState, PublicNetworkAccess, @@ -89,10 +110,12 @@ 'AccountUpdate', 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResponse', + 'ConnectionDetails', 'DiagnosticStorageProperties', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'GroupConnectivityInformation', 'GroupInformation', 'GroupInformationProperties', 'Instance', @@ -105,10 +128,18 @@ 'PrivateEndpoint', 'PrivateEndpointConnection', 'PrivateEndpointConnectionListResult', + 'PrivateEndpointConnectionProxy', + 'PrivateEndpointConnectionProxyListResult', + 'PrivateEndpointConnectionProxyProperties', 'PrivateLinkResourceListResult', 'PrivateLinkResourceProperties', + 'PrivateLinkServiceConnection', 'PrivateLinkServiceConnectionState', + 'PrivateLinkServiceProxy', + 'PrivateLinkServiceProxyRemotePrivateEndpointConnection', 'ProxyResource', + 'RemotePrivateEndpoint', + 'RemotePrivateEndpointConnection', 'Resource', 'SystemData', 'TagUpdate', @@ -122,6 +153,7 @@ 'ManagedServiceIdentityType', 'Origin', 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointConnectionProxyProvisioningState', 'PrivateEndpointServiceConnectionStatus', 'ProvisioningState', 'PublicNetworkAccess', diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_device_update_enums.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_device_update_enums.py index 3acb30f980d0..30c29e1de217 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_device_update_enums.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_device_update_enums.py @@ -90,6 +90,15 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" +class PrivateEndpointConnectionProxyProvisioningState(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. """ diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models.py index 364bb6bf76f5..ff33d1cc14e3 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models.py @@ -292,6 +292,51 @@ def __init__( self.message = kwargs.get('message', None) +class ConnectionDetails(msrest.serialization.Model): + """Private endpoint connection proxy object properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Connection details ID. + :vartype id: str + :ivar private_ip_address: Private IP address. + :vartype private_ip_address: str + :ivar link_identifier: Link ID. + :vartype link_identifier: str + :ivar group_id: Group ID. + :vartype group_id: str + :ivar member_name: Member name. + :vartype member_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'link_identifier': {'readonly': True}, + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionDetails, self).__init__(**kwargs) + self.id = None + self.private_ip_address = None + self.link_identifier = None + self.group_id = None + self.member_name = None + + class DiagnosticStorageProperties(msrest.serialization.Model): """Customer-initiated diagnostic log collection storage properties. @@ -420,6 +465,53 @@ def __init__( self.error = kwargs.get('error', None) +class GroupConnectivityInformation(msrest.serialization.Model): + """Group connectivity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: Group ID. + :vartype group_id: str + :ivar member_name: Member name. + :vartype member_name: str + :param customer_visible_fqdns: List of customer visible FQDNs. + :type customer_visible_fqdns: list[str] + :ivar internal_fqdn: Internal FQDN. + :vartype internal_fqdn: str + :param redirect_map_id: Redirect map ID. + :type redirect_map_id: str + :param private_link_service_arm_region: PrivateLinkService ARM region. + :type private_link_service_arm_region: str + """ + + _validation = { + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + 'internal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'customer_visible_fqdns': {'key': 'customerVisibleFqdns', 'type': '[str]'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'redirect_map_id': {'key': 'redirectMapId', 'type': 'str'}, + 'private_link_service_arm_region': {'key': 'privateLinkServiceArmRegion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupConnectivityInformation, self).__init__(**kwargs) + self.group_id = None + self.member_name = None + self.customer_visible_fqdns = kwargs.get('customer_visible_fqdns', None) + self.internal_fqdn = None + self.redirect_map_id = kwargs.get('redirect_map_id', None) + self.private_link_service_arm_region = kwargs.get('private_link_service_arm_region', None) + + class ProxyResource(Resource): """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. @@ -988,6 +1080,133 @@ def __init__( self.value = kwargs.get('value', None) +class PrivateEndpointConnectionProxyProperties(msrest.serialization.Model): + """Private endpoint connection proxy object properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar e_tag: ETag from NRP. + :vartype e_tag: str + :param remote_private_endpoint: Remote private endpoint details. + :type remote_private_endpoint: ~device_update.models.RemotePrivateEndpoint + :ivar provisioning_state: The provisioning state of the private endpoint connection proxy + resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~device_update.models.PrivateEndpointConnectionProxyProvisioningState + :param status: Operation status. + :type status: str + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProxyProperties, self).__init__(**kwargs) + self.e_tag = None + self.remote_private_endpoint = kwargs.get('remote_private_endpoint', None) + self.provisioning_state = None + self.status = kwargs.get('status', None) + + +class PrivateEndpointConnectionProxy(ProxyResource, PrivateEndpointConnectionProxyProperties): + """Private endpoint connection proxy details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar e_tag: ETag from NRP. + :vartype e_tag: str + :param remote_private_endpoint: Remote private endpoint details. + :type remote_private_endpoint: ~device_update.models.RemotePrivateEndpoint + :ivar provisioning_state: The provisioning state of the private endpoint connection proxy + resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~device_update.models.PrivateEndpointConnectionProxyProvisioningState + :param status: Operation status. + :type status: str + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~device_update.models.SystemData + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProxy, self).__init__(**kwargs) + self.e_tag = None + self.remote_private_endpoint = kwargs.get('remote_private_endpoint', None) + self.provisioning_state = None + self.status = kwargs.get('status', None) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class PrivateEndpointConnectionProxyListResult(msrest.serialization.Model): + """The available private endpoint connection proxies for an Account (not to be used by anyone, here because of ARM requirements). + + :param value: The list of available private endpoint connection proxies for an Account. + :type value: list[~device_update.models.PrivateEndpointConnectionProxy] + :param next_link: The URI that can be used to request the next list of private endpoint + connection proxies. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnectionProxy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionProxyListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + class PrivateLinkResourceListResult(msrest.serialization.Model): """The available private link resources for an Account. @@ -1011,6 +1230,33 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class PrivateLinkServiceConnection(msrest.serialization.Model): + """Private link service connection details. + + :param name: Private link service connection name. + :type name: str + :param group_ids: List of group IDs. + :type group_ids: list[str] + :param request_message: Request message. + :type request_message: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.group_ids = kwargs.get('group_ids', None) + self.request_message = kwargs.get('request_message', None) + + class PrivateLinkServiceConnectionState(msrest.serialization.Model): """A collection of information about the state of the connection between service consumer and provider. @@ -1040,6 +1286,138 @@ def __init__( self.actions_required = kwargs.get('actions_required', None) +class PrivateLinkServiceProxy(msrest.serialization.Model): + """Private link service proxy details. + + :param id: NRP resource ID. + :type id: str + :param remote_private_link_service_connection_state: Remote private link service connection + state. + :type remote_private_link_service_connection_state: + ~device_update.models.PrivateLinkServiceConnectionState + :param remote_private_endpoint_connection: Remote private endpoint connection details. + :type remote_private_endpoint_connection: + ~device_update.models.PrivateLinkServiceProxyRemotePrivateEndpointConnection + :param group_connectivity_information: Group connectivity information. + :type group_connectivity_information: list[~device_update.models.GroupConnectivityInformation] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'remote_private_link_service_connection_state': {'key': 'remotePrivateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'remote_private_endpoint_connection': {'key': 'remotePrivateEndpointConnection', 'type': 'PrivateLinkServiceProxyRemotePrivateEndpointConnection'}, + 'group_connectivity_information': {'key': 'groupConnectivityInformation', 'type': '[GroupConnectivityInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceProxy, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.remote_private_link_service_connection_state = kwargs.get('remote_private_link_service_connection_state', None) + self.remote_private_endpoint_connection = kwargs.get('remote_private_endpoint_connection', None) + self.group_connectivity_information = kwargs.get('group_connectivity_information', None) + + +class RemotePrivateEndpointConnection(msrest.serialization.Model): + """Remote private endpoint connection details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Remote private endpoint connection ID. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + + +class PrivateLinkServiceProxyRemotePrivateEndpointConnection(RemotePrivateEndpointConnection): + """Remote private endpoint connection details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Remote private endpoint connection ID. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceProxyRemotePrivateEndpointConnection, self).__init__(**kwargs) + + +class RemotePrivateEndpoint(msrest.serialization.Model): + """Remote private endpoint details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Remote endpoint resource ID. + :type id: str + :ivar vnet_traffic_tag: Virtual network traffic tag. + :vartype vnet_traffic_tag: str + :param manual_private_link_service_connections: List of private link service connections that + need manual approval. + :type manual_private_link_service_connections: + list[~device_update.models.PrivateLinkServiceConnection] + :param private_link_service_connections: List of automatically approved private link service + connections. + :type private_link_service_connections: + list[~device_update.models.PrivateLinkServiceConnection] + :param private_link_service_proxies: List of private link service proxies. + :type private_link_service_proxies: list[~device_update.models.PrivateLinkServiceProxy] + :param connection_details: List of connection details. + :type connection_details: list[~device_update.models.ConnectionDetails] + """ + + _validation = { + 'vnet_traffic_tag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'str'}, + 'manual_private_link_service_connections': {'key': 'manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_connections': {'key': 'privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_proxies': {'key': 'privateLinkServiceProxies', 'type': '[PrivateLinkServiceProxy]'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.vnet_traffic_tag = None + self.manual_private_link_service_connections = kwargs.get('manual_private_link_service_connections', None) + self.private_link_service_connections = kwargs.get('private_link_service_connections', None) + self.private_link_service_proxies = kwargs.get('private_link_service_proxies', None) + self.connection_details = kwargs.get('connection_details', None) + + class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models_py3.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models_py3.py index 543fb00f5e55..50d3f714a492 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models_py3.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/models/_models_py3.py @@ -321,6 +321,51 @@ def __init__( self.message = message +class ConnectionDetails(msrest.serialization.Model): + """Private endpoint connection proxy object properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Connection details ID. + :vartype id: str + :ivar private_ip_address: Private IP address. + :vartype private_ip_address: str + :ivar link_identifier: Link ID. + :vartype link_identifier: str + :ivar group_id: Group ID. + :vartype group_id: str + :ivar member_name: Member name. + :vartype member_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'link_identifier': {'readonly': True}, + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionDetails, self).__init__(**kwargs) + self.id = None + self.private_ip_address = None + self.link_identifier = None + self.group_id = None + self.member_name = None + + class DiagnosticStorageProperties(msrest.serialization.Model): """Customer-initiated diagnostic log collection storage properties. @@ -455,6 +500,57 @@ def __init__( self.error = error +class GroupConnectivityInformation(msrest.serialization.Model): + """Group connectivity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: Group ID. + :vartype group_id: str + :ivar member_name: Member name. + :vartype member_name: str + :param customer_visible_fqdns: List of customer visible FQDNs. + :type customer_visible_fqdns: list[str] + :ivar internal_fqdn: Internal FQDN. + :vartype internal_fqdn: str + :param redirect_map_id: Redirect map ID. + :type redirect_map_id: str + :param private_link_service_arm_region: PrivateLinkService ARM region. + :type private_link_service_arm_region: str + """ + + _validation = { + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + 'internal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + 'customer_visible_fqdns': {'key': 'customerVisibleFqdns', 'type': '[str]'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'redirect_map_id': {'key': 'redirectMapId', 'type': 'str'}, + 'private_link_service_arm_region': {'key': 'privateLinkServiceArmRegion', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_visible_fqdns: Optional[List[str]] = None, + redirect_map_id: Optional[str] = None, + private_link_service_arm_region: Optional[str] = None, + **kwargs + ): + super(GroupConnectivityInformation, self).__init__(**kwargs) + self.group_id = None + self.member_name = None + self.customer_visible_fqdns = customer_visible_fqdns + self.internal_fqdn = None + self.redirect_map_id = redirect_map_id + self.private_link_service_arm_region = private_link_service_arm_region + + class ProxyResource(Resource): """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. @@ -1052,6 +1148,142 @@ def __init__( self.value = value +class PrivateEndpointConnectionProxyProperties(msrest.serialization.Model): + """Private endpoint connection proxy object properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar e_tag: ETag from NRP. + :vartype e_tag: str + :param remote_private_endpoint: Remote private endpoint details. + :type remote_private_endpoint: ~device_update.models.RemotePrivateEndpoint + :ivar provisioning_state: The provisioning state of the private endpoint connection proxy + resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~device_update.models.PrivateEndpointConnectionProxyProvisioningState + :param status: Operation status. + :type status: str + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + remote_private_endpoint: Optional["RemotePrivateEndpoint"] = None, + status: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionProxyProperties, self).__init__(**kwargs) + self.e_tag = None + self.remote_private_endpoint = remote_private_endpoint + self.provisioning_state = None + self.status = status + + +class PrivateEndpointConnectionProxy(ProxyResource, PrivateEndpointConnectionProxyProperties): + """Private endpoint connection proxy details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar e_tag: ETag from NRP. + :vartype e_tag: str + :param remote_private_endpoint: Remote private endpoint details. + :type remote_private_endpoint: ~device_update.models.RemotePrivateEndpoint + :ivar provisioning_state: The provisioning state of the private endpoint connection proxy + resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~device_update.models.PrivateEndpointConnectionProxyProvisioningState + :param status: Operation status. + :type status: str + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~device_update.models.SystemData + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'remote_private_endpoint': {'key': 'remotePrivateEndpoint', 'type': 'RemotePrivateEndpoint'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + remote_private_endpoint: Optional["RemotePrivateEndpoint"] = None, + status: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionProxy, self).__init__(remote_private_endpoint=remote_private_endpoint, status=status, **kwargs) + self.e_tag = None + self.remote_private_endpoint = remote_private_endpoint + self.provisioning_state = None + self.status = status + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class PrivateEndpointConnectionProxyListResult(msrest.serialization.Model): + """The available private endpoint connection proxies for an Account (not to be used by anyone, here because of ARM requirements). + + :param value: The list of available private endpoint connection proxies for an Account. + :type value: list[~device_update.models.PrivateEndpointConnectionProxy] + :param next_link: The URI that can be used to request the next list of private endpoint + connection proxies. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnectionProxy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnectionProxy"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionProxyListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class PrivateLinkResourceListResult(msrest.serialization.Model): """The available private link resources for an Account. @@ -1078,6 +1310,37 @@ def __init__( self.next_link = next_link +class PrivateLinkServiceConnection(msrest.serialization.Model): + """Private link service connection details. + + :param name: Private link service connection name. + :type name: str + :param group_ids: List of group IDs. + :type group_ids: list[str] + :param request_message: Request message. + :type request_message: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'group_ids': {'key': 'groupIds', 'type': '[str]'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + group_ids: Optional[List[str]] = None, + request_message: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(**kwargs) + self.name = name + self.group_ids = group_ids + self.request_message = request_message + + class PrivateLinkServiceConnectionState(msrest.serialization.Model): """A collection of information about the state of the connection between service consumer and provider. @@ -1111,6 +1374,149 @@ def __init__( self.actions_required = actions_required +class PrivateLinkServiceProxy(msrest.serialization.Model): + """Private link service proxy details. + + :param id: NRP resource ID. + :type id: str + :param remote_private_link_service_connection_state: Remote private link service connection + state. + :type remote_private_link_service_connection_state: + ~device_update.models.PrivateLinkServiceConnectionState + :param remote_private_endpoint_connection: Remote private endpoint connection details. + :type remote_private_endpoint_connection: + ~device_update.models.PrivateLinkServiceProxyRemotePrivateEndpointConnection + :param group_connectivity_information: Group connectivity information. + :type group_connectivity_information: list[~device_update.models.GroupConnectivityInformation] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'remote_private_link_service_connection_state': {'key': 'remotePrivateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'remote_private_endpoint_connection': {'key': 'remotePrivateEndpointConnection', 'type': 'PrivateLinkServiceProxyRemotePrivateEndpointConnection'}, + 'group_connectivity_information': {'key': 'groupConnectivityInformation', 'type': '[GroupConnectivityInformation]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + remote_private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + remote_private_endpoint_connection: Optional["PrivateLinkServiceProxyRemotePrivateEndpointConnection"] = None, + group_connectivity_information: Optional[List["GroupConnectivityInformation"]] = None, + **kwargs + ): + super(PrivateLinkServiceProxy, self).__init__(**kwargs) + self.id = id + self.remote_private_link_service_connection_state = remote_private_link_service_connection_state + self.remote_private_endpoint_connection = remote_private_endpoint_connection + self.group_connectivity_information = group_connectivity_information + + +class RemotePrivateEndpointConnection(msrest.serialization.Model): + """Remote private endpoint connection details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Remote private endpoint connection ID. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + + +class PrivateLinkServiceProxyRemotePrivateEndpointConnection(RemotePrivateEndpointConnection): + """Remote private endpoint connection details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Remote private endpoint connection ID. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceProxyRemotePrivateEndpointConnection, self).__init__(**kwargs) + + +class RemotePrivateEndpoint(msrest.serialization.Model): + """Remote private endpoint details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Remote endpoint resource ID. + :type id: str + :ivar vnet_traffic_tag: Virtual network traffic tag. + :vartype vnet_traffic_tag: str + :param manual_private_link_service_connections: List of private link service connections that + need manual approval. + :type manual_private_link_service_connections: + list[~device_update.models.PrivateLinkServiceConnection] + :param private_link_service_connections: List of automatically approved private link service + connections. + :type private_link_service_connections: + list[~device_update.models.PrivateLinkServiceConnection] + :param private_link_service_proxies: List of private link service proxies. + :type private_link_service_proxies: list[~device_update.models.PrivateLinkServiceProxy] + :param connection_details: List of connection details. + :type connection_details: list[~device_update.models.ConnectionDetails] + """ + + _validation = { + 'vnet_traffic_tag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'str'}, + 'manual_private_link_service_connections': {'key': 'manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_connections': {'key': 'privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'private_link_service_proxies': {'key': 'privateLinkServiceProxies', 'type': '[PrivateLinkServiceProxy]'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetails]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + manual_private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + private_link_service_proxies: Optional[List["PrivateLinkServiceProxy"]] = None, + connection_details: Optional[List["ConnectionDetails"]] = None, + **kwargs + ): + super(RemotePrivateEndpoint, self).__init__(**kwargs) + self.id = id + self.vnet_traffic_tag = None + self.manual_private_link_service_connections = manual_private_link_service_connections + self.private_link_service_connections = private_link_service_connections + self.private_link_service_proxies = private_link_service_proxies + self.connection_details = connection_details + + class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/__init__.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/__init__.py index 146a4bd8cde2..39c22b434362 100644 --- a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/__init__.py +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/__init__.py @@ -11,6 +11,7 @@ from ._instances_operations import InstancesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connection_proxies_operations import PrivateEndpointConnectionProxiesOperations from ._operations import Operations __all__ = [ @@ -19,5 +20,6 @@ 'InstancesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionProxiesOperations', 'Operations', ] diff --git a/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/_private_endpoint_connection_proxies_operations.py b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/_private_endpoint_connection_proxies_operations.py new file mode 100644 index 000000000000..36f7c2dfb1d3 --- /dev/null +++ b/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/operations/_private_endpoint_connection_proxies_operations.py @@ -0,0 +1,519 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionProxiesOperations(object): + """PrivateEndpointConnectionProxiesOperations 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: ~device_update.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionProxyListResult"] + """(INTERNAL - DO NOT USE) List all private endpoint connection proxies in a device update + account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionProxyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~device_update.models.PrivateEndpointConnectionProxyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + } + 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('PrivateEndpointConnectionProxyListResult', 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]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies'} # type: ignore + + def validate( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + private_endpoint_connection_proxy, # type: "_models.PrivateEndpointConnectionProxy" + **kwargs # type: Any + ): + # type: (...) -> None + """(INTERNAL - DO NOT USE) Validates a private endpoint connection proxy object. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :param private_endpoint_connection_proxy: The parameters for creating a private endpoint + connection proxy. + :type private_endpoint_connection_proxy: ~device_update.models.PrivateEndpointConnectionProxy + :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-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection_proxy, 'PrivateEndpointConnectionProxy') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}/validate'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionProxy" + """(INTERNAL - DO NOT USE) Get the specified private endpoint connection proxy associated with the + device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionProxy, or the result of cls(response) + :rtype: ~device_update.models.PrivateEndpointConnectionProxy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + private_endpoint_connection_proxy, # type: "_models.PrivateEndpointConnectionProxy" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionProxy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection_proxy, 'PrivateEndpointConnectionProxy') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + private_endpoint_connection_proxy, # type: "_models.PrivateEndpointConnectionProxy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnectionProxy"] + """(INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy + resource associated with the device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :param private_endpoint_connection_proxy: The parameters for creating a private endpoint + connection proxy. + :type private_endpoint_connection_proxy: ~device_update.models.PrivateEndpointConnectionProxy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnectionProxy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~device_update.models.PrivateEndpointConnectionProxy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionProxy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_proxy_id=private_endpoint_connection_proxy_id, + private_endpoint_connection_proxy=private_endpoint_connection_proxy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionProxy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_proxy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """(INTERNAL - DO NOT USE) Deletes the specified private endpoint connection proxy associated with + the device update account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: Account name. + :type account_name: str + :param private_endpoint_connection_proxy_id: The ID of the private endpoint connection proxy + object. + :type private_endpoint_connection_proxy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_proxy_id=private_endpoint_connection_proxy_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$'), + 'privateEndpointConnectionProxyId': self._serialize.url("private_endpoint_connection_proxy_id", private_endpoint_connection_proxy_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}'} # type: ignore