diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py index 4bb52389f83f..a016b5ddfbde 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py @@ -110,13 +110,10 @@ def operations(self): def private_endpoint_connections(self): """Instance depends on the API version: - * 2018-02-14: :class:`PrivateEndpointConnectionsOperations` * 2019-09-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') - if api_version == '2018-02-14': - from .v2018_02_14.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2019-09-01': + if api_version == '2019-09-01': from .v2019_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -126,13 +123,10 @@ def private_endpoint_connections(self): def private_link_resources(self): """Instance depends on the API version: - * 2018-02-14: :class:`PrivateLinkResourcesOperations` * 2019-09-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') - if api_version == '2018-02-14': - from .v2018_02_14.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2019-09-01': + if api_version == '2019-09-01': from .v2019_09_01.operations import PrivateLinkResourcesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_key_vault_management_client.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_key_vault_management_client.py index f3c9b3077f8d..bee56df36ab3 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_key_vault_management_client.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_key_vault_management_client.py @@ -14,8 +14,6 @@ from ._configuration import KeyVaultManagementClientConfiguration from .operations import VaultsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations from .operations import Operations from . import models @@ -28,10 +26,6 @@ class KeyVaultManagementClient(SDKClient): :ivar vaults: Vaults operations :vartype vaults: azure.mgmt.keyvault.v2018_02_14.operations.VaultsOperations - :ivar private_endpoint_connections: PrivateEndpointConnections operations - :vartype private_endpoint_connections: azure.mgmt.keyvault.v2018_02_14.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResources operations - :vartype private_link_resources: azure.mgmt.keyvault.v2018_02_14.operations.PrivateLinkResourcesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.keyvault.v2018_02_14.operations.Operations @@ -58,9 +52,5 @@ def __init__( self.vaults = VaultsOperations( self._client, self.config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/__init__.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/__init__.py index 047f744d15bf..5d2398a8ad13 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/__init__.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/__init__.py @@ -20,12 +20,6 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import Permissions - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionItem - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import Resource from ._models_py3 import ServiceSpecification from ._models_py3 import Sku @@ -49,12 +43,6 @@ from ._models import Operation from ._models import OperationDisplay from ._models import Permissions - from ._models import PrivateEndpoint - from ._models import PrivateEndpointConnection - from ._models import PrivateEndpointConnectionItem - from ._models import PrivateLinkResource - from ._models import PrivateLinkResourceListResult - from ._models import PrivateLinkServiceConnectionState from ._models import Resource from ._models import ServiceSpecification from ._models import Sku @@ -80,8 +68,6 @@ CreateMode, NetworkRuleBypassOptions, NetworkRuleAction, - PrivateEndpointServiceConnectionStatus, - PrivateEndpointConnectionProvisioningState, Reason, AccessPolicyUpdateKind, ) @@ -97,12 +83,6 @@ 'Operation', 'OperationDisplay', 'Permissions', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionItem', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', 'Resource', 'ServiceSpecification', 'Sku', @@ -127,8 +107,6 @@ 'CreateMode', 'NetworkRuleBypassOptions', 'NetworkRuleAction', - 'PrivateEndpointServiceConnectionStatus', - 'PrivateEndpointConnectionProvisioningState', 'Reason', 'AccessPolicyUpdateKind', ] diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_key_vault_management_client_enums.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_key_vault_management_client_enums.py index f994b6eca629..e31e5b8e5c8f 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_key_vault_management_client_enums.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_key_vault_management_client_enums.py @@ -106,24 +106,6 @@ class NetworkRuleAction(str, Enum): deny = "Deny" -class PrivateEndpointServiceConnectionStatus(str, Enum): - - pending = "Pending" - approved = "Approved" - rejected = "Rejected" - disconnected = "Disconnected" - - -class PrivateEndpointConnectionProvisioningState(str, Enum): - - succeeded = "Succeeded" - creating = "Creating" - updating = "Updating" - deleting = "Deleting" - failed = "Failed" - disconnected = "Disconnected" - - class Reason(str, Enum): account_name_invalid = "AccountNameInvalid" diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models.py index bb2afb4d5a2a..e659b239f793 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model -from msrest.exceptions import HttpOperationError class AccessPolicyEntry(Model): @@ -94,54 +93,12 @@ def __init__(self, **kwargs): class CloudError(Model): - """An error response from Key Vault resource provider. - - :param error: - :type error: ~azure.mgmt.keyvault.v2018_02_14.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, **kwargs): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): - """An error response from Key Vault resource provider. - - :param code: Error code. This is a mnemonic that can be consumed - programmatically. - :type code: str - :param message: User friendly error message. The message is typically - localized and may vary with service version. - :type message: str + """CloudError. """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs): - super(CloudErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - class DeletedVault(Model): """Deleted vault information with extended details. @@ -398,53 +355,32 @@ def __init__(self, **kwargs): self.storage = kwargs.get('storage', None) -class PrivateEndpoint(Model): - """Private endpoint object properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Full identifier of the private endpoint resource. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - class Resource(Model): """Key Vault resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified identifier of the key vault resource. + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str - :ivar name: Name of the key vault resource. + :ivar name: The name of the key vault. :vartype name: str - :ivar type: Resource type of the key vault resource. + :ivar type: The resource type of the key vault. :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, + 'location': {'required': True}, } _attribute_map = { @@ -460,193 +396,8 @@ def __init__(self, **kwargs): self.id = None self.name = None self.type = None - self.location = None - self.tags = None - - -class PrivateEndpointConnection(Resource): - """Private endpoint connection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the key vault resource. - :vartype id: str - :ivar name: Name of the key vault resource. - :vartype name: str - :ivar type: Resource type of the key vault resource. - :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] - :param private_endpoint: Properties of the private endpoint object. - :type private_endpoint: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpoint - :param private_link_service_connection_state: Approval state of the - private link connection. - :type private_link_service_connection_state: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkServiceConnectionState - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Updating', - 'Deleting', 'Failed', 'Disconnected' - :type provisioning_state: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateEndpointConnectionItem(Model): - """Private endpoint connection item. - - :param private_endpoint: Properties of the private endpoint object. - :type private_endpoint: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpoint - :param private_link_service_connection_state: Approval state of the - private link connection. - :type private_link_service_connection_state: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkServiceConnectionState - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Updating', - 'Deleting', 'Failed', 'Disconnected' - :type provisioning_state: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionProvisioningState - """ - - _attribute_map = { - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateEndpointConnectionItem, self).__init__(**kwargs) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the key vault resource. - :vartype id: str - :ivar name: Name of the key vault resource. - :vartype name: str - :ivar type: Resource type of the key vault resource. - :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] - :ivar group_id: Group identifier of private link resource. - :vartype group_id: str - :ivar required_members: Required member names of private link resource. - :vartype required_members: list[str] - :param required_zone_names: Required DNS zone names of the the private - link resource. - :type required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(Model): - """A list of private link resources. - - :param value: Array of private link resources - :type value: - list[~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__(self, **kwargs): - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(Model): - """An object that represents the approval state of the private link - connection. - - :param status: Indicates whether the connection has been approved, - rejected or removed by the key vault owner. Possible values include: - 'Pending', 'Approved', 'Rejected', 'Disconnected' - :type status: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointServiceConnectionStatus - :param description: The reason for approval or rejection. - :type description: str - :param action_required: A message indicating if changes on the service - provider require any updates on the consumer. - :type action_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.action_required = kwargs.get('action_required', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) class ServiceSpecification(Model): @@ -699,7 +450,7 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) -class Vault(Model): +class Vault(Resource): """Resource information with extended details. Variables are only populated by the server, and will be ignored when @@ -707,15 +458,16 @@ class Vault(Model): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified identifier of the key vault resource. + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str - :ivar name: Name of the key vault resource. + :ivar name: The name of the key vault. :vartype name: str - :ivar type: Resource type of the key vault resource. + :ivar type: The resource type of the key vault. :vartype type: str - :param location: Azure location of the key vault resource. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str - :param tags: Tags assigned to the key vault resource. + :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.v2018_02_14.models.VaultProperties @@ -725,6 +477,7 @@ class Vault(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'required': True}, 'properties': {'required': True}, } @@ -739,11 +492,6 @@ class Vault(Model): def __init__(self, **kwargs): super(Vault, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) self.properties = kwargs.get('properties', None) @@ -978,9 +726,6 @@ def __init__(self, **kwargs): class VaultProperties(Model): """Properties of the vault. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. :param tenant_id: Required. The Azure Active Directory tenant ID that @@ -1024,19 +769,14 @@ class VaultProperties(Model): functionality is irreversible - that is, the property does not accept false as its value. :type enable_purge_protection: bool - :param network_acls: Rules governing the accessibility of the key vault - from specific network locations. + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. :type network_acls: ~azure.mgmt.keyvault.v2018_02_14.models.NetworkRuleSet - :ivar private_endpoint_connections: List of private endpoint connections - associated with the key vault. - :vartype private_endpoint_connections: - list[~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionItem] """ _validation = { 'tenant_id': {'required': True}, 'sku': {'required': True}, - 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1051,7 +791,6 @@ class VaultProperties(Model): 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionItem]'}, } def __init__(self, **kwargs): @@ -1067,7 +806,6 @@ def __init__(self, **kwargs): self.create_mode = kwargs.get('create_mode', None) self.enable_purge_protection = kwargs.get('enable_purge_protection', None) self.network_acls = kwargs.get('network_acls', None) - self.private_endpoint_connections = None class VirtualNetworkRule(Model): diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models_py3.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models_py3.py index 7c13a32a59ed..b7a6b552a83a 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models_py3.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/_models_py3.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model -from msrest.exceptions import HttpOperationError class AccessPolicyEntry(Model): @@ -94,54 +93,12 @@ def __init__(self, **kwargs) -> None: class CloudError(Model): - """An error response from Key Vault resource provider. - - :param error: - :type error: ~azure.mgmt.keyvault.v2018_02_14.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): - """An error response from Key Vault resource provider. - - :param code: Error code. This is a mnemonic that can be consumed - programmatically. - :type code: str - :param message: User friendly error message. The message is typically - localized and may vary with service version. - :type message: str + """CloudError. """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: - super(CloudErrorBody, self).__init__(**kwargs) - self.code = code - self.message = message - class DeletedVault(Model): """Deleted vault information with extended details. @@ -398,53 +355,32 @@ def __init__(self, *, keys=None, secrets=None, certificates=None, storage=None, self.storage = storage -class PrivateEndpoint(Model): - """Private endpoint object properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Full identifier of the private endpoint resource. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - class Resource(Model): """Key Vault resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified identifier of the key vault resource. + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str - :ivar name: Name of the key vault resource. + :ivar name: The name of the key vault. :vartype name: str - :ivar type: Resource type of the key vault resource. + :ivar type: The resource type of the key vault. :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, + 'location': {'required': True}, } _attribute_map = { @@ -455,198 +391,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, **kwargs) -> None: super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = None - self.tags = None - - -class PrivateEndpointConnection(Resource): - """Private endpoint connection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the key vault resource. - :vartype id: str - :ivar name: Name of the key vault resource. - :vartype name: str - :ivar type: Resource type of the key vault resource. - :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] - :param private_endpoint: Properties of the private endpoint object. - :type private_endpoint: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpoint - :param private_link_service_connection_state: Approval state of the - private link connection. - :type private_link_service_connection_state: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkServiceConnectionState - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Updating', - 'Deleting', 'Failed', 'Disconnected' - :type provisioning_state: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, provisioning_state=None, **kwargs) -> None: - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionItem(Model): - """Private endpoint connection item. - - :param private_endpoint: Properties of the private endpoint object. - :type private_endpoint: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpoint - :param private_link_service_connection_state: Approval state of the - private link connection. - :type private_link_service_connection_state: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkServiceConnectionState - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Updating', - 'Deleting', 'Failed', 'Disconnected' - :type provisioning_state: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionProvisioningState - """ - - _attribute_map = { - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, provisioning_state=None, **kwargs) -> None: - super(PrivateEndpointConnectionItem, self).__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateLinkResource(Resource): - """A private link resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified identifier of the key vault resource. - :vartype id: str - :ivar name: Name of the key vault resource. - :vartype name: str - :ivar type: Resource type of the key vault resource. - :vartype type: str - :ivar location: Azure location of the key vault resource. - :vartype location: str - :ivar tags: Tags assigned to the key vault resource. - :vartype tags: dict[str, str] - :ivar group_id: Group identifier of private link resource. - :vartype group_id: str - :ivar required_members: Required member names of private link resource. - :vartype required_members: list[str] - :param required_zone_names: Required DNS zone names of the the private - link resource. - :type required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'tags': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__(self, *, required_zone_names=None, **kwargs) -> None: - super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = required_zone_names - - -class PrivateLinkResourceListResult(Model): - """A list of private link resources. - - :param value: Array of private link resources - :type value: - list[~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(Model): - """An object that represents the approval state of the private link - connection. - - :param status: Indicates whether the connection has been approved, - rejected or removed by the key vault owner. Possible values include: - 'Pending', 'Approved', 'Rejected', 'Disconnected' - :type status: str or - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointServiceConnectionStatus - :param description: The reason for approval or rejection. - :type description: str - :param action_required: A message indicating if changes on the service - provider require any updates on the consumer. - :type action_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'action_required': {'key': 'actionRequired', 'type': 'str'}, - } - - def __init__(self, *, status=None, description: str=None, action_required: str=None, **kwargs) -> None: - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = status - self.description = description - self.action_required = action_required + self.location = location + self.tags = tags class ServiceSpecification(Model): @@ -699,7 +450,7 @@ def __init__(self, *, name, **kwargs) -> None: self.name = name -class Vault(Model): +class Vault(Resource): """Resource information with extended details. Variables are only populated by the server, and will be ignored when @@ -707,15 +458,16 @@ class Vault(Model): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified identifier of the key vault resource. + :ivar id: The Azure Resource Manager resource ID for the key vault. :vartype id: str - :ivar name: Name of the key vault resource. + :ivar name: The name of the key vault. :vartype name: str - :ivar type: Resource type of the key vault resource. + :ivar type: The resource type of the key vault. :vartype type: str - :param location: Azure location of the key vault resource. + :param location: Required. The supported Azure location where the key + vault should be created. :type location: str - :param tags: Tags assigned to the key vault resource. + :param tags: The tags that will be assigned to the key vault. :type tags: dict[str, str] :param properties: Required. Properties of the vault :type properties: ~azure.mgmt.keyvault.v2018_02_14.models.VaultProperties @@ -725,6 +477,7 @@ class Vault(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'required': True}, 'properties': {'required': True}, } @@ -737,13 +490,8 @@ class Vault(Model): 'properties': {'key': 'properties', 'type': 'VaultProperties'}, } - def __init__(self, *, properties, location: str=None, tags=None, **kwargs) -> None: - super(Vault, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(Vault, self).__init__(location=location, tags=tags, **kwargs) self.properties = properties @@ -978,9 +726,6 @@ def __init__(self, *, tenant_id: str=None, sku=None, access_policies=None, enabl class VaultProperties(Model): """Properties of the vault. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. :param tenant_id: Required. The Azure Active Directory tenant ID that @@ -1024,19 +769,14 @@ class VaultProperties(Model): functionality is irreversible - that is, the property does not accept false as its value. :type enable_purge_protection: bool - :param network_acls: Rules governing the accessibility of the key vault - from specific network locations. + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. :type network_acls: ~azure.mgmt.keyvault.v2018_02_14.models.NetworkRuleSet - :ivar private_endpoint_connections: List of private endpoint connections - associated with the key vault. - :vartype private_endpoint_connections: - list[~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnectionItem] """ _validation = { 'tenant_id': {'required': True}, 'sku': {'required': True}, - 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1051,7 +791,6 @@ class VaultProperties(Model): 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionItem]'}, } def __init__(self, *, tenant_id: str, sku, access_policies=None, vault_uri: str=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: @@ -1067,7 +806,6 @@ def __init__(self, *, tenant_id: str, sku, access_policies=None, vault_uri: str= self.create_mode = create_mode self.enable_purge_protection = enable_purge_protection self.network_acls = network_acls - self.private_endpoint_connections = None class VirtualNetworkRule(Model): diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/__init__.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/__init__.py index 70f7bdab83d8..893317da8cec 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/__init__.py +++ b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/__init__.py @@ -10,13 +10,9 @@ # -------------------------------------------------------------------------- from ._vaults_operations import VaultsOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations -from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._operations import Operations __all__ = [ 'VaultsOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', 'Operations', ] diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_endpoint_connections_operations.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 12d48db45692..000000000000 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,303 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class PrivateEndpointConnectionsOperations(object): - """PrivateEndpointConnectionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2018-02-14". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-14" - - self.config = config - - def get( - self, resource_group_name, vault_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): - """Gets the specified private endpoint connection associated with the key - vault. - - :param resource_group_name: Name of the resource group that contains - the key vault. - :type resource_group_name: str - :param vault_name: The name of the key vault. - :type vault_name: str - :param private_endpoint_connection_name: Name of the private endpoint - connection associated with the key vault. - :type private_endpoint_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrivateEndpointConnection or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnection or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - 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'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} - - def put( - self, resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): - """Updates the specified private endpoint connection associated with the - key vault. - - :param resource_group_name: Name of the resource group that contains - the key vault. - :type resource_group_name: str - :param vault_name: The name of the key vault. - :type vault_name: str - :param private_endpoint_connection_name: Name of the private endpoint - connection associated with the key vault. - :type private_endpoint_connection_name: str - :param properties: The intended state of private endpoint connection. - :type properties: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnection - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrivateEndpointConnection or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnection or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.put.metadata['url'] - 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'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(properties, 'PrivateEndpointConnection') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - header_dict = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', response) - header_dict = { - 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} - - - def _delete_initial( - self, resource_group_name, vault_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - 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'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('PrivateEndpointConnection', response) - header_dict = { - 'Retry-After': 'int', - 'Location': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - def delete( - self, resource_group_name, vault_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes the specified private endpoint connection associated with the - key vault. - - :param resource_group_name: Name of the resource group that contains - the key vault. - :type resource_group_name: str - :param vault_name: The name of the key vault. - :type vault_name: str - :param private_endpoint_connection_name: Name of the private endpoint - connection associated with the key vault. - :type private_endpoint_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - PrivateEndpointConnection or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnection] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.keyvault.v2018_02_14.models.PrivateEndpointConnection]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - vault_name=vault_name, - private_endpoint_connection_name=private_endpoint_connection_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - header_dict = { - 'Retry-After': 'int', - 'Location': 'str', - } - deserialized = self._deserialize('PrivateEndpointConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_link_resources_operations.py b/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_link_resources_operations.py deleted file mode 100644 index 13de4a1b2b7a..000000000000 --- a/sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,104 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PrivateLinkResourcesOperations(object): - """PrivateLinkResourcesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2018-02-14". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-14" - - self.config = config - - def list_by_vault( - self, resource_group_name, vault_name, custom_headers=None, raw=False, **operation_config): - """Gets the private link resources supported for the key vault. - - :param resource_group_name: Name of the resource group that contains - the key vault. - :type resource_group_name: str - :param vault_name: The name of the key vault. - :type vault_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrivateLinkResourceListResult or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.keyvault.v2018_02_14.models.PrivateLinkResourceListResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_by_vault.metadata['url'] - 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'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrivateLinkResourceListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_by_vault.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources'}