From 715179e8792fb609aae792431a30e74d16c93db0 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Mon, 16 Aug 2021 10:12:23 +0800 Subject: [PATCH 1/3] Update SDK --- .../_configuration_services_operations.py | 13 ++++++------- .../v2022_05_01_preview/models/_models.py | 8 ++++---- .../v2022_05_01_preview/models/_models_py3.py | 10 +++++----- .../_configuration_services_operations.py | 13 ++++++------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py index 018dccc5700..5d237ccbe7d 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_configuration_services_operations.py @@ -347,7 +347,7 @@ async def _validate_initial( self, resource_group_name: str, service_name: str, - configuration_service_settings: "_models.ConfigurationServiceSettings", + settings: "_models.ConfigurationServiceSettings", **kwargs: Any ) -> "_models.ConfigurationServiceSettingsValidateResult": cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationServiceSettingsValidateResult"] @@ -378,7 +378,7 @@ async def _validate_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configuration_service_settings, 'ConfigurationServiceSettings') + body_content = self._serialize.body(settings, 'ConfigurationServiceSettings') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -404,7 +404,7 @@ async def begin_validate( self, resource_group_name: str, service_name: str, - configuration_service_settings: "_models.ConfigurationServiceSettings", + settings: "_models.ConfigurationServiceSettings", **kwargs: Any ) -> AsyncLROPoller["_models.ConfigurationServiceSettingsValidateResult"]: """Check if the Application Configuration Service settings are valid. @@ -414,9 +414,8 @@ async def begin_validate( :type resource_group_name: str :param service_name: The name of the Service resource. :type service_name: str - :param configuration_service_settings: Application Configuration Service settings to be - validated. - :type configuration_service_settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings + :param settings: Application Configuration Service settings to be validated. + :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. @@ -438,7 +437,7 @@ async def begin_validate( raw_result = await self._validate_initial( resource_group_name=resource_group_name, service_name=service_name, - configuration_service_settings=configuration_service_settings, + settings=settings, cls=lambda x,y,z: x, **kwargs ) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py index f4423f72677..d7f21be86e4 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py @@ -1651,13 +1651,13 @@ def __init__( class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model): """Validation result for configuration service settings. - :param git_property_validate_result: Validation result for configuration service settings. - :type git_property_validate_result: + :param git_property_validation_result: Validation result for configuration service settings. + :type git_property_validation_result: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult """ _attribute_map = { - 'git_property_validate_result': {'key': 'gitPropertyValidateResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'}, + 'git_property_validation_result': {'key': 'gitPropertyValidationResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'}, } def __init__( @@ -1665,7 +1665,7 @@ def __init__( **kwargs ): super(ConfigurationServiceSettingsValidateResult, self).__init__(**kwargs) - self.git_property_validate_result = kwargs.get('git_property_validate_result', None) + self.git_property_validation_result = kwargs.get('git_property_validation_result', None) class CustomContainer(UserSourceInfo): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py index 0724046f270..9582a9ec1e2 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py @@ -1791,23 +1791,23 @@ def __init__( class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model): """Validation result for configuration service settings. - :param git_property_validate_result: Validation result for configuration service settings. - :type git_property_validate_result: + :param git_property_validation_result: Validation result for configuration service settings. + :type git_property_validation_result: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult """ _attribute_map = { - 'git_property_validate_result': {'key': 'gitPropertyValidateResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'}, + 'git_property_validation_result': {'key': 'gitPropertyValidationResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'}, } def __init__( self, *, - git_property_validate_result: Optional["ConfigurationServiceGitPropertyValidateResult"] = None, + git_property_validation_result: Optional["ConfigurationServiceGitPropertyValidateResult"] = None, **kwargs ): super(ConfigurationServiceSettingsValidateResult, self).__init__(**kwargs) - self.git_property_validate_result = git_property_validate_result + self.git_property_validation_result = git_property_validation_result class CustomContainer(UserSourceInfo): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py index fe204586802..241ea6c1c4d 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_configuration_services_operations.py @@ -356,7 +356,7 @@ def _validate_initial( self, resource_group_name, # type: str service_name, # type: str - configuration_service_settings, # type: "_models.ConfigurationServiceSettings" + settings, # type: "_models.ConfigurationServiceSettings" **kwargs # type: Any ): # type: (...) -> "_models.ConfigurationServiceSettingsValidateResult" @@ -388,7 +388,7 @@ def _validate_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configuration_service_settings, 'ConfigurationServiceSettings') + body_content = self._serialize.body(settings, 'ConfigurationServiceSettings') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -414,7 +414,7 @@ def begin_validate( self, resource_group_name, # type: str service_name, # type: str - configuration_service_settings, # type: "_models.ConfigurationServiceSettings" + settings, # type: "_models.ConfigurationServiceSettings" **kwargs # type: Any ): # type: (...) -> LROPoller["_models.ConfigurationServiceSettingsValidateResult"] @@ -425,9 +425,8 @@ def begin_validate( :type resource_group_name: str :param service_name: The name of the Service resource. :type service_name: str - :param configuration_service_settings: Application Configuration Service settings to be - validated. - :type configuration_service_settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings + :param settings: Application Configuration Service settings to be validated. + :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. @@ -449,7 +448,7 @@ def begin_validate( raw_result = self._validate_initial( resource_group_name=resource_group_name, service_name=service_name, - configuration_service_settings=configuration_service_settings, + settings=settings, cls=lambda x,y,z: x, **kwargs ) From bfc9fede262d56401dd1892a93cadab5cbfa99e1 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Mon, 16 Aug 2021 10:24:00 +0800 Subject: [PATCH 2/3] fix bug --- src/spring-cloud/azext_spring_cloud/_validators_enterprise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py index f7789f7f40e..805def0ea91 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py +++ b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py @@ -108,7 +108,7 @@ def validate_buildpacks_binding_not_exist(cmd, namespace): if binding_resource is not None: raise CLIError('Buildpacks Binding {} already exists ' 'in resource group {}, service {}. You can edit it by set command.' - .format(binding_name, resource_group, service)) + .format(namespace.name, namespace.resource_group, namespace.service)) except ResourceNotFoundError: # Excepted case pass From 7078bc44ed8fdf5b3874c7b5c8b6708b169131a9 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Mon, 16 Aug 2021 16:50:11 +0800 Subject: [PATCH 3/3] Update SDK --- .../_app_platform_management_client.py | 5 - .../aio/_app_platform_management_client.py | 5 - .../aio/operations/__init__.py | 2 - .../_service_registries_operations.py | 109 +++++++++++++++++ .../operations/__init__.py | 2 - .../_service_registries_operations.py | 111 ++++++++++++++++++ 6 files changed, 220 insertions(+), 14 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py index 56650ef8a36..81c5e3d2400 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py @@ -23,7 +23,6 @@ from .operations import ConfigServersOperations from .operations import ConfigurationServicesOperations from .operations import ServiceRegistriesOperations -from .operations import ServiceOperations from .operations import BuildServiceOperations from .operations import BuildpacksBindingOperations from .operations import MonitoringSettingsOperations @@ -49,8 +48,6 @@ class AppPlatformManagementClient(object): :vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.operations.ConfigurationServicesOperations :ivar service_registries: ServiceRegistriesOperations operations :vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceRegistriesOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceOperations :ivar build_service: BuildServiceOperations operations :vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.operations.BuildServiceOperations :ivar buildpacks_binding: BuildpacksBindingOperations operations @@ -107,8 +104,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.service_registries = ServiceRegistriesOperations( self._client, self._config, self._serialize, self._deserialize) - self.service = ServiceOperations( - self._client, self._config, self._serialize, self._deserialize) self.build_service = BuildServiceOperations( self._client, self._config, self._serialize, self._deserialize) self.buildpacks_binding = BuildpacksBindingOperations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py index 3e1e3034473..372eb15ad69 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py @@ -21,7 +21,6 @@ from .operations import ConfigServersOperations from .operations import ConfigurationServicesOperations from .operations import ServiceRegistriesOperations -from .operations import ServiceOperations from .operations import BuildServiceOperations from .operations import BuildpacksBindingOperations from .operations import MonitoringSettingsOperations @@ -47,8 +46,6 @@ class AppPlatformManagementClient(object): :vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ConfigurationServicesOperations :ivar service_registries: ServiceRegistriesOperations operations :vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceRegistriesOperations - :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceOperations :ivar build_service: BuildServiceOperations operations :vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.BuildServiceOperations :ivar buildpacks_binding: BuildpacksBindingOperations operations @@ -104,8 +101,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.service_registries = ServiceRegistriesOperations( self._client, self._config, self._serialize, self._deserialize) - self.service = ServiceOperations( - self._client, self._config, self._serialize, self._deserialize) self.build_service = BuildServiceOperations( self._client, self._config, self._serialize, self._deserialize) self.buildpacks_binding = BuildpacksBindingOperations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py index 8858c1d09e8..e303e49bf81 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py @@ -10,7 +10,6 @@ from ._config_servers_operations import ConfigServersOperations from ._configuration_services_operations import ConfigurationServicesOperations from ._service_registries_operations import ServiceRegistriesOperations -from ._service_operations import ServiceOperations from ._build_service_operations import BuildServiceOperations from ._buildpacks_binding_operations import BuildpacksBindingOperations from ._monitoring_settings_operations import MonitoringSettingsOperations @@ -28,7 +27,6 @@ 'ConfigServersOperations', 'ConfigurationServicesOperations', 'ServiceRegistriesOperations', - 'ServiceOperations', 'BuildServiceOperations', 'BuildpacksBindingOperations', 'MonitoringSettingsOperations', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py index 72013ca2b60..660793dc75b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py @@ -222,3 +222,112 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Service Registry. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py index 8858c1d09e8..e303e49bf81 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py @@ -10,7 +10,6 @@ from ._config_servers_operations import ConfigServersOperations from ._configuration_services_operations import ConfigurationServicesOperations from ._service_registries_operations import ServiceRegistriesOperations -from ._service_operations import ServiceOperations from ._build_service_operations import BuildServiceOperations from ._buildpacks_binding_operations import BuildpacksBindingOperations from ._monitoring_settings_operations import MonitoringSettingsOperations @@ -28,7 +27,6 @@ 'ConfigServersOperations', 'ConfigurationServicesOperations', 'ServiceRegistriesOperations', - 'ServiceOperations', 'BuildServiceOperations', 'BuildpacksBindingOperations', 'MonitoringSettingsOperations', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py index 91878c6cbe2..4b2180a5ef3 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py @@ -229,3 +229,114 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Disable the default Service Registry. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore