From fd661a7e044428c74b728580bc69bf78e1e6a4c5 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Tue, 17 May 2022 21:56:08 +0800 Subject: [PATCH] code and test (#24456) Co-authored-by: PythonSdkPipelines --- .../azure-mgmt-servicelinker/CHANGELOG.md | 8 +++ .../azure-mgmt-servicelinker/MANIFEST.in | 1 + .../azure-mgmt-servicelinker/_meta.json | 2 +- .../azure/mgmt/servicelinker/_version.py | 2 +- .../aio/operations/_linker_operations.py | 19 +++--- .../mgmt/servicelinker/models/__init__.py | 10 +-- .../mgmt/servicelinker/models/_models_py3.py | 64 +++++++++++-------- ..._service_linker_management_client_enums.py | 11 +++- .../operations/_linker_operations.py | 16 ++--- .../azure-mgmt-servicelinker/setup.py | 4 ++ 10 files changed, 86 insertions(+), 51 deletions(-) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/CHANGELOG.md b/sdk/servicelinker/azure-mgmt-servicelinker/CHANGELOG.md index c0a0c0d7eb8b..7f2891882c43 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/CHANGELOG.md +++ b/sdk/servicelinker/azure-mgmt-servicelinker/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.1.0 (2022-05-16) + +**Features** + + - Added model AzureResourceType + - Added model TargetServiceType + - Added model ValidateOperationResult + ## 1.0.0 (2022-04-22) **Features** diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/MANIFEST.in b/sdk/servicelinker/azure-mgmt-servicelinker/MANIFEST.in index 2c31e8da0cb1..8e1239d23a81 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/MANIFEST.in +++ b/sdk/servicelinker/azure-mgmt-servicelinker/MANIFEST.in @@ -4,3 +4,4 @@ include *.md include azure/__init__.py include azure/mgmt/__init__.py include LICENSE +include azure/mgmt/servicelinker/py.typed diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json index dbec3a253ffc..a22d7523f996 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json +++ b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "9d8640319ef481ae301b67b033d6ae0bd30422c3", + "commit": "0cc5e2efd6ffccf30e80d1e150b488dd87198b94", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/servicelinker/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/servicelinker/resource-manager/readme.md" diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py index c47f66669f1b..59deb8c7263b 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.1.0" diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py index 064568598f3d..7b98198c9c88 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py @@ -545,8 +545,8 @@ async def _validate_initial( resource_uri: str, linker_name: str, **kwargs: Any - ) -> Optional["_models.ValidateResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ValidateResult"]] + ) -> Optional["_models.ValidateOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ValidateOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -577,7 +577,7 @@ async def _validate_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ValidateResult', pipeline_response) + deserialized = self._deserialize('ValidateOperationResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -593,7 +593,7 @@ async def begin_validate( resource_uri: str, linker_name: str, **kwargs: Any - ) -> AsyncLROPoller["_models.ValidateResult"]: + ) -> AsyncLROPoller["_models.ValidateOperationResult"]: """Validate a link. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to @@ -609,14 +609,15 @@ async def begin_validate( :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 ValidateResult or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicelinker.models.ValidateResult] + :return: An instance of AsyncLROPoller that returns either ValidateOperationResult or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicelinker.models.ValidateOperationResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-05-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -634,7 +635,7 @@ async def begin_validate( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ValidateResult', pipeline_response) + deserialized = self._deserialize('ValidateOperationResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py index 7687e259e629..85481117b973 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py @@ -37,7 +37,7 @@ from ._models_py3 import TargetServiceBase from ._models_py3 import UserAssignedIdentityAuthInfo from ._models_py3 import VNetSolution -from ._models_py3 import ValidateResult +from ._models_py3 import ValidateOperationResult from ._models_py3 import ValidationResultItem from ._models_py3 import ValueSecretInfo @@ -45,11 +45,12 @@ from ._service_linker_management_client_enums import ( ActionType, AuthType, + AzureResourceType, ClientType, CreatedByType, Origin, SecretType, - Type, + TargetServiceType, VNetSolutionType, ValidationResultStatus, ) @@ -86,16 +87,17 @@ 'TargetServiceBase', 'UserAssignedIdentityAuthInfo', 'VNetSolution', - 'ValidateResult', + 'ValidateOperationResult', 'ValidationResultItem', 'ValueSecretInfo', 'ActionType', 'AuthType', + 'AzureResourceType', 'ClientType', 'CreatedByType', 'Origin', 'SecretType', - 'Type', + 'TargetServiceType', 'VNetSolutionType', 'ValidationResultStatus', ] diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py index e66f6d614f84..24ece4530d7b 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py @@ -60,8 +60,8 @@ class AzureResourcePropertiesBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar type: Required. The azure resource type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.AzureResourceType """ _validation = { @@ -92,8 +92,8 @@ class AzureKeyVaultProperties(AzureResourcePropertiesBase): All required parameters must be populated in order to send to Azure. :ivar type: Required. The azure resource type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "KeyVault". + :vartype type: str or ~azure.mgmt.servicelinker.models.AzureResourceType :ivar connect_as_kubernetes_csi_driver: True if connect via Kubernetes CSI Driver. :vartype connect_as_kubernetes_csi_driver: bool """ @@ -131,8 +131,8 @@ class TargetServiceBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar type: Required. The target service type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry". + :vartype type: str or ~azure.mgmt.servicelinker.models.TargetServiceType """ _validation = { @@ -163,8 +163,8 @@ class AzureResource(TargetServiceBase): All required parameters must be populated in order to send to Azure. :ivar type: Required. The target service type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry". + :vartype type: str or ~azure.mgmt.servicelinker.models.TargetServiceType :ivar id: The Id of azure resource. :vartype id: str :ivar resource_properties: The azure resource connection related properties. @@ -206,8 +206,8 @@ class ConfluentBootstrapServer(TargetServiceBase): All required parameters must be populated in order to send to Azure. :ivar type: Required. The target service type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry". + :vartype type: str or ~azure.mgmt.servicelinker.models.TargetServiceType :ivar endpoint: The endpoint of service. :vartype endpoint: str """ @@ -242,8 +242,8 @@ class ConfluentSchemaRegistry(TargetServiceBase): All required parameters must be populated in order to send to Azure. :ivar type: Required. The target service type.Constant filled by server. Possible values - include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "KeyVault". - :vartype type: str or ~azure.mgmt.servicelinker.models.Type + include: "AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry". + :vartype type: str or ~azure.mgmt.servicelinker.models.TargetServiceType :ivar endpoint: The endpoint of service. :vartype endpoint: str """ @@ -1264,9 +1264,13 @@ def __init__( self.subscription_id = subscription_id -class ValidateResult(msrest.serialization.Model): - """The validation result for a linker. +class ValidateOperationResult(msrest.serialization.Model): + """The validation operation result for a linker. + :ivar resource_id: Validated linker id. + :vartype resource_id: str + :ivar status: Validation operation status. + :vartype status: str :ivar linker_name: The linker name. :vartype linker_name: str :ivar is_connection_available: A boolean value indicating whether the connection is available @@ -1288,19 +1292,23 @@ class ValidateResult(msrest.serialization.Model): """ _attribute_map = { - 'linker_name': {'key': 'linkerName', 'type': 'str'}, - 'is_connection_available': {'key': 'isConnectionAvailable', 'type': 'bool'}, - 'report_start_time_utc': {'key': 'reportStartTimeUtc', 'type': 'iso-8601'}, - 'report_end_time_utc': {'key': 'reportEndTimeUtc', 'type': 'iso-8601'}, - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'target_id': {'key': 'targetId', 'type': 'str'}, - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'validation_detail': {'key': 'validationDetail', 'type': '[ValidationResultItem]'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'linker_name': {'key': 'properties.linkerName', 'type': 'str'}, + 'is_connection_available': {'key': 'properties.isConnectionAvailable', 'type': 'bool'}, + 'report_start_time_utc': {'key': 'properties.reportStartTimeUtc', 'type': 'iso-8601'}, + 'report_end_time_utc': {'key': 'properties.reportEndTimeUtc', 'type': 'iso-8601'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + 'target_id': {'key': 'properties.targetId', 'type': 'str'}, + 'auth_type': {'key': 'properties.authType', 'type': 'str'}, + 'validation_detail': {'key': 'properties.validationDetail', 'type': '[ValidationResultItem]'}, } def __init__( self, *, + resource_id: Optional[str] = None, + status: Optional[str] = None, linker_name: Optional[str] = None, is_connection_available: Optional[bool] = None, report_start_time_utc: Optional[datetime.datetime] = None, @@ -1312,6 +1320,10 @@ def __init__( **kwargs ): """ + :keyword resource_id: Validated linker id. + :paramtype resource_id: str + :keyword status: Validation operation status. + :paramtype status: str :keyword linker_name: The linker name. :paramtype linker_name: str :keyword is_connection_available: A boolean value indicating whether the connection is @@ -1331,7 +1343,9 @@ def __init__( :keyword validation_detail: The detail of validation result. :paramtype validation_detail: list[~azure.mgmt.servicelinker.models.ValidationResultItem] """ - super(ValidateResult, self).__init__(**kwargs) + super(ValidateOperationResult, self).__init__(**kwargs) + self.resource_id = resource_id + self.status = status self.linker_name = linker_name self.is_connection_available = is_connection_available self.report_start_time_utc = report_start_time_utc @@ -1349,7 +1363,7 @@ class ValidationResultItem(msrest.serialization.Model): :vartype name: str :ivar description: The display name of validation item. :vartype description: str - :ivar result: The result of validation. Possible values include: "success", "failed", + :ivar result: The result of validation. Possible values include: "success", "failure", "warning". :vartype result: str or ~azure.mgmt.servicelinker.models.ValidationResultStatus :ivar error_message: The error message of validation result. @@ -1381,7 +1395,7 @@ def __init__( :paramtype name: str :keyword description: The display name of validation item. :paramtype description: str - :keyword result: The result of validation. Possible values include: "success", "failed", + :keyword result: The result of validation. Possible values include: "success", "failure", "warning". :paramtype result: str or ~azure.mgmt.servicelinker.models.ValidationResultStatus :keyword error_message: The error message of validation result. diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py index 750fc75831e1..685a3c6e3769 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py @@ -27,6 +27,12 @@ class AuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SERVICE_PRINCIPAL_CERTIFICATE = "servicePrincipalCertificate" SECRET = "secret" +class AzureResourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The azure resource type. + """ + + KEY_VAULT = "KeyVault" + class ClientType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The application client type """ @@ -68,21 +74,20 @@ class SecretType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): KEY_VAULT_SECRET_URI = "keyVaultSecretUri" KEY_VAULT_SECRET_REFERENCE = "keyVaultSecretReference" -class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class TargetServiceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The target service type. """ AZURE_RESOURCE = "AzureResource" CONFLUENT_BOOTSTRAP_SERVER = "ConfluentBootstrapServer" CONFLUENT_SCHEMA_REGISTRY = "ConfluentSchemaRegistry" - KEY_VAULT = "KeyVault" class ValidationResultStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The result of validation """ SUCCESS = "success" - FAILED = "failed" + FAILURE = "failure" WARNING = "warning" class VNetSolutionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py index 6f3e8a3b3322..082afccf8132 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py @@ -800,8 +800,8 @@ def _validate_initial( resource_uri: str, linker_name: str, **kwargs: Any - ) -> Optional["_models.ValidateResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ValidateResult"]] + ) -> Optional["_models.ValidateOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ValidateOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -832,7 +832,7 @@ def _validate_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ValidateResult', pipeline_response) + deserialized = self._deserialize('ValidateOperationResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -848,7 +848,7 @@ def begin_validate( resource_uri: str, linker_name: str, **kwargs: Any - ) -> LROPoller["_models.ValidateResult"]: + ) -> LROPoller["_models.ValidateOperationResult"]: """Validate a link. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource to @@ -864,14 +864,14 @@ def begin_validate( :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 ValidateResult or the result of + :return: An instance of LROPoller that returns either ValidateOperationResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicelinker.models.ValidateResult] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicelinker.models.ValidateOperationResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-05-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -889,7 +889,7 @@ def begin_validate( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ValidateResult', pipeline_response) + deserialized = self._deserialize('ValidateOperationResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/setup.py b/sdk/servicelinker/azure-mgmt-servicelinker/setup.py index fde148918054..7d300e2ba4b9 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/setup.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/setup.py @@ -65,6 +65,10 @@ 'azure', 'azure.mgmt', ]), + include_package_data=True, + package_data={ + 'pytyped': ['py.typed'], + }, install_requires=[ 'msrest>=0.6.21', 'azure-common~=1.1',