From beea4a0046a9121e95b8184f9d8d99d8b5d9cd09 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Jun 2021 19:49:56 +0000 Subject: [PATCH] CodeGen from PR 14766 in Azure/azure-rest-api-specs Merge dc0bd7a09e4288c8b1ae5fea8391d47234401914 into 61e7148e9592c5efc95e5c16a5bb4f2dc26d6de0 --- .../azure-mgmt-attestation/MANIFEST.in | 1 + .../azure-mgmt-attestation/_meta.json | 8 ++ .../azure/mgmt/attestation/models/__init__.py | 8 ++ .../_attestation_management_client_enums.py | 7 ++ .../azure/mgmt/attestation/models/_models.py | 75 ++++++++++++++++-- .../mgmt/attestation/models/_models_py3.py | 77 +++++++++++++++++-- .../_attestation_providers_operations.py | 10 +-- ...private_endpoint_connections_operations.py | 20 ++--- 8 files changed, 178 insertions(+), 28 deletions(-) create mode 100644 sdk/attestation/azure-mgmt-attestation/_meta.json diff --git a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in +++ b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/attestation/azure-mgmt-attestation/_meta.json b/sdk/attestation/azure-mgmt-attestation/_meta.json new file mode 100644 index 000000000000..316e479f263b --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "7c66235f0f2b488ef3e7c78bbfaf8d9206a7e6af", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/attestation/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/attestation/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py index eb3df2884914..462781b0471d 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py @@ -21,7 +21,9 @@ from ._models_py3 import OperationList from ._models_py3 import OperationsDefinition from ._models_py3 import OperationsDisplayDefinition + from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import SystemData @@ -38,7 +40,9 @@ from ._models import OperationList from ._models import OperationsDefinition from ._models import OperationsDisplayDefinition + from ._models import PrivateEndpoint from ._models import PrivateEndpointConnection + from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource from ._models import Resource from ._models import SystemData @@ -47,6 +51,7 @@ from ._attestation_management_client_enums import ( CreatedByType, AttestationServiceStatus, + PrivateEndpointServiceConnectionStatus, PrivateEndpointConnectionProvisioningState, ) @@ -62,7 +67,9 @@ 'OperationList', 'OperationsDefinition', 'OperationsDisplayDefinition', + 'PrivateEndpoint', 'PrivateEndpointConnection', + 'PrivateLinkServiceConnectionState', 'ProxyResource', 'Resource', 'SystemData', @@ -70,5 +77,6 @@ 'PrivateEndpointConnectionPaged', 'CreatedByType', 'AttestationServiceStatus', + 'PrivateEndpointServiceConnectionStatus', 'PrivateEndpointConnectionProvisioningState', ] diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py index 7e2b71ca7e57..ff62d97b501b 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py @@ -27,6 +27,13 @@ class AttestationServiceStatus(str, Enum): error = "Error" +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + class PrivateEndpointConnectionProvisioningState(str, Enum): succeeded = "Succeeded" diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py index 3abd6f8522fd..cafd2c0a1a4a 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py @@ -560,12 +560,37 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class PrivateEndpointConnection(Resource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -574,9 +599,16 @@ class PrivateEndpointConnection(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Deleting', - 'Failed' + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' :type provisioning_state: str or ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState """ @@ -585,20 +617,54 @@ class PrivateEndpointConnection(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) self.provisioning_state = kwargs.get('provisioning_state', None) +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + class ProxyResource(Resource): """Proxy Resource. @@ -651,8 +717,7 @@ class SystemData(Model): 'ManagedIdentity', 'Key' :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py index 2ed412b14b17..139db8c0e67a 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py @@ -560,12 +560,37 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class PrivateEndpointConnection(Resource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -574,9 +599,16 @@ class PrivateEndpointConnection(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Deleting', - 'Failed' + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' :type provisioning_state: str or ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState """ @@ -585,20 +617,54 @@ class PrivateEndpointConnection(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, private_link_service_connection_state, private_endpoint=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 PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class ProxyResource(Resource): """Proxy Resource. @@ -651,8 +717,7 @@ class SystemData(Model): 'ManagedIdentity', 'Key' :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py index 44e0b02df00b..4793b3d60969 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_attestation_providers_operations.py @@ -62,7 +62,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -127,7 +127,7 @@ def create( url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -200,7 +200,7 @@ def update( url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -265,7 +265,7 @@ def delete( url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -374,7 +374,7 @@ def list_by_resource_group( # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py index 92f51852ecf4..ca82f7cfca53 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py @@ -64,7 +64,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } @@ -139,7 +139,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') @@ -181,7 +181,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} def create( - self, resource_group_name, provider_name, private_endpoint_connection_name, provisioning_state=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, provider_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): """Update the state of specified private endpoint connection associated with the attestation provider. @@ -193,11 +193,9 @@ def create( :param private_endpoint_connection_name: Name of the private endpoint connection associated with the attestation providers. :type private_endpoint_connection_name: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', - 'Deleting', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.attestation.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 @@ -208,12 +206,10 @@ def create( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - properties = models.PrivateEndpointConnection(provisioning_state=provisioning_state) - # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') @@ -283,7 +279,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'providerName': self._serialize.url("provider_name", provider_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str')